0 Replies Latest reply on Apr 14, 2010 7:50 PM by Miguel Angel Goicochea

    Problem with @DataModelSelection and rich:hotKey

    Miguel Angel Goicochea Newbie

      I want to have an input field that when the return key is pressed it launches an event that will be propagated to the server. I have been using the <rich:hotKey> component and then having an <a4j:commandButton> that is hidden that performs the action. Something similar to what is done here [My Link=>http://relation.to/11633.lace]

      I am having a problem when I try to this with an input field inside a rich:datatable I've tried two solutions but none seem to work:

      1.- If I put the button inside the same column where the input is rendered the handle "##{rich:element('myButton').onclick()" does not seem to work, maybe because since the button is created in every single row with a different Id it cannot be resolved.

      2.- If I put the button outside the datatable it does call the action, but the problem is that the @DataModelSelection item is null, so I cannot perform the action I want inside the server action.

      Is there any other way to accomplish this? I tried to use the <a4j:support> tag on the onkeydown event, but it didn't seem to work and all the examples I found were quite simple and I couldn't find a way to fire an action on the server when the return key was pressed.