How to programmatically change style in an ADF table

Hi,
I got an ADF table generated form my data controls.
But I need to change de style of every cell in my backing bean.
I can't really find anything usefull on google, hopefully you guys can provide me with some usefull information.

I got my answer somewhere else :
>
Based on the comments we now know that you use jdev 11.1.2.2.0. What you can do is to bind the styleClass property of the table to a backing bean property. The property in the bean has a getter and a setter method. In the setter method you can get all the values you need from the row and do you calculation. Based on the outcome you return the name of a style class suitable for the cell. The different style classes you define in a skin fro the application. If you e.g. defien the following style classes in your skin
.high_value { background-color:green; }
.negative_value { background-color:red;}
and in a bean in request scope, which you access from the page the table is on
    private String styleForCell;
public String getStyleForCell()
    // get the value of the cell
    FacesContext lContext = FacesContext.getCurrentInstance();
    ELContext lELContext = lContext.getELContext();
    ExpressionFactory lExpressionFactory = lContext.getApplication().getExpressionFactory();
    Number val;
    val = (Number) lExpressionFactory.createValueExpression(lELContext, "#{row.valargument}", Object.class).getValue(lELContext);
    if (val == null)
        return "";
    // do the calculation and return the suitable style class
    int ival = val.intValue();
    if (ival >= 100000 )
        return "high_value";
    else if (ival < 0)
        return "negative_value";
    else
        return "";        
public void setStyleForCell(String aStyleForCell)
    this.styleForCell = aStyleForCell;
}Now you can access the calculated style class from the tables column styleClass property as #{beanname.styleForCell} This will call the method for each cell of the column.

