on 05-09-2006 9:43 AM
Hi,
There is a table that has a column of non-readonly inputfield, which onEnter() is bound to an action handler.
When user presses "Enter" in one of the inputfield, how to know which row emits the onEnter event?
Thanks!
Tony
Hi Shyam & Satyajit,
Your suggestions work when user choose the inputfield by mouse before pressing enter.
However, the user can also use the keyboard arrow to move the blinking cursor upward and downward in the column of inputfield. If the blinking cursor is not at the same row as the lead-selected row, and user press enter at this moment, the lead selection will be kept unchanged.
Another failure scenario is when the table has master column, i.e. TreeByNestingTable and the tableUI's selectionMode is set to be "none". No leadselect event will be generated. Moreover, the lead selection of the bound data node is not changed.
Thus, your suggested way is possible but not a perfect one.
Regards,
Tony
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Map the implicit event parameter "nodeElement" to an action handler parameter "element" of type IWDNodeElement.
inputField.mappingOfOnAction().addSourceMapping
(
"nodeElement",
"element" /* name of action parameter */
);
Then you can get the row by element.index() inside the action handler.
Armin
Hi,
In the eventhandler try this:
int rowIndex = wdContext.node<NodeName>.getLeadSelection();
This will give you the zero based index of the row on which the Enter has been pressed.
Regards,
Satyajit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tony,
In the implementation for OnEnter, you can get the current lead selected element of the node which you had bound to the table.Thus for that particular row, the action will be executed.
regards
Shyam.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.