mercredi 26 mars 2014

Unable to save to back bean if I use rendered attribute. JSF 1.2


Vote count:

0




I'm working on a page that has a search functionality. The top of the page is for search criteria, the bottom of the page is to display search results in radio buttons.

The user then selects a radio button and clicks next to save the selection.


I only want to display the results after the search button has been pressed. I have been unable to save the values within the panelGroup if I use the "rendered" attribute.


Excerpts of my jsp:



<div>
<div>
<h:outputFormat value="Search SEIN"></h:outputFormat>
<h:inputText value="#{pc_Mresearch.sein}"></h:inputText>
</div>
<h:commandButton action="#{pc_Mresearch.doSeinSearch}" value="Search"/>
</div>

<h:panelGroup rendered="#{pc_Mresearch.searchResultsReturned}">
<legend class="legend">Results</legend>
<div id="searchResultsRadioButtons">
<h:selectOneRadio layout="pageDirection" id="radioAcctNum" value="#{pc_Mresearch.employeracct}">
<f:selectItems value="#{pc_Mresearch.recentSEINEmployerList}"/>
<f:selectItem itemLabel="Not Listed" itemValue="0"/>
</h:selectOneRadio>
</div>
</h:panelGroup>
<hx:commandExButton type="submit" value="Next" id="next" action="NextPage"></hx:commandExButton>


Excerpts of pc_Mresearch bean:



public String doSeinSearch() {
// make web svc call to search by SEIN

// populate recentSEINEmployerList property to be used by searchResultRadioButtons

if (recentSEINEmployerList != null) {
this.searchResultsReturned = true; //to be used by "rendered" property
}
return "Success";
}


I came across an article (http://ift.tt/1jLuo9v) that says


"the rendered attribute is restricted to using rvalue expressions. As explained inValue and Method Expressions http://ift.tt/1jLupuh , these rvalue expressions can only read data; they cannot write the data back to the data source"


Does anyone have any suggestions on what to use instead of rendered? I'm using JSF 1.2.


Thank you, Ellie



asked 34 secs ago






Aucun commentaire:

Enregistrer un commentaire