Announcement

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

    DynamicForm.saveData() on FormItem.blur

    Good day,

    Is there a nice way to save the form data upon blur (or EditorExit) event? It looks like calling DynamicForm.saveData() from blur or EditorExit handlers prevents the further event propagation. For example, let's say we have a DynamicForm with one TextItem and a Button. User clicks on the TextItem, makes some changes and then clicks on the button. The form sends the data to the server as expected, but button onClick event never happens. The button only gets focus and the second click on it triggers onClick as expected. Basically, we would like to allow the user to save the data as she navigates from field to field much like DynamicForm. setSaveOnEnter(true) does on enter press.

    #2
    This is a built-in - see dynamicForm.implicitSave and implicitSaveOnBlur.

    Note that the reason click does not fire is that your call to saveData() shows the full-screen prompt, in order to block interactivity during the save (since this is usually not desired). To prevent this, you could pass showPrompt:false in the requestProperties when calling saveData(), but again, implicitSaveOnBlur seems to do everything you're asking for without the need for manual calls.

    Comment


      #3
      Awesome, thank you! I knew there's gotta be an API for that. One follow up question, [FONT=Arial, Verdana, sans-serif]implicitSaveOnBlur(true) doesn't seem to work without also setting [/FONT]dynamicForm.implicitSave to true. Are they linked or we can have just implicitSaveOnBlur?

      Comment


        #4
        We've made a change to allow implicitSaveOnBlur:true to be functional without implicitSave being set to true. You didn't mention your version, but you can make use of this new feature in SmartGWT versions 6.0 and 6.1, in builds dated August 23 and later.

        Comment


          #5
          Great, that is exactly what we're looking for! Thank you.

          Comment

          Working...
          X