Guy Bashan schrieb:

Hi All,

I have a form that also shows list of items. The items can be reordered. And new items can be added. In addition there are several more fields on the screen.

Some of the fields are required (required=true). When pressing an image to change the order of item (move it up or down), I don't want error messages to appear.

So I added "immediate=true". And in the action I made sure to do "renderResponse". There is also an option of adding a new item at the end of the list.

My problem is: When I add a new item, and fill it with some value (an item is simply an inputText), then press the change order image, the new value added is becoming empty.

Does the "immediate" prevent from value to be submitted?


When you send an email, please indicate the version of myfaces you are using.

I'm surprised at what you describe here.

Setting "immediate" definitely doesn't prevent a value from being "submitted" from the browser to the server.

I think that during processDecodes, the Renderer for the command component will detect that it has been activated and queue an event. Normally the event has a phaseId of INVOKE_APPLICATION, meaning the event is executed after the model is updated. But when the component queuing the event is immediate, then the event has a phase of PhaseId.APPLY_REQUEST_VALUES, meanintg that the action method will be called before the model is updated - but *after* all components have loaded the data from the submitted form into their "submittedValue" property.

So you should not be losing any data that has been input into other fields; it won't be in the model, but will be in the component objects.

Are you sure that you are doing a "null" navigation (ie keeping the same view tree)? If you were actually doing a navigation back to the same view, causing the view tree to be re-created then that would explain what you see.

Regards, Simon

Reply via email to