Transparent Container Cell Background design

Hi All,
I have a scenario where in on click of a link, I'm needed to highlight a transparent container. In Webdynpro JAVA i used to achieve this using Transparent Container -> cellBackGroundDesign -> WDCellBackgroundDesign.BORDER
What is the equivalent of this in WD ABAP. I do not find any such attribute in particular.
Any pointers on this will be of great help.
Thanks & Regards,
Gayathri Shanbhag

Hi All
On switching from flow to matrix layout I found the property cellBackGroundDesign, but it is not bindable to an attribute, in my scenario I'm needed to set the border/highlight dynamically. Please suggest if there is an alternative.
Thanks & Regards,
Gayathri Shanbhag

Similar Messages

  • Cell Background Design

    Hi
    Iam created Web dynpro applications. In that i want to change the label and UI elements color.For that, iam changing the "cellbackground design for Label -
    fill1"
                              "cellbackground design for UI Element -
    fill2"
    I did this for each and every screen. But my question is
    I dont want to change this in each and every screen.I want to keep it in one file.
    In "Eclipse "configuration.xml" file is used.
    How we can do in web dynpro without changing the "cell background design" for each and every screen.
    Please tell me in what way we have to proceed to achieve that.
    Regards
    sushma

    Hi,
    The simple way is to create two context attributes in the ComponentController and in all the views.
    Declare the attributes of type "com.sap.ide.webdynpro.uielementdefinitions.CellBackgroundDesign"
    Bind one attribute to all the UI Element CellBackgroundDesign property and the other to all the Label CellBackgroundDesign property.
    Map these attributes.
    In the doInit method of the componentController set the background value to the required one using the below code
    wdContext.currentContextElement().setCellBackground(WDCellBackgroundDesign.BORDER);
    Hope it Helps,
    Regards,
    Gayathri.

  • Cell background colors are not showing in preview - help? - DW4

    Hi,
    I created a horizontal table for my menu bar, and gave each cell a different color by creating a separate class for each with background image - image is a block of color created in Photoshop. In design mode they look they way I want, but in preview (Safari) the colors don't show up at all - the whole area is gray, and all I see is the text for each cell. Can someone tell me what I'm doing wrong? Alternatively, is there a better way I can set this up to have different colors for each button?
    Thank you!

    Here is the HTML code, and the CSS code for the menu bar follows: 
         ul.MenuBarHorizontal           
    ></style><style type="text/css"><!body {     background-color: #FFF;     font-family: Arial, Helvetica, sans-serif;}-->
        h1.  
         ul.MenuBarVertical          
    [about | MS_about.html]
    [fiction | MS_fiction.html]
    [dramatic work | MS_dramaticwork.html]
    [arts | MS_arts.html]
    [contact | MS_contact.html]
    [blog | MS_blog.html]
    <!-- end #header ><div id="mainContent"><p> </p><table width="950" border="0" cellspacing="10" cellpadding="12">        <tr>          <td width="106"><p> </p></td>          <td width="766"><p> </p>            <p>Miriam Seidel is a writer, critic and curator whose work is informed by her background in art, music and dance. </p>          <p> </p>          <p> </p>          <p> </p>          <p> </p>          <p> </p>          <p> </p>          <p> </p>          <p> </p>          <p> </p>          <p> </p>          <p> </p></td>        </tr>        <tr>          <td colspan="2" bgcolor="#CCCCCC"><p>c Miriam Seidel 2011 all rights reserved</p></td>        </tr>    </table><script type="text/javascript"><!var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", );var MenuBar2 = new Spry.Widget.MenuBar("MenuBar2", );var MenuBar3 = new Spry.Widget.MenuBar("MenuBar3", );//></script></body>     <! end #mainContent --></div></html> 
    CSS CODE:
    @charset "UTF-8";
    /* SpryMenuBarHorizontal.css - version 0.6 - Spry Pre-Release 1.6.1 */ 
    /* The outermost container of the Menu Bar, an auto width box with no margin or padding /ul.MenuBarHorizontal/ Set the active Menu Bar with this class, currently setting z-index to accomodate IE rendering bug: http://therealcrisp.xs4all.nl/meuk/IE-zindexbug.html /ul.MenuBarActive{     z-index: 1000;     font-family: Arial, Helvetica, sans-serif;     font-size: medium;     color: #FFF;     background-color: #FFCC99;     background-repeat: no-repeat;     left: auto;     top: auto;     right: auto;     bottom: auto;}/ Menu item containers, position children relative to this container and are a fixed width /ul.MenuBarHorizontal li/ Submenus should appear below their parent (top: 0) with a higher z-index, but they are initially off the left side of the screen (-1000em) /ul.MenuBarHorizontal ul/ Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to auto so it comes onto the screen below its parent menu item /ul.MenuBarHorizontal ul.MenuBarSubmenuVisible/ Menu item containers are same fixed width as parent /ul.MenuBarHorizontal ul li/ Submenus should appear slightly overlapping to the right (95%) and up (-5%) /ul.MenuBarHorizontal ul ul/ Submenu that is showing with class designation MenuBarSubmenuVisible, we set left to 0 so it comes onto the screen */ul.MenuBarHorizontal ul.MenuBarSubmenuVisible ul.MenuBarSubmenuVisible 
    /* Submenu containers have borders on all sides /ul.MenuBarHorizontal ul/ Menu items are a light gray block with padding and no text decoration /ul.MenuBarHorizontal a/ Menu items that have mouse over or focus have a blue background and white text /ul.MenuBarHorizontal a:hover, ul.MenuBarHorizontal a:focus{     background-color: #6C9;     color: #999;     font-family: Arial, Helvetica, sans-serif;     font-size: medium;     font-style: normal;     line-height: normal;     font-weight: normal;     font-variant: normal;     text-decoration: none;     text-align: center;     vertical-align: middle;     height: 50px;     width: 115px;}/ Menu items that are open with submenus are set to MenuBarItemHover with a blue background and white text */ul.MenuBarHorizontal a.MenuBarItemHover, ul.MenuBarHorizontal a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal a.MenuBarSubmenuVisible{     background-color: #FFCC99;     color: #FFF;     font-family: Arial, Helvetica, sans-serif;     text-decoration: none;     font-size: medium;}
    SUBMENU INDICATION: styles if there is a submenu under a given menu item
    /* Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) /ul.MenuBarHorizontal a.MenuBarItemSubmenu{     background-image: url(SpryMenuBarDown.gif);     background-repeat: no-repeat;     background-position: 95% 50%;     text-align: center;}/ Menu items that have a submenu have the class designation MenuBarItemSubmenu and are set to use a background image positioned on the far left (95%) and centered vertically (50%) /ul.MenuBarHorizontal ul a.MenuBarItemSubmenu{     background-image: url(SpryMenuBarRight.gif);     background-repeat: no-repeat;     background-position: 95% 50%;}/ Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) /ul.MenuBarHorizontal a.MenuBarItemSubmenuHover{     background-image: url(SpryMenuBarDownHover.gif);     background-repeat: no-repeat;     background-position: 95% 50%;}/ Menu items that are open with submenus have the class designation MenuBarItemSubmenuHover and are set to use a "hover" background image positioned on the far left (95%) and centered vertically (50%) */ul.MenuBarHorizontal ul a.MenuBarItemSubmenuHover{     background-image: url(SpryMenuBarRightHover.gif);     background-repeat: no-repeat;     background-position: 95% 50%;}
    BROWSER HACKS: the hacks below should not be changed unless you are an expert
    /* HACK FOR IE: to make sure the sub menus show above form controls, we underlay each submenu with an iframe /ul.MenuBarHorizontal iframe/ HACK FOR IE: to stabilize appearance of menu items; the slash in float is to keep IE 5.0 from parsing */@media screen, projection{     ul.MenuBarHorizontal li.MenuBarItemIE     {          display: inline;          f\loat: left;          background: #FFF; 
    Date: Mon, 20 Jun 2011 15:30:46 -0600
    From: [email protected]
    To: [email protected]
    Subject: Re: cell background colors are not showing in preview - help? - DW4 
    NEED to see the code.
    Otherwise it's like dialing a random phone number, and asking whoever answers, where you left your keys.
    >

  • Transparent Container UI Element

    Hi
    I am new to Web Dynpro for ABAP and have been tasked with the creation of a complex input screen with a tabbed strip of 12 tabs with 7 columns on each tab.  Each column also has multiple input fields on it. 
    My question is in the design of the screen.  I am currently equating the Transparent Container as an (X)HTML DIV tag for my screen formatting.
    Would this be a fair assumption?
    Are there any documents on screen design?
    Regards
    Ian

    Ian,
    For HTML client TransparentContainer is in fact rendered as DIV element. Though, it may be changed.
    Anyway, this is quite safe analogy.
    For your task you may use either:
    1. Matrix/Grid layout of Tab content and no Transparent containers at all. You may get columns effect using layout only.
    2. Matrix layout with 7 columns (one row) and transparent container in every cell. Use this only if [1] is not suitable, i.e. when layout in every column differs too much.
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net

  • How to put flash as a table or cell background or put HTML elements on top of flash file?

    Hi Guys,
    Could anyone please suggest me that how to put flash file as a table or cell background. I want to design a website and want to put HTML elements like table, images, text on top of flash file. so its look like animation in background. please visit following websites for an example: http://www.gagudju-dreaming.com/ and http://disneyworld.disney.go.com/
    Please guide me ASAP, thanks a lot in advance.
    Nitz.

    Hi Nitz
    The first thing you must do is convert your layout from table based to css based, (tables are o/k for tabular data, but not layout) but if you have never used css for layout it may be a steep learning curve.
    My recommendation is to start with the following tutorial on converting a table based comp to a css layout -
    http://www.adobe.com/devnet/dreamweaver/articles/dw_fw_css_pt1.html
    More info on using css is available here - http://www.adobe.com/devnet/dreamweaver/css.html.
    Once you have converted your site the 'procedure' for using swf's as a background, (does not work well with flv's, but can be done using html5 video without a skin, to a limited extent) is the same as having a background-image resize automatically to the full browser view-port. The best way to learn how to do this is to view the code on a page using the background-image technique, view the code on this page - http://www.pziecina.com/indexold.php.
    However, instead of having a fluid layout I would recommend using a fixed layout size to start with, as this overcomes many problems. I have uploaded a basic test page to illustrate the idea to - http://www.pziecina.com/test_ideas/swfbg_test.html. As I said the page must be resized in this example in order to see the effect, (so do not forget to resize the browser, even if it is only by 1px), but if you use a fixed size layout and your swf's size fits the desired area correctly the resize should not be required.
    PZ
    www.pziecina.com

  • Right way to change datagrid row, column, cells background colors in code-behind?

    Hi all,
    I have a winform program that I'm upgrading to wpf (I'm new to wpf). The wpf code for the function (SetdataGridBackgroundColors()) is below with the winform code commented out so I can fix it.  I have a datagrid with a Cornsilk background color alteranating
    with LightGreen depending on the content of datetime  cell. If the day portion of the datetime is different then the color changes from one to the other. I used a colorIndex variable because at the end of the month it could go from 31 to 1 and that would
    not work if I use the day directly.
    I tried this line to change the background color:
    optionsDataDatagrid.RowBackground = new SolidColorBrush(Colors.Cornsilk);
    this works but it changes every row. I found this other stuff:
    DataGridRow currentRowColor = optionsDataDatagrid.ItemContainerGenerator.ContainerFromIndex(i) as DataGridRow;
    //DataGridRow currentRowColor = optionsDataDatagrid.ItemContainerGenerator.ContainerFromItem(optionsDataDatagrid.Items[i]) as DataGridRow;
    currentRowColor.Background = new SolidColorBrush(Colors.Cornsilk);
    Either ContainerFromIndex or ContainerFromItem throw an exception because currentRowColor is null. I looked at optionsDataDatagrid.Items[i] and is not null. Then I read that using ItemContainerGenerator is not a good idea.
    BTW I'm calling SetdataGridBackgroundColors() after datagrid is been filled with data.
    So... what is the proper way to set each row, column or cell background color in wpf?
    Thanks
    private void SetdataGridBackgroundColors()
    optionRowData rowData = new optionRowData();
    if (optionsDataDatagrid.Items.Count == 0)
    return;
    int colorIndex = 1;
    DateTime savedDate, currentRowDate;
    rowData = optionsDataDatagrid.Items[0] as optionRowData;
    savedDate = rowData.col_datetime.Date; //only compare the date not the time
    for (int i = 0; i < optionsDataDatagrid.Items.Count; i++)
    //currentRowDate = Convert.ToDateTime(optionsDataDatagrid.Rows[i].Cells[3].Value); //winform code
    //currentRowDate = currentRowDate.Date; //winform code
    rowData = optionsDataDatagrid.Items[i] as optionRowData;
    currentRowDate = rowData.col_datetime.Date;
    if (currentRowDate != savedDate)
    colorIndex++;
    savedDate = currentRowDate;
    if (colorIndex % 2 == 0)
    //optionsDataDatagrid.Rows[i].DefaultCellStyle.BackColor = Color.Cornsilk;
    //------------------- testing new code --------------begin
    optionsDataDatagrid.RowBackground = new SolidColorBrush(Colors.Cornsilk); //this changes all rows
    //DataGridRow currentRowColor = optionsDataDatagrid.ItemContainerGenerator.ContainerFromIndex(i) as DataGridRow;
    //DataGridRow currentRowColor = optionsDataDatagrid.ItemContainerGenerator.ContainerFromItem(optionsDataDatagrid.Items[i]) as DataGridRow;
    //currentRowColor.Background = new SolidColorBrush(Colors.Cornsilk);
    //------------------- testing new code --------------end
    //optionsDataDatagrid.Columns[4].DefaultCellStyle.BackColor = Color.DarkSalmon;
    //optionsDataDatagrid.Columns[5].DefaultCellStyle.BackColor = Color.Aquamarine;
    //optionsDataDatagrid.Rows[i].Cells[4].Style.ApplyStyle(optionsDataDataGridView.Columns[4].DefaultCellStyle);
    //optionsDataDatagrid.Rows[i].Cells[5].Style.ApplyStyle(optionsDataDataGridView.Columns[5].DefaultCellStyle);
    else
    //optionsDataDatagrid.Rows[i].DefaultCellStyle.BackColor = Color.LightGreen;
    //------------------- testing new code --------------begin
    optionsDataDatagrid.RowBackground = new SolidColorBrush(Colors.LightGreen); //this has no effect
    //------------------- testing new code --------------end
    //optionsDataDatagrid.Columns[4].DefaultCellStyle.BackColor = Color.Coral;
    //optionsDataDatagrid.Columns[5].DefaultCellStyle.BackColor = Color.LimeGreen;
    //optionsDataDatagrid.Rows[i].Cells[4].Style.ApplyStyle(optionsDataDataGridView.Columns[4].DefaultCellStyle);
    //optionsDataDatagrid.Rows[i].Cells[5].Style.ApplyStyle(optionsDataDataGridView.Columns[5].DefaultCellStyle);

    I (also) strongly recommend mvvm.
    Setting values is a particularly bad idea in this case.
    I don't mean to be rude but your explanation of the requirement is kind of vague.
    I would bind solidcolourbrushes.
    Set the properties based on whatever your logic is within the viewmodel.
    You can switch out what each of the brushes holds when the user clicks wherever.
    So you use a highlightbrush when something or other is true.
    That highlightbrush is set to a blue brush when the user clicks left and a red brush when they click right.
    Please don't forget to upvote posts which you like and mark those which answer your question.
    My latest Technet article - Dynamic XAML

  • Cell background image problem

    Please tell me exactly how to add only one background gif to
    a cell. I have
    told it "no repeat" but it does just that. See:
    http://www.pskewedp.info/content.htm
    Thank you, Eleanor
    Eleanor T. Culling
    Leavenworth, WA
    European Alps Photos
    http://www.eleanorstravels.com/photoblog-issue19.htm

    Thank you so very much! Please watch this thread, I'll
    probably need a bit
    more help. I have 3-4 images I need to use this way, as table
    or cell
    backgrounds. Will I have
    #cellBg2 and 3 and 4?
    Eleanor T. Culling
    Leavenworth, WA
    European Alps Photos
    http://www.eleanorstravels.com/photoblog-issue19.htm
    "Osgood" <[email protected]> wrote in
    message
    news:[email protected]...
    > E. T. Culling wrote:
    >
    >> Please, what do you mean by this:
    >> "Refer deesadler's reply in this thread." I don't
    see that.
    >>
    >
    > Hi Eleanor,
    >
    > You need to use some css to apply the background image
    to the cell. The
    > complete page code you need is beneath these
    instructions, just in case
    > you have trouble in implementing the changes.
    >
    > The css is below (add it to the css styles which already
    exist in the head
    > section of your page)
    >
    > #cellBg {
    > background-image:
    url(Graphics/Content-box-top-775.gif);"
    > background-repeat: no-repeat;
    > }
    >
    > Then you need the add the id 'cellBg' to the cell as
    below and remove
    > 'background="Graphics/Content-box-top-775.gif'
    >
    > Like this:
    >
    >
    > <td id="cellBg" width="774" height="201"
    valign="top">
    >
    >
    > Here is the complete revised page:
    >
    >
    > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN"
    > "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    > <html xmlns="
    http://www.w3.org/1999/xhtml">
    > <head>
    > <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    > <title>Untitled Document</title>
    > <style type="text/css">
    > <!--
    > body,td,th {
    > font-family: Arial, Helvetica, sans-serif;
    > }
    > body {
    > background-color: #CCCCCC;
    > }
    > a:link {
    > color: #006699;
    > text-decoration: none;
    > }
    > a:visited {
    > text-decoration: none;
    > color: #006699;
    > }
    > a:hover {
    > text-decoration: underline;
    > color: #006699;
    > }
    > a:active {
    > text-decoration: none;
    > color: #006699;
    > }
    > #cellBg {
    > background-image:
    url(Graphics/Content-box-top-775.gif);"
    > background-repeat: no-repeat;
    > }
    > -->
    > </style>
    > </head>
    >
    > <body>
    > <table width="1000" border="0" cellspacing="0"
    cellpadding="10">
    > <tr>
    > <th width="1019" bgcolor="#f8f8dc"
    scope="row"><table width="1000"
    > border="0" cellspacing="0" cellpadding="0">
    > <tr>
    >
    > <th colspan="2" scope="row"><img
    src="Graphics/content header.jpg"
    > alt="Content Page" width="995" height="87"
    /></th>
    > </tr>
    > <tr>
    > <th width="226" rowspan="3" align="left" valign="top"
    > scope="row">Navigation</th>
    > <td id="cellBg" width="774" height="201"
    valign="top"><center>
    > </center> </td>
    > </tr>
    >
    > <tr>
    >
    > <td valign="top"><center>
    > Footer
    > </center> </td>
    > </tr>
    >
    > </table></th>
    > </tr>
    > </table>
    > </body>
    > </html>
    >
    >

  • Short dump while creating transparent container dynamically

    Hi experts!
    I want to create a transparent container dynamically, but I get a Short Dump (
    Note
    The following error text was processed in the system NSP : Access via 'NULL' object reference not possible.
    The error occurred on the application server Datatrain_NSP_00 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: CREATE_BY_VIEW_ELEMENT of program CL_WDR_VIEW_ELEMENT_ADAPTER===CP)
    while doing so. Below my code...
    Can somebody please advise I don't know what I did wrong....
    Thanks in advance!
    Points will be rewarded
    METHOD wddomodifyview .
    DATA: lr_container TYPE REF TO cl_wd_uielement_container,
            lr_matrix_head TYPE REF TO cl_wd_matrix_data,
            lv_hlp_str TYPE string VALUE 'DYNCONT_1',
            lr_trans_cont TYPE REF TO cl_wd_transparent_container.
        lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
    CALL METHOD cl_wd_transparent_container=>new_transparent_container
      EXPORTING
        enabled                  = ABAP_TRUE
        id                       = lv_hlp_str
        is_layout_container      = ABAP_TRUE
      receiving
        control                  = lr_trans_cont
        lr_matrix_head = cl_wd_matrix_head_data=>new_matrix_head_data(
                            element = lr_trans_cont ).
        lr_trans_cont->set_layout_data( lr_matrix_head ).
        lr_container->add_child( lr_trans_cont ).

    Hi Felix,
    You need to set the layout first and then set the layout data. Use the method cl_wd_matrix_layout=>new_matrix_layout. Do a set_layout on the container and then do set_layout_data. That should solve your problem.
    Regards
    Nithya

  • How to hide a transparent container and its fields in webdynpro abap

    Hello Friends,
    I am trying to create a view where i want to show some fields based on some other field.
    What i exactly need is When i enter some data in 1 input field .
    Corresponding to that input field few text fields wud be opened automatically in the same view.
    No Pop-ups allowed.
    What i am doing is !!
    i have created another Transparent container for my  text view fields.
    But i  am unable to hide this fields..
    Kindly help..
    At the runtime..
    After entering the value in the input field..
    This transparent container should become visible with the textview fields...
    Gaur Mayank

    Hi,
    Create A Context Attribute (Say  Visible_Hide )of Type WDUI_VISIBILITY with initial value as 01.
    Goto your Container, Bind the Visible Property with Above Created Attribute(Visible_Hide).
    In the Input Field,Use the OnEnter Event and Set the Value to Visible_Hide as 02.
    Then the Container will be Visible.
    Thaks.
    Uma

  • Add a Transparent Container dynamically in wddomodifyview

    Hi All,
    I have added UI Elements to views before. Now, I am trying to add a Transparent Container to a Group, which does not work. I am using the same procedure as I have used it for other UI Elements before, but I keep receiving the dump:
    The following error text was processed in the system JIL : Access via 'NULL' object reference not possible.
    The error occurred on the application server SV-SAP-2_JIL_01 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: CREATE_NW7_BY_VIEW_ELEMENT of program CL_NW7_VIEW_ELEMENT_ADAPTER===CP
    My code is as follows:
    lo_group ?= view->get_element( 'GROUP' ).
        lo_tc = cl_wd_transparent_container=>new_transparent_container( id = 'TC_SECOND_ELEMENT' ).
        cl_wd_matrix_head_data=>new_matrix_head_data( element = lo_tc ).
        lo_group->add_child( the_child = lo_tc ).
    Why does the coding above not work?? How is the proper coding to add a Transparent Container to my group?
    THANKS, Johannes

    Hi,
    Your coding seems to me fine. Though i am not sure if this line causes the error.
    cl_wd_matrix_head_data=>new_matrix_head_data( element = lo_tc ).
    I normally get this error when the UI element property is not binded correctly. How sure are you that this error is coming  because of this TransparentContainer ?.
    You can comment out the whole and check if this is working.
    Then enable one by one and see if you get it worked.

  • Is it possible to apply conditional formatting to a cell (or range) based upon a LOOKUP query to cell values in another sheet.? I want to alter the formatting (i.e., text and/or cell background color), but not cell content.

    Is it possible to apply conditional formatting to a cell (or range) based upon a LOOKUP query to cell values in another sheet.?
    I want to alter the formatting (i.e., text and/or cell background color), but not the content, of the target cell(s).

    Hi Tom,
    Your LOOKUP formula will return a value that it finds in the "other" table. That value can be used in conditional highlighting rules. (Numbers 3 calls it conditional highlighting, not conditional formatting. Just to keep us awake, I guess, but it works the same).
    Please explain what you are trying to do.
    Regards,
    Ian.

  • Set cell background color conditionally?

    I want to set a cells' background colors conditionally, e.g., if the computer value is between 5 to 9, make the background red. Is there any way to do that?

    That is a good question. It would appear it does not work. A way around it is to put 1:00 (1 hour duration, not 1 o'clock) in a cell and a 1:30 in another then reference those cells as your two conditions.
    This is not the only place where the duration format is not fully implemented.

  • How to change a selected cell background color in JTable?

    Hi all,
    I am trying to change the background color of a selected cell by clicking on that particular cell. DefaultTableCellRenderer class provides setBackground(Color c) to change the background color of unselected cells. Is there a way to change a selected cell background color?
    Thank you,
    Arthur

    Write your own renderer (eg. extending DefaultTableRenderer) and put in getTableCellRendererComponent method something like this:
    if( isSelected && hasFocus )
        setBackground( Color.RED );
        setForeground( Color.GREEN );
    }

  • Hyp 9.3 FR CellText - Suppress data blocks that don't contain Cell text

    I'm creating a Financial Report that focuses on Data Blocks that contain Cell Text. The following function works when retreiving at a level one or higher Member for retrieving data.
    *<<CellText("Grid1", cur, A, 1)>>*
    The results of the function return the following:
    0093 663020 Jan 1,000 This is a Test Too.
    0093 663020 Jun 15,000 This is a Test for Brenda
    0093 663030 Feb 2,000 Try this one on for size.
    0093 663030 May 20,000
    Note the last line does not contain a Cell Text. This is due to the test group of data blocks has four populated data blocks and only three of the data blocks have cell text attached.
    I would like to be able to filter the last data block that does not contain the cell text in order to increase the member levels in the various dimensions+
    Any Suggestions?+

    Try the following:
    1 - delete the iPhoto preference file, com.apple.iPhoto.plist, that resides in your
         User/Home/Library/ Preferences folder. You may have to use your Admin password in order to move it.
    2 - delete iPhoto's cache file, Cache.db, that is located in your
    User/Home/Library/Caches/com.apple.iPhoto folder (Snow Leopard and Earlier).
    or with Mt. Lion from the User/Library/Containers/com.apple.iPhoto/
    Data/Library/Caches/com.apple.iPhoto folder
    3 - launch iPhoto and try again.
    NOTE 1: If you're moved your library from its default location in your Home/Pictures folder you will have to point iPhoto to its new location when you next open iPhoto by holding down the Option key when launching iPhoto.  You'll also have to reset the iPhoto's various preferences.
    NOTE 2:  In Lion and Mountain Lion the Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.
    OT

  • JTable cell background color

    Hi All,
    I want to change the background color of the same of the cells in jTabel. How can I do that.
    Like, I want to keep 3 cells in red color. Another 2 cells in in green color, And keep other cell background color to default.
    Also I want to change the background color of the cell, with different selection in other component(like jTree, jList).
    Thank you,
    Avin Patel

    The same cell renderer is used by all cells of the table. You can't just set the background color of a cell once. You have to reset it every time the cell renderer is called (depending on which row/column you are being asked to render). Here is an example:
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class TableCell extends JFrame
         JTable table;
         public TableCell()
              Object[][] data = { {"1", "A"}, {"2", "B"}, {"3", "C"}, {"4", "D"}  };
              String[] columnNames = {"Number","Letter"};
              DefaultTableModel model = new DefaultTableModel(data, columnNames);
              table = new JTable( model );
              //  Set default cell renderer
              TableCellRenderer renderer = new TestRenderer();
              table.setDefaultRenderer(Object.class, renderer);
              JScrollPane scrollPane = new JScrollPane( table );
              getContentPane().add( scrollPane );
         public static void main(String[] args)
              TableCell frame = new TableCell();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.pack();
              frame.setVisible(true);
         class TestRenderer extends DefaultTableCellRenderer
              public Component getTableCellRendererComponent(
                   JTable table,
                   Object value,
                   boolean isSelected,
                   boolean hasFocus,
                   int row,
                   int column)
                   super.getTableCellRendererComponent(table,
                   value, isSelected, hasFocus, row, column);
                   if (column == 0)
                        setHorizontalAlignment( LEFT );
                        setBackground( Color.blue );
                   else
                        setHorizontalAlignment( RIGHT );
                        setBackground( Color.green );
                   if (row == 1)
                        setBackground( Color.red );
                   return this;
    }

Maybe you are looking for