webtier@glassfish.java.net

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

From: Uwe Seimet <Uwe.Seimet_at_seimet.de>
Date: Tue, 27 Jan 2009 10:27:26 +0100

Hi Arved,

Thank you for your explanations.

> 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).

I see, but why does the content of my inputField inside the dataTable get lost
during the Apply Request Values phase, whereas the content of an inputField
outside the dataTable is preserved? Where does this difference in behavior
come from? I would expect *all* entered values to be preserved in the
rendered response, not just the values for inputFields placed outside a
dataTable.

Please have a look at this JSP, which has an inputText A outside a dataTable
and another inputText B inside a dataTable:

<h:inputText id="A" value="#{testBean.myValue" />
<h:dataTable var="rowData" value="#{testBean.model}">
  <h:column>
     <h:inputText id="B" value="#{rowData.contentMap.input}" />
  </h:column>
</h:dataTable>
<h:commandButton id="Submit" value="Submit" immediate="true" />

After submitting the form the content of the inputText A is still present
unchanged in the rendered response, but the content of the inputText B is
lost. I do not find any explanation for what appears an inconsistency to me.

Best regards Uwe