Skip to Content
avatar image
Former Member

Which row's onEnter of a table

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    May 09, 2006 at 09:50 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 09, 2006 at 09:04 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 09, 2006 at 09:15 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded