cancel
Showing results for 
Search instead for 
Did you mean: 

implement linktoURL ui element dynamically in a table

debasish_panda
Explorer
0 Kudos

HI,

I want to implement linktoURL ui element dynamically in a table.

Can you please sugegst mehow to achieve this ?

Regards,

Debasish

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

What do you mean exactly, adding a table column with LinkToURL as editor at runtime?

Say context looks like:

Rows (node)

-- Url (attribute, string)

and table is bound to node "Rows".

Then the code would be

wdDoModifyView(...)
{
  if (<column-to-added>)
  {
    IWDTable table = (IWDTable) view.getElement("TableID");
    IWDTableColumn column = (IWDTableColumn) view.createElement(IWDTableColumn.class, null);
    table.addGroupedColumn(column); /* use addColumn() in NW04 */
    IWDLinkToURL link = (IWDLinkToURL) view.createElement(IWDLinkToURL.class, null);
    column.setTableCellEditor(link);
    link.bindReference("Rows.Url");
    <reset-column-to-be-added>
  }
}

<column-to-be-added> denotes a flag (boolean context attribute) used to indicate when the additional column should be added.

Armin

Former Member
0 Kudos

What seems to be the issue ?

You need to do this in wdDoModifyView.

Find the table , add a table column element of type LinkURLElement.

Refer this :

Regards,

Subramanian V.<a href="http://help.sap.com/saphelp_nw04/helpdata/en/4f/07cf3dd28b5610e10000000a114084/content.htm">Dynamic UI Element Creation</a>

Former Member
0 Kudos

HI,

If u want to create a rows that contains linkToAction dynamically, then u only need to create elements of node which is bound to the table.

If it is dynamic column creation of table, with one column as LinkToAction, then, do the following

1.Create an action for LinkToAction. Let it be onActionDoThis();

2.Create dynamic table and its columns in wdDomodifyView()

3.Add the LinkToAction Element to the Table as

IWDLinkToAction espnLink=(IWDLinkToAction)view.createElement (IWDLinkToAction.class,"SPNLink");

espnLink.bindText("TextOfLink");

espnCols.setTableCellEditor(espnLink);

tab1.addColumn(espnCols);

4. Set the action of this Link as

espnLink.setOnAction(wdThis.wdGetDoThis());

Please be free to ask, if u didnt understood

Regards

Fahad Hamsa