Similar Messages

  • How can I change the OWNER of a table?

    How can I change the OWNER of a table entr2009mm ?
    Resp. the OWNER of all TABLES whose tablename match the pattern *2009* ?
    Peter

    Hello,
    There're different posiibilities, Export/Import can do it.
    But, if it's not a too large Table, you can use CTAS (from a user with DBA privilege for instance).
    Create Table <schema_target>.<table_name> as select * from <shema_source>.<table_name>;Then, you have to recreate the dependent objects (Index, ...) and drop the Source Table.
    If you have a set of Tables, it's better to use Export/Import.
    Hope this help.
    Best regards,
    Jean-Valentin
    Edited by: Lubiez Jean-Valentin on Feb 9, 2010 8:20 PM

  • How to programmatically change the cell color of an ADF table ?

    Hi all,
    I have an ADF table with some fields on it. Depending on the value of a field named, say, "F1", I would like to change its background color.
    So far I can change the field color with this EL expression inside the InlineStyle table column property:
    font-size:medium; background-color:#{viewScope.myBean.setColor};
    where setColor is a bean function, in where I access the field "F1" via binding, parse its value, and return the right value - so far, so good.
    The bad thing is, the InlineStyle affects that field in all the rows of the table, while I would like to change only the field in the rows, which have that specific value in it.
    So for example having the rows:
    F1
    abc#1 ----> currently selected row
    cde#2
    efg#3
    I want to change the background color to all the F1 fields which have a "1" after the '#' and let the other "F1" row cells background color stay unchanged.
    But as you can imagine, the InlineStyle affect the "F1" background color in all the rows (assuming that the first row of the table is selected).
    So the question: how to access a single cell of a row in an ADF table, and programmatically change its background color ?
    So far I can iterate through the ADF table with:
    BindingContext bindingctx = BindingContext.getCurrent();
    BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
    DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
    DCIteratorBinding dciter = bindingsImpl.findIteratorBinding("aTableIterator");//access the iterator by its ID value in the PageDef file
    RowSetIterator rsi = dciter.getRowSetIterator();
    System.out.println("rsi getrowcount = " rsi.getRowCount());+
    Row row = null;
    +if (rsi.getRowCount() > 0) {+
    row = rsi.getCurrentRow();
    System.out.println("row attr = " Arrays.toString(row.getAttributeNames()));+
    System.out.println("class : " row.getAttribute("F1").getClass().toString());+
    +}+
    +while (rsi.hasNext()) {+
    row = rsi.next();
    System.out.println("row attr = " Arrays.toString(row.getAttributeNames()));+
    +}+
    Regards,
    Sergio.

    Hi,
    I mean a specific cell within a row.
    Here are two pictures that show an ADF table with two rows and some fields on it:
    https://skydrive.live.com/?cid=7D3084D8BF755808&id=7D3084D8BF755808!107&sc=documents#cid=7D3084D8BF755808&id=7D3084D8BF755808!107&sc=documents
    bild_A is what I have, bild_B is what I would like. Note that:
    in bild_A the first row contain a yellow background color for the field F4 and an orange background color for the field F5. This is correct, because F4 has an "1" at the end of its string value, and F5 has a "3" at the end. So far so good.
    But the second row (again, bild_A) has also the fields F4 with yellow background color, and the field F5 with orange background color, even if the value in both fields is 0.
    What is should be, is shown in bild_B.
    The problem is that the solution provided affects all the cells of the column, while I need to change the background color of a single cell, and leave the other unchanged (see bild_B).
    I hope that clarify a bit :)
    Sergio.

  • How to programmatically change the width of a graph?

    How can I programmatically change the width of a Waveform Graph or Waveform Chart? When I create an implicit property node for a graph or chart, it is read-only. Changing the plot bounds worked in earlier versions of LabVIEW, but not anymore.
    Solved!
    Go to Solution.

    It works for me in LV2013 but I'm using the Plot Area : Size : Width property.
    Using LabVIEW: 7.1.1, 8.5.1 & 2013

  • How to programmatically change the password of user accounts in PDF Generator

    I am using 4 user accounts for multi-thread converting Word documents to PDF in PDF Generator ES3, and I have to update the password of those user accounts. Does PDF Generator ES3 save the password somewhere on the Windows 2008 server? Can I programmatically change the password of those accounts other than updating them manually from LiveCycle Admin console?
    Thanks,
    Will

    Not in LiveCycle API.
    Changing user account password is related to Operating System.

  • How to change "next" "previous" in ADF table ?

    **hi ,**
    **I am using oracle jdev 10.1.3.4**
    **I want to put my own text instead of "next" "previous" in ADF table , also I have the same problem in shuttle box ,**
    **I want to change the default javascript validation (ex: shuttle box alerts)**
    **I do not know to customize it or where these files saved ?**
    **any one can help ?**

    Hi Dave,
    Thank you so much for the email.  I tried every object and method I can
    posibly think about such as
    myTable.Rows.Item(1).PointSize = 24
    myCell.Characters.Item(1).PointSize = 24
    I got error message all the time.  These objects don’t support PointSize.
    All I need is to change point size of the text in InDesign tables created
    using VBScript. Could you help me with this?  Thanks,
    Regards,
    Li

  • How to programmatically change plot legend

    I have a chart on which I'll plot one or more signals. I can't predict
    the signal names in advance so I'd like to programmatically change the
    legend(s). Is there a way to do that in LV 6.1?
    Thanks,
    Dave

    Yes.
    - Create a property node for the chart
    - add elements for "Active Plot" and "Plot -> Plot Name"
    - Wire an index of the plot name you want to change to "ActPlot"
    - Wire an string with the new name to "Plot.Name"
    A simple implementation would be to make an array of new names and then auto-index a for loop with the increment counter tied to "ActPlot".
    Good luck.

  • ADF 11g How to create the custom FilterableQueryDescriptor for adf table

    Can you please let me know on the following.
    1. I am dispalying the adf table using a List from the managed bean
    2. I wanted to filter the table using the filter model.
    3. i wanted to create the sub class of FilterableQueryDescriptor which i can specify. Not finding enough information on how to create and add the information in the setFilterCriteria
    Can you please provide some insight into this topci

    Hello there
    I have the same issue: chaging the background color of some column headers.
    My application is using a custom skinning and when i had headerClass property with a custom class defined in a separate css file, the page generated specified first the class from the skinning and then my new class definition. But my skinning is specifying a background color so the color is not overriden. Any idea?
    ADF code:
    <link type="text/css" rel="stylesheet" href="../../css/pivot.css" id="myStyles"/>
    <af:column headerText="#{level1.userObject.name}"
    headerClass="inputHeader"
    sortable="false" align="center" width="100"
    id="col_level1" >
    Generate HTML code:
    <th align="center" class="xuh inputHeader" afrroot="true" rowspan="2" afrleaf="true" dindex="6" id="pt1:tableId:col_level1" style="">
    <div class="x13t">AEKLF</div>
    </th>
    My CSS file:
    .inputHeader{
    background-color: Red;
    background-image: none;
    color: Black;
    font-weight: bold;
    Thanks for your help !

  • How to delete a selected row from adf table

    Hi
    I am using a ADF Table to get data from the database, i need to select a specific row and then delete it how to get
    this done.
    Thanks in Advance.

    Or try this code:
    In your backing bean:
        public void deleteRows(ActionEvent actionEvent) {
            ((AppModuleImpl)getApplicationModuleForDataControl()).deleteRowEmp();
        public static Object resolveExpression(String expression)
                try
                    FacesContext facesContext = FacesContext.getCurrentInstance();
                    Application app = facesContext.getApplication();
                    ExpressionFactory elFactory = app.getExpressionFactory();
                    ELContext elContext = facesContext.getELContext();
                    ValueExpression valueExp =
                        elFactory.createValueExpression(elContext, expression, Object.class);
                    return valueExp.getValue(elContext);
                catch (Exception e)
                   ;// log you message here
                return null;
             * Get application module for an application module data control by name.
             * @param name application module data control name
             * @return ApplicationModule
            public static ApplicationModule getApplicationModuleForDataControl()
                return (ApplicationModule) resolveExpression("#{data.AppModuleDataControl.dataProvider}");
            }In your AppmoduleImpl:
        public void deleteRowEmp(){
            this.getEmpView1().removeCurrentRow();
            this.getDBTransaction().commit();
        }And another option is to expose the appmodule method as a client and bind to the jspx as a button.

  • How to get edited row values from ADF table?

    JDev 11.
    I have a table which is populated with data from Bean.
    I need to save changes after user make changes in any table cell. InputText is defined for table column component.
    I have defined ValueChangeListener for inputText field and AutoSubmit=true. So when user change value in inputText field, method is called:
    public void SaveMaterial(ValueChangeEvent valueChangeEvent) {
    getSelectedRow();
    SaveMaterial(material);
    This method should call getSelectedRow which take values from selected table row and save them into object:
    private Row getSelectedRow(){
    RichTable table = this.getMaterialTable();
    Iterator selection = table.getSelectedRowKeys().iterator();
    while (selection.hasNext())
    Object key = selection.next();
    table.setRowKey(key);
    Object o = table.getRowData();
    material = (MATERIAL) o;
    System.out.println("Selected Material Desc = "+material.getEnumb());
    return null;
    Problem is that getSelectedRow method doesnt get new (edited) values, old values are still used.
    I have tried to use ActiveButton with same method and it works fine in that case. New values are selected from active row and inserted into object.
    JSF:
    <af:table var="row" rowSelection="single" columnSelection="single"
    value="#{ManageWO.material}" binding="#{ManageWO.materialTable}">
    <af:column sortable="false" headerText="E-number">
    <af:inputText value="#{row.enumb}" valueChangeListener="#{ManageWO.SaveMaterial}" autoSubmit="true"/>
    </af:column>
    <af:column sortable="false" headerText="Description">
    <af:inputText value="#{row.desc}" valueChangeListener="#{ManageWO.SaveMaterial}" autoSubmit="true"/>
    </af:column>
    </af:table>
    <af:activeCommandToolbarButton text="Save" action="#{ManageWO.EditData}"/>
    What is a correct place from where save method should be called to get new (edited) values from ADF table?
    Thanks.

    Did you look into the valueChangeEvent?
    It has oldValue and newValue attributes.
    public void SaveMaterial(ValueChangeEvent valueChangeEvent) {
    Object oldVal = valueChangeEvent.getOldValue();
    Object newVal = valueChangeEvent.getNewValue();
    // check if you see what you are looking for.....
    getSelectedRow();
    SaveMaterial(material);
    }Timo

  • How do I change the order of input tables in joiner?

    I have 3 input tables in a JOINER, how can I change the order? for instance, the order now is: t1, t2, t3, for some reason, I want to change to t3, t2,t1.
    I use outer join among tables, different table order cause OWB generated different sql statement.
    Please help! Thanks.

    Unfortunately you cannot... The only way is to remove one group, then create a new one instead and re-connect the group...
    JP

  • How to focus a specified column in ADF Table at run time?

    I drag and drop an ADF table.It contains *10 column*..I bind the column using ArrayList..First 3 column is set frozen =True..At the time of runtime,a Horizontal scroll is appeared..*May be for certain conditions , only 8th column contains values at run time.So i want to focus that column Only*.Because it is very easy for an user to see the value..If not,user has to scroll the bar to check. How can  i focus a specified column?

    Hi Briston,
    You can make the column selected by setting "selected" property of column to true
    Sireesha

  • How can I change column name in ALV table in WebDynpro ABAP?

    Hi Everyone,
    I have created an ALV table in WebDynpro ABAP. I have created a context node and added the required attributes there - for the ALV display.
    Now I want to change one columnn name of the ALV table.... Currently it is showing the description of the data element, which I don't want to show. I cannot create a new DE only for this purpose.
    Please let me know how can I change the name of the column.
    Regards

    Hi,
    This may help you to define your own column text in the ALV Table of webdynpro.
    see the below code.
    Here 'STATUS_ICON' is the column of the the output display of the ALV Table of webdynpro.
    "change the label of the report.
    DATA: lr_weeknum TYPE REF TO cl_salv_wd_column.
    CALL METHOD l_value->if_salv_wd_column_settings~get_column
    EXPORTING
    id = 'STATUS_ICON'
    RECEIVING
    value = lr_weeknum.
    SET THE LABEL OF THE COLUMN
    DATA: hr_weeknum TYPE REF TO cl_salv_wd_column_header.
    CALL METHOD lr_weeknum->get_header
    RECEIVING
    value = hr_weeknum.
    CALL METHOD lr_weeknum->set_resizable
    EXPORTING
    value = abap_false.
    hr_weeknum->set_prop_ddic_binding_field(
    property = if_salv_wd_c_ddic_binding=>bind_prop_text
    value = if_salv_wd_c_ddic_binding=>ddic_bind_none ).
    set the text of the column
    CALL METHOD hr_weeknum->set_text
    EXPORTING
    value = 'C Form'.
    regarads,
    balu

  • How to differentiate a row in a ADF table in Oracle 11g

    Hi
    How to differentiage the each row in a ADF table with the back ground colour? I tried with RowBandingInterval option, but it didn't work out?
    Thanks

    Hi,
    setting row banding to 1 (the default) works for me on FF and IE 7
    Frank

  • How to set default sorting order in ADF Table

    Hi,
    I want to set the default sorting order as ascending in adf table. Please help me regarding how can we do it.
    Using JDev 11.1.1.5.0

    Hi Frank,
    Thanks for the quick reply.
    I have done binding of table with list of pojos.
    The Class for which Data control is created is as:-
    public class DemoDC {
        private List<TableEntity> tableList =
            new ArrayList<TableEntity>();
        public List<TableEntity> getTableList() {
            return tableList;
        public void setTableList(List<TableEntity> tableList) {
            this.tableList = tableList;
    where TableEntity is a pojo which has all the columns as its attributes.
    Now when i do the above steps , after clicking on pencil icon and seecting the iterator name in the iterator tab (DemoDC-> tableList) , and selcting the 'sort criteria' tab when i select a column and try to set the sort order  I get error as ' Iterator can not be created for the selected node ' .

Maybe you are looking for

  • Unicode Characters not displaying properly after updating to 13.0.1+

    Previously, I had installed the Symbola font because certain symbols were not displaying properly in Firefox (notably on Twitter). Installing the font solved the problem for the most part (the four bit hex characters still didn't show up, but the six

  • Database Recovery

    We have a Live 9i database with archive logging. We now want to setup a standby 9i database, so in case anything happens on Live system we will switch on standby. What are the differences between using a physical standby setup or a logical standby se

  • Browser crash upon debug

    Hello, my Firefox browser always freezes up when I debug and receive a Flex error. If I debug and no errors, then it does not freeze. I have been using Firefox 3.04 and 3.5.  Both have this problem. Does anyone have any advice ?

  • Data Migrate ?

    Hi gurus:     How to export the the object what I did like Infoobject & InfoCube &InfoSource & so on from one server, then import to another server. Thanks. chan

  • 10.1.2 Patch Does Not Work for everyone... Don't be fooled (Printing)

    Dear Adobe, As an enterpirse level organization (school district), your solution to resolve the Adobe PDF print issue does not work. Our only method so far has been to downgrade clients to 10.1.1 as this was the last stable build. Between your countl