cancel
Showing results for 
Search instead for 
Did you mean: 

Cell Editor of type Buttoon in Table

Former Member
0 Kudos

Hi All,

I have a table which consists of 3 coumns. To have the Textview cell editor, and the other type Button cell editor. When the user clicks on a button in a row, they will be taken to another view to do some stuff there.

But - please advise how I can determine for which row the button was clicked. Is there perhaps some kind of context mapping i need to do in the wdDoModifyWIndow.. I mean there must be some parameter that is passed by the runtime framework that I can catch to determine for which row this button was checked.

Please helo,

Christiaan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I am not very sure of your requirement and why do you want to write it in wdDoModifyView()?

I feel that your requirement is that when you click on the button in a particular row then you need to get the data of the other columns of that particular row and based on that you would populate data in the next view. If this is the requirement then wdContext.current<nodename>Element().get<attribute>() would give your the value of the currently clicked row.

Regards,

Murtuza

Former Member
0 Kudos

Hello,

Yes you are correct. I do require the values of the other rows.

I will try your recommendation. I just want to make sure that the wdContext.current<element> WILL in fact point to the row of the button selected.

Is this something I can safely presume, would you say?

Christiaan

Former Member
0 Kudos

There is no need to move the lead selection to the row where the button was pressed, see my answer above.

Armin

Answers (1)

Answers (1)

Former Member
0 Kudos

Every event that has been triggered inside a context-driven UI element like Table, RowRepeater, Tree etc. has an implicit event parameter "nodeElement" of type IWDNodeElement. This parameter contains the context element corresponding to the row / tree node / whatever represents the node element.

To use it in an action handler, define an action parameter "row" of type "IWDNodeElement" or "I<DataSourceNode>Element" and map the event parameter to it. Mapping can either be done with the Parameter Mapping Editor (Outline, right-click on Button, select "Parameter Mapping") or by a piece of code in wdDoModifyView():


if (firstTime)
{
  IWDButton button = (IWDButton) view.getElement("button_id");
  button.mappingOfOnAction().addSourceMapping("nodeElement", "row");
  /* or better if available in your version: */
  button.mappingOfOnAction().addSourceMapping(IWDButton.IWDOnAction.NODE_ELEMENT, "row");
}

Armin