tags:

views:

175

answers:

1

I have a page "start.jsf" which points to an action #{ruler.start}, this action forwards the request to "flow.jsf".

The managed bean "ruler" (request scoped) contains some properties, one of them called "ruler.operation", correctly filled into "start.jsf".

The page "flow.jsf" has a command button pointing to an another managed bean called "objectList" (session scoped) containing a property object named "objectList.selectedContractor" (a POJO initialized into the constructor, so its children properties are always empty only at the first MB call, or wrong?), its action is #{objectList.itemInsert}.

The form page of "flow.jsf" contains the following tags:

 <h:form>
 <h:inputText id="crnameNew" value="#{objectList.selectedContractor.crname}" rendered="#{ruler.operation eq ruler.codeOperationNew}" />

 <h:inputText id="someProp" value="#{objectList.someProp}" />
 <h:commandButton styleClass="importedButton" value="insert" action="#{objectList.itemInsert}" />
 </h:form>

Well, when I submit the action #{objectList.itemInsert}, only "someProp" is correctly filled into the MB, while "selectedContractor.crname" results empty.

BUT if I toggle the "rendered" attribute from the tag binding the #{objectList.selectedContractor.crname}, it works and fill correctly when #{objectList.itemInsert} is invoked... so why "rendered" affect the processing of a submission?

+1  A: 

As the attribute suggests it only affects the rendering. If it's rendered on the page then the value will be sent back to the Bean on form submission. If it's rendering and this isn't happening then something else is wrong.

Damo
In fact I noticed that a simple test made by clean pages works exactly as expected, request scope managed beans does not influence the rendering attribute. Furthermore the form above is linked to a subview inside an include, I'll try cleaning a bit of code.
Steel Plume