Change the background color of selected row in adf table

Hi,
Can somebody guide me in changing the background color of a row when its being selected. In my ADF table, one of the column is of type Command Link. So whenever i click this command link on any particular row that complete row color should change as an indication of that row being selected.
Please guide me to do this. I referred to other forum posts, but they couldnt meet my need.
Thanks
ri

Hi Frank,
you're right. This should work. But the result is not perfect from my point of view.
I use
<af:table ...>
  <af:column ...>
    <af:outputText value="#{row.col1}" inlineStyle="#{row.mystyle}"/>
  </af:column>
</af:table>and I get e.g. this in HTML:
<table ...>
  <tr>
    <td class="af_column_cell-text OraTableBorder1111"><span style="font-weight:bold;">qqq</span></td>
  </tr>
</table>while I would prefer to get somethig like this:
<table ...>
  <tr>
    <td style="font-weight:bold;"><span>qqq</span></td>
  </tr>
</table>, which looks much smarter. Is it possible?
Thanks,
Alexandre.

Similar Messages

  • How do I change the background color of a row in a table indicator?

    Hello,
      How do I change the background color of a row in a table indicator? I know how to change the background color in a active cell, but that is not what I want. My first intent is to make the background color of the first row a unique color, such as green, just to highlight the top row of the table.
    Regards,
    Kaspar
    Regards,
    Kaspar

    I have done this before by using a for loop to change the active cell of a row in order to give the appearance that the whole row is turning the color at once.
    CLA, CLED, CTD,CPI, LabVIEW Champion
    Platinum Alliance Partner
    Senior Engineer
    Using LV 2013, 2012
    Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.

  • How do you change the background color of certain rows in a Datagrid?

    How do you change the background color of certain rows in a
    Datagrid?

    Hee is a great example:
    http://www.cflex.net/showfiledetails.cfm?ChannelID=1&Object=File&objectID=487
    Tracy

  • Want to change the Background Color of Selected Tab

    Hi All,
    I want to change the Background Color of Selected Tab of the tabstrip visible in Content Admin Role (Browse, Overview etc.).
    I have changed the Background Color of Selected Tab - Tabstrips-Complex Elements through Theme Editor, but that did not take effect.
    Only the other webdynpro components tabstrips took effect.
    Regards,
    Vishal

    Hi Andre,
    I don't know if you have already figured out how to change the background color of the tabstrip, but I will explain how we have done it.
    You might have tried to change the background color in "Tabstrip" (under the menu "Complex Elements") in Theme Editor. When you change the property "Background color of selected/unselected tabs", this will not change the color of the images on the tabstrip (ex. the triangle on the side of the tab). These images are on the server. We copied these images and then made changes to them, before we uploaded them again through the Theme Editor.
    The path to find the images is /usr/sap/~/JC01/j2ee/cluster/server0/apps/sap.com/irj/servlet_jsp/irj/root/portalapps/com.sap.design.urdesigndata/themes/portal/the name of your theme/common/tablist
    If this didn't work for you, you might have to change the properties in "Pattern Containers" (under Complex Elements") in Theme Editor. The tablist properties are under the header "Tab Container".
    I think it should work for you then. We also found that there was some problems when we tried to view the changes in Firefox, but haven't figured out how to solve this.
    /Ellen

  • How to change the semantic color of entire rows in a table.

    Hi, in the past I already managed to change the semantic color of a cell by a condition (for example all the cells with negative number -> I set negative semantic color)
    My question is how can I change the semantic color of the entire row where this cell belong, and not only the cell. Im using NW2004.
    BTW, Im not a java programmer, neither a Webdynpro expert, just an ABAP Programmer. So try to be very explicit, Thx.

    Rodrigo,
    You can just bind correspondign property of every cell editor (TextView) of every column to the very same context attribute. Next, when you change attribute value for certain elemnt, the whole row (every cell editor in row) will get same value.
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net

  • Changing the background color of the row of the selected cell in table view

    How can I change the background color of the table row when user clicks on table cell in table view?
    Edited by: a_brar on May 5, 2012 11:12 PM

    You could apply the following css style (by defining a custom stylsheet with the following lines and loading it into your app).
    The last color sets the background color of the selected row while the table-view has focus (in this case to orange).
    .table-view:focused .table-row-cell:filled:focused:selected {
        -fx-background-color: -fx-focus-color, -fx-cell-focus-inner-border, orange;
    }There are quite a lot of subtleties in the css styling for the tableview (e.g. different colors for the selected row when the control has focus vs when it doesn't or when the user hovers over a selected row in an unfocussed tableview), which you may want to cater for when chaning the background color of the selected row in a table view. There is also alternate styling for when the tableview is in row selection vs cell selection mode. So you may want to look at customizing further based on the css styles in caspian.css in sdk/rt/lib/jfxrt.jar if you can understand the complex css there.

  • How to change the background color of a single row

    Hi OTN,
    I am using JDeveloper 11.1.1.2 with ADF faces in view layer.My issue is How to change the background color of a single row in af:table ?.

    How to highlight ADF table row based on column value?
    Found by searching

  • Change the background color in a report cell - td bgcolor

    Hi.
    I have a report in which I would like to change the background color of a table cell based on some values in the underlying query
    If Column A > Column B and Column C > 10, I want to color the background green. In my cgi , this was easy, but in apex, even if I write the query to output html, won't everything already be wrapped in the <td></td> tags? Is there any way around this?
    Thanks

    Mike ,
    With the above solution you can conditionally fill the report cell with a particular color and not the entire row set. If you want to highlight entire row, you have to do something different. Take a look at this jQuery function
    Step 1 . Download jquery http://code.jquery.com/jquery-1.4.2.min.js
    Step 2. Upload it to apex image folder using shared component.
    Step 3. In the page header put the following code
    <script src="#WORKSPACE_IMAGES#jquery-1.4.js" type="text/javascript" ></script>
    <script type="text/javascript">
    $(document).ready(function(){
         if ($('.apexir_WORKSHEET_DATA').length > 0) {
              function HighLightRows(){
                                       $("table.apexir_WORKSHEET_DATA tbody td:has(COLOR_GRAY)").siblings().addClass('greentd');
                                       $("table.apexir_WORKSHEET_DATA tbody td:has(COLOR_GRAY)").addClass('greentd');
                                       $("table.apexir_WORKSHEET_DATA tbody td:has(COLOR_GREEN)").siblings().addClass('graytd');
                                       $("table.apexir_WORKSHEET_DATA tbody td:has(COLOR_GREEN)").addClass('graytd');
         // This time out is required since after the report is refreshed via AJAX,
                                  setTimeout(function(){HighLightRows();},1000);
         }//if
    HighLightRows();
    </script>
    <style type="text/css">
    .apexir_WORKSHEET_DATA td.greentd
    background-color: green !important;
    .apexir_WORKSHEET_DATA td.graytd
    background-color: gray !important;
    </style>
    Step 4. Change the SQL Query to
    SELECT
         SALE_DATE
         ,PRODUCT_NAME
         ,PRODUCT_ID
         , CASE WHEN SALE_DATE > ADD_MONTHS(SYSDATE,-2) THEN
                     '<COLOR_GREEN>&#38;nbsp;</COLOR_GREEN>'
              ELSE
                      '<COLOR_GRAY>&#38;nbsp;</COLOR_GRAY>'
         PRODUCT_NAME_COLOR
    FROM SALES;
    Step 5. Make this new column PRODUCT_NAME_COLOR visible and in the column heading u can just put &#38;nbsp;.
    As long as this column will be available for display you will see the conditional highlighting.Thanks,
    Manish

  • Getting the background color from a row

    I'm displaying a table that has alternating row colors for odd and even... when I click on a row I am changing the color to blue. When I click on a different row I want to set the background color back to what it was for the originally selected row and change the currently selected row to blue. This worked just fine when I had the colors hard coded into the code... but as soon as I started using style sheets it stoped working,
    My questions is how do I get the background color from a row... for instance, the following alert dislays nothing. How can I get the actual color out for the row?
    var tableElem = document.getElementById('table');
    var rowElem;
    rowElem = tableElem.rows[0];
    alert(rowElem.bgColor);
              

    If you're working with style sheets, then ignore the background color. You don't want to care what color is actully being used, only that the correct style is in place.
    Worry instead about the className property for your row:<style>
    .highlightRow {
       color: white;
       background-color: gray;
    .normalRow {
       color: black;
       background-color: white;
    </style>
    var tableElem = document.getElementById("table");
    var rowElem = tableElem.rows[0];
    alert(rowElem.className);
    <table id="table">
    <tr class="normalRow"><td>...</td></tr>
    <tr class="highlightRow"><td>...</td></tr>
    </table>

  • In Pages 09' how do I change the background colors on the templates?

    I have been trying to change the background on one of the templates from red to green for a while.  I can't figure it out and i can't find answers online any where that are helpful at all.  I just need to changes the background color to what I want it to be and not what the programs sets them too.  Any ideas?  I'm totally stumped!
    Thanks for the help!

    Hi Burke,
    Here's the result, using Peggy's suggestion:
    Process:
    Click on the thin strip of red to the left of the title ("THE THOMPSONS") to select the background.
    You'll see the small x in each corner, indicating the object is locked.
    Go Arrange > Unlock (or press option-command-L) to unlock the object.
    Click on the Fill Color well in the format bar, and choose a new colour from the palette.
    Go Arrange > Lock (or press command-L to re-lock the object.
    Save the result.
    Regards,
    Barry

  • How to change the background color of a cell based on other cell background

    Hi,
    Sorry if this is a basic question - I am new to XML. I want to create a table column, with no data in it. I then want to change the background color of the column based on the background color of other columns. I.E.
    - If there are 3 or less cells in this row that are not green, color this cell green.
    - If there are 4 or less cells in this row that are not green, and 3 or less are not red, color this cell yellow.
    - If there are 4 or less cells in this row that are not green, and 3 or more are red, color this cell red.
    If there are 5 or more cells in this row that are not green, color this cell red.
    Many thanks for any assistance.

    Okay - I have this resolved.
    1. Create two variables (Yellow and Red):
    <?xdoxslt:set_variable($_XDOCTX, 'Yellow', 0)?>
    <?xdoxslt:set_variable($_XDOCTX, 'Red', 0)
    2. For each cell, set the background based on their individual traffic light criteria, and update the associated color variable by 1. By default the backgrd color is set to Yellow so I only have to check for the lower and upper bounds:
    <?choose:?>
    <?when:number(CHECKED_IN)<=1?>
    <?attribute@incontext:background-color;'Lime'?>
    <?end when?>
    <?when:number(CHECKED_IN)>3?>
    <?attribute@incontext:background-color;'Red'?>
    <?xdoxslt:set_variable($_XDOCTX, 'Red', xdoxslt:get_variable($_XDOCTX, 'Red') +1)?>
    <?end when?>
    <?otherwise?>
    <?xdoxslt:set_variable($_XDOCTX, 'Yellow', xdoxslt:get_variable($_XDOCTX, 'Yellow') +1 )?>
    <?end otherwise?>
    <?end choose
    3. I now want a cell that is Red if any of the cells in the row is red. Its yellow of there are 3 or more yellow cells in the row, and no reds. Otherwise its green. First, create an empty cell and make the default color green. Then add:
    <?if: number(xdoxslt:get_variable($_XDOCTX,'Red')) > 0?>
    <?attribute@incontext:background-color;'Red'?>
    <?end if?>
    <?if: number(xdoxslt:get_variable($_XDOCTX,'Yellow')) >= 3 and number(xdoxslt:get_variable($_XDOCTX,'Red')) = 0?>
    <?attribute@incontext:background-color;'Yellow'?>
    <?end if?>
    4. Finally, reset the variables for the next row:
    <?xdoxslt:set_variable($_XDOCTX, 'Yellow', 0)?>
    <?xdoxslt:set_variable($_XDOCTX, 'Red', 0)

  • How can I change the background color in the inbox?

    The background color in my inbox (well, all mailboxes) is white. A yellow background would make the existing black text a lot easier to read. How can I change the background color in the inbox?

    Themes work in Thunderbird - duggabe was not refering to Firefox.
    Another useful addon is theme and font changer:
    * https://addons.mozilla.org/fr/thunderbird/addon/theme-font-size-changer/
    However, Thunderbird allows you to modify all sorts of things.
    Make hidden files and folders visible:
    * http://kb.mozillazine.org/Show_hidden_files_and_folders
    Help > Troubleshooting Information
    Click on 'show Folder' button
    a window opens shwoing profile folder name
    Close Thunderbird now - this is important
    In the profile name folder, Create a new folder called '''chrome''' - note the spelling
    It should be in the same place as the 'Mail' folder.
    see first image below.
    Open Notepad
    Can be located : Start > Programs > accessories
    Copy everything shown between the lines below.
    Paste into Notepad.
    Save as '''userChrome.css''' - note the spelling (edit updated - this was a typo error)
    This should be saved in the '''chrome''' folder.
    see second image below.
    Restart Thunderbird.
    I have chosen a yellow for you
    <pre>
    #f6f58c = a yellow....it is a hex code for a colour.
    </pre>
    You can change it if required. Remember when updating anything in the profile folders, you must close Thunderbird first.
    More info on colours.
    * http://www.yourhtmlsource.com/stylesheets/namedcolours.html
    <pre>
    * Do not remove the @namespace line -- it's required for correct functioning
    @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
    /*Background colour for message list*/
    #threadTree > treechildren::-moz-tree-row {
    background-color: #f6f58c !important;
    </pre>
    -------------------------------------------

  • How to change the Background color of a cell in JTable

    hi!
    Actually i want to change the background color of few cells in JTable
    is there any method to make this change in JTable ?
    and also is it possible to have 5 rows with single column and 5 rows with 3 columns in a single JTable

    i want to change the background color of few cells in JTableDepending on your requirements for the coloring of cells it may be easier to override the prepareRenderer() method of JTable:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=610474

  • How to change the background color of a cell in datagrid using flex3

    i want to change the background color of a cell.....how can i achieve this.....and also i want to know how a spacing cane be done between cells in a datagrid...plzzz help me???

    The only way I can see to do this is to use an item renderer for your cells.  This is really scruffy and would need tyding up, and maybe with a little more time could do better or someone else may have an idea but none the less this works.
    Define a custom component as below;
    This has logic to see what the value of the data is proveided by the dataprovider for the row, and if it matches the conditions in this case is equal to 5 sets the background color.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="88" height="26" dataChange="doColor()" borderColor="#000000" borderStyle="solid"
        backgroundAlpha="1">
        <mx:Script>
            <![CDATA[
                private function doColor():void {
                    if (data.value == 5) {
                        setStyle('backgroundColor', 0xcccccc);
                    } else {
                        setStyle('backgroundColor', 0xffffff);
            ]]>
        </mx:Script>
    </mx:Canvas>
    Now just apply the item renderer in the datagrid and that will do it.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"  xmlns:ns1="*">
        <mx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                [Bindable]
                private var ac:ArrayCollection = new ArrayCollection([
                    {value : 1},
                    {value : 2},
                    {value : 3},
                    {value : 4},
                    {value : 5},
                    {value : 6},
                    {value : 7},
                    {value : 8},
                    {value : 9},
                    {value : 10}
          ]]>
        </mx:Script>
        <mx:DataGrid x="40" y="36" width="408" height="193" dataProvider="{ac}">
            <mx:columns>
                <mx:DataGridColumn headerText="Column 1" dataField="value" itemRenderer="MyComp"/>
                <mx:DataGridColumn headerText="Column 2" dataField="col2"/>
                <mx:DataGridColumn headerText="Column 3" dataField="col3"/>
            </mx:columns>
        </mx:DataGrid>
    </mx:Application>
    I hope this helps
    Andrew

  • Change the background color of a table created by ADDT (Login)

    I am trying to change the background color of a table in the login form created by the developer's toolbox. I then go and select the table and change the background color. But it has no effect. The only insight I have is when I delete this "" from the Action in the form, then the table's background color changes. As far as I can tell this line of code is only return the url of the page.
    I am not understanding something.
    Does anyone have any insight?
    Thanks!

    the table is linked using a CSS rule..
    the CSS rules comes from something called Skins..
    see mxkollection2.css.
    KT_XXX are the class ID's for table names.
    if u change this rule it will effect all the tables which use that rule in ur whole website.
    u can try switching skins from ADDT control panel.
    KT_tngtable is the tables css rule name defined in skins /Skinname/tng.css
    hope this helps u ..
    mohnkhan
    http://www.mohitech.com

Maybe you are looking for