Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Executing click event after API call in "handleChanged" event

    I have a form with any number of fields which have a "changed" event handler that will make a call back to the server to persist the value entered per field.

    The persisting of the field data works perfectly.

    The problem I have is that the screen has a "Next" button that is intended to navigate to a new screen when the user clicks on it after saving any entered value in a field.

    The user can enter values for one or more of the fields in the form and click "Next".

    The problem we have is that when the user clicks "Next" having entered a value in a text field (NOT radioGroup, select, combobox etc), the click event is not executed because it is in clicking the "Next" button that the "changed" event is triggered for the text field via the mouseup event and the RPC call to persist the fields value effectively drops the click event.

    This means the user must click the "Next" button twice to move forward.

    I have tried using the EventHandler to capture the event in the "changed" handler and pass it to the callback from the RPC but there are all sorts of complications doing this and am hoping there is a much simpler way that I am unable to figure out at this time.

    Is there a way to capture the click event and effectively "yield" to the RPC call and allow the callback to continue the event bubbleup?

    Any advice appreciated.

    NOTE: The text field is set up with changeOnKeypress=false so that the persisting only happens when the field loses focus (ideally I do not want to save as each character is entered)
    Last edited by chris@umed.io; 28 Sep 2020, 03:40.

    #2
    The reason the click is being blocked is because you've got the default setting for RPCRequest.showPrompt, which blocks interactivity during the server contact. Just set showPrompt to false to avoid this.

    Comment


      #3
      Awesome - that did the trick.
      Thank you very much.

      Comment

      Working...
      X