Skip to Content
author's profile photo Former Member
Former Member

Putting colour into TableView cells?

Hi there,

I've developed iViews in Java that put colour into a TableView's cells with code similar to the following:

<hbj:tableView id="da190Table"

model="myDA190Bean.TableModel"

design="ALTERNATING"

headerText=""

headerVisible="FALSE"

footerVisible="TRUE"

fillUpEmptyRows="TRUE"

selectionMode="MULTISELECT"

navigationMode="BYLINE"

visibleFirstRow="<%=myDA190Bean.getVisibleRow() %>"

width="100%"

visibleRowCount = "5"

onNavigate="onNavigate">

<%

.........

.........

//loop through table.....

da190Table.setStyleForCell(row,2,TableCellStyle.POSITIVE);

.........

.........

%>

I've gone to "CL_HTMLB_TABLEVIEW" in the class builder and am trying to find a method similar to "setStyleForCell()" seen in the above code. I'm also trying to find a class or interface similar to "TableCellStyle" so that I can get the colours easily. I hope I'm thinking the right way and that ABAP isn't too different to the way Java handles it on the Portal.

So if anyone can let me know how to get colour into TableView cells using BSP's I'll be really stoked...

Thanks for the help

Lynton

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • Posted on Dec 08, 2003 at 10:27 AM

    I am fairly new to the Web World and to BSP's, so I hope I am not leading you wrong. Here is what I have done so far to acomplish the same thing. I have used an HTMLB TableView Iterator and implemented the RENDER_CELL_START method. This lets you set styles, classes, and even replacement expressions. Brian McKellar has some very helpful WebLogs on Both TableView Iterators and BEEs that got me started down this path.

    Add comment
    10|10000 characters needed characters exceeded

    • Yes, this is (unfortunately) the only way to go. We do not build a control tree in BSP during rendering. The controls are rendered on the fly. Which means that there are settings that you can only make while rendering. See weblogs on iterators. See also BSP app sbspext_htmlb or bsp_tableview.

      For design2002, you can set colors directly via p_style parameter. This was in the days before we got new limited list of colors, etc. For design2003, you can do something such as: p_style = 'celldesign:positive'.

      brian

      PS: I think I wrote something more about this in a previous append.