cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the onAction input field value from table

Former Member
0 Kudos

Hi experts,

I have small problem in tables. I created one table with 2 fields.

1.Input Field.(Amount)

2. Text View Field.(Tax)

I will enter some amount in input field and i need to calculate tax and display in text view field. I created onAction() for input field.

Problem is:

1. Lead selection is always in first row, i am not able find the input field value for calculation.

2. How to find the input field value in onAction () method.

3. Any other setting i need to do ..

Regards,

Sunil

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Use the (implicit) event parameter "nodeElement" to identify the row where the action was triggered. Either define a parameter mapping using the view designer tool (Outline view, right-click on InputField -> Parameter Mapping), or with a line of code like

wdDoModifyView(...)
{
  if (firstTime)
  {
    IWDInputField editor = (IWDInputField) view.getElement("inputfield_ID");
    editor.mappingOfOnAction().addSourceMapping("nodeElement", "row");
  }
}

"row" must be an action parameter of type I<DataSourceNode>Element or IWDNodeElement.

Armin

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi sunil,

You can create an action which calculates and sets 'Tax' value based on the input field value.And bind this action to onEnter event of the input field.

In that action, you can get the input field value by

String amt=wdContext.node<tableNode>.current<tableNode>Element().get<contextnamebindToInputField>();

<b>If this current<tableNode>Element() to be worked for the selected row,

set the tables 'compatability mode' property from 'nw04s' to 'auto'.</b>

otherwise leadselection will always give first row.

Regards

smitha

Former Member
0 Kudos

Hi Smitha,

Thanks for reply..

I am working in NWDS CE 7.1.

In this version no property like "compatability mode".

How to solve this problem...

Thanks,

Sunil.