cancel
Showing results for 
Search instead for 
Did you mean: 

Row Repeater

Former Member
0 Kudos

Suppose in a row repeater, I have link to action UI element.

I want to know the code for, which ith element in the row repeater, I selected.

Please help me.

I tried the following, but it doesn't work:

IRowElement ele=wdContext.nodeRow().getRowElementAt(wdContext.nodeRow().getLeadSelection());

ele.get<attribute>();

Edited by: jacky jill on Jan 17, 2009 3:05 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

For every UI element that lives inside a context-driven parent (like Table, RowRepeater, Tree etc.) there exists an implicit event parameter "nodeElement" that determines the node element corresponding to the table row, row repeater row, tree node etc.

Using event parameter mapping, you can map this event parameter to an action parameter. For example if the RowRepeater is bound to a context node named "Rows", you can add an action parameter "row" of type IRowsElement and use this mapping:


IWDLinkToAction link = (IWDLinkToAction) view.getElement("idOfLink");
link.mappingOfOnAction.addSourceMapping("nodeElement", "row");
/* or in NW >= 7.0: */
link.mappingOfOnAction.addSourceMapping(IWDLinkToAction.IWDOnAction.NODE_ELEMENT, "row");

Armin

Former Member
0 Kudos

Hi Armin!

Thanks a lot for your reply.

So if the Context node structure is:

Rows (node. This is bound to the source property of the row repeater.)

|-- attr1 (attribute. This is bound to link to action UI element.)

|-- attr2 (attribute. Not visible in the row repeater.)

If there are 5 elements in the Node - "Rows".

On clicking the link to action UI element, I want the corresponding value of "attr2" in a TextView.

What code should I write on the event of the link to action UI to get the corresponding value of "attr2"?

Please help.

Jacky

Edited by: jacky jill on Jan 18, 2009 10:27 AM

Former Member
0 Kudos

If the action is named "LinkClicked" and the action parameter is named "row", you write


void onLinkClicked(..., IRowsElement row)
{
  String value = row.getAttr2();
}

Armin

Former Member
0 Kudos

hi Armin!

Thanks. Now the problem is solved.

Answers (0)