Hi Luther,
If I add a few values to a page <div ala an Ajax button - and the user hits
refresh on the page, the new values I've added go away.

The user is completing a form - but hasn't formally submitted the form yet -
so there is nothing stored in the database yet. The browser naturally
re-renders the <textarea and <input values to the screen - but wipes out
content to any <divs I might have dynamically added data to.

There is a DOM event on 'unload' on the <body> tag that can be used to notify the user about what will happen in this case; i.e. they will lose the data they have entered if they refresh.

Have a look at ModalWindow since it implements an unload event for just this case.

It seems like you should be able to add an AttributeModifier on the body tag and then craft an interface where you particular component can contribute a javascript callback to the main unload callback maybe via an IModel<String>.

Another option if your forms are small enough is to just push an ajax get request with customized parameters or AjaxFormComponentUpdatingBehavior when the data is changed (i.e. bind the callback to the 'onblur' event) This will populate the server side models and allow a rerender to work properly.

Regards,

Mike



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to