Skip to Content
avatar image
Former Member

How to change the cell property of the Table UI

Hi all,

I'm using Table UI and wondering is there anyway to change the attribute/property of the cell (row, column). I couldn't find a method in Table / TableColumn API to achieve this purpose.

Has anyone ever done this before? Thanks.

I knew in HTMLB (used by EP5), there is a method to refer to table Cell and we can change the attribute/property. As an example: Attendance Overview (part of MS package).

Best regards,

Fendy W

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Jun 07, 2004 at 08:46 AM

    Hi, as far as I know there is no way to refer to cell.

    The object you are working with is column and all the properties are column related (as binding or visualization). You can see this structure in outline view in IDE or refer to it dynamically.

    Best Regards,

    Victor.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 07, 2004 at 11:40 AM

    Could you give an example what you want to achieve?

    Regards, Armin

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      The Web Dynpro IWDTable UI element does not have explicit cell objects.

      The table is organized into columns of type IWDTableColumn. Each column has a cell editor of type IWDTableCellEditor that renders all cells in that column.

      The rows are defined by the elements of the context node that is used as the table's data source.

      To set the value of an attribute "A" for the table cell (columnID, rowIndex), you might:

      - Define a value attribute "A" in the context node that is used as the table's data source

      - Bind a property of the column's table cell editor to "A"

      Then you can control the cell (columnID, rowIndex) by the value of "A" in node element at index "rowIndex".

      Hope this helps.

      Armin

  • avatar image
    Former Member
    Jun 08, 2004 at 12:19 AM

    Hi Armin,

    We are developing CATS (Time Sheet) functionality use Web Dynpro. One of the functionality is the data entry screen.

    The data entry screen is displayed using Web Dynpro table. It has Activity type, WBS, Day1-7 columns, etc.

    Employee enter their timesheet weekly and they can enter the time against a different WBS/Activity type/Cost Centre. It means a separate row required for each WBS/Cost Centre/Act Type.

    The Manager then will approve or Reject the timesheet. Once approved, we would like to have some kind of approval indicator on each cell (e.g. change the color of the field cell, or disable the field cell) to distinguish which days have been approved/Reject/ or haven't been actioned.

    Basically, what we are trying to achieve is very similar to the existing CATS functionality based on ITS. When approved, the day1-7 field cell will have a green color.

    Currently in Web Dynpro I'm able to refer to the table column using IWDTableColumn, but unable to refer to the row of the table column.

    As mentioned in my previous posting, this functionality can be achieved in HTMLB. The following code shown that TableColumn has a method to refer to its row:

    for (int i = 1; i <= monthCount; i++) {

    TableColumn col = model.getColumn(IMAGE_PRAEFIX + i);

    for (int j = 1; j <= rowCount; j++) {

    col.setCellHAlignment(j, CellHAlign.CENTER);

    col.setCellVAlignment(j, CellVAlign.MIDDLE);

    if (col.getValueAt(j).toString().equals("")) {

    col.setCellType(j, TableColumnType.TEXT);

    }

    else {

    col.setType(TableColumnType.IMAGELINK);

    col.setLinkColumnKey(URL_PRAEFIX + i);

    }

    }

    Is that possible to have this kind of functionality in Web Dynpro?

    Best Regards,

    FendyW

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Fendy,

      this is possible. You have to provide a Context node, which has the table editor properties as value attributes available for the table column(s). For the scenario you mentioned you could use an IWDLinkToAction, binding the image and text-properties to the node-attributes and setting the attribute contents (no text and image or vice versa) at runtime according to the approved/rejected state. This will paint the link once as text, once as image for each table row.

      Hope that helps.

      Regards

      Stefan

  • avatar image
    Former Member
    Jun 09, 2004 at 01:36 AM

    Hi Stefan/Armin,

    Thanks very much for the information.

    I will try it.

    Best Regards,

    Fendy

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 17, 2004 at 02:31 AM

    Hi Guys,

    Now, I'm able to change the cell property (row,column) from the context binding. Thanks for your information.

    But I still haven't fully achieved the development requirement. We want to differentiate the table cell based on the status, e.g. Approve/Reject. The table cell is made of Input Field UI, so employee can enter their timesheet hours. When the hours get approved, we want the Input field to have some kind of Green/red color on its border (Similar to the Error handler in WebDynpro. when error handling is implemented, the input field border turn red when error occured).

    Is there anyway we can achieve this requirement?

    Thanks and Regards,

    Fendy

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      IWDDropDownByKey would not work, because you cannot have a different data type per row.

      Concerning the empty item, see Stefan's answer.

      Regards, Armin