webtier@glassfish.java.net

Re: [webtier] inputField content gets lost when immediate is set for submit

From: <webtier_at_javadesktop.org>
Date: Mon, 26 Jan 2009 04:40:44 PST

Hi, Uwe

Consider the fact that "immediate" operates in the Apply Request Values phase...for the component in question, the value from the request parameters (typically) is converted and validated, and that value is stored in the component.

Furthermore, components that implement ActionSource (JSF 1.2) will queue an ActionEvent if their "immediate" is true, which event will then be delivered at the end of the Apply Request Values phase.

Note that you have not yet done the Update Model Values phase for anything, and at the time that the event fires for the activated component (in your case a command button), none of the other components have even done conversion/validation - they only contain submitted "local" values (i.e. the request parameters or cookies).

This hopefully will help you answer your own question. Essentially, where your "missing" values are is still in the request parameters.

Typically the "immediate" property is used on a button to implement Cancel (or something similar), or in conjunction with a submit() in Javascript to update the page in response to a change in some component (where you haven't really filled out the form yet). And you probably would also be using bindings to the component in question to access the value.

HTH, Arved
[Message sent by forum member 'arveds' (arveds)]

http://forums.java.net/jive/thread.jspa?messageID=328150