Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Server Faces, RichFaces rerender issues  RSS feed

 
Danny Jackson
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to update an <f:selectItems> element dynamically via an event fired by a <h:selectOneMenu> element selection.

I am able to update the backing bean and it's collection but the list refuses to update. I have tried various <a4j> constructs with reRender etc. The only option I can
see is somehow referencing the <f:selectItems id="sel1"> element in Java code somehow though I know this is either impossible and probably incorrect. I am new to Ajax and JSF but this has stumped me for several days and I really need to get past this problem or try another approach.

The end user wants this capability of selecting a element and updating a 'child' <h:selectManyListbox> 5 times on a single page.
Then the page needs to be submitted, validated and written to the DB. Is this even possible?

I am using JSF 1.2 and RichFaces 3.3 on top of JBosss Seam with Hibernate.

The code .xhtml code follows:
<a4j:region id="innerRegion"> <s:decorate
id="adjReason1"> <ui:define name="label">Reason:</ui:define>

<h:selectOneMenu id="adjReason1" value="#{manualReconClaim.entity.adjReason1}" valueChangeListener="#{valueChangeListener.processValueChange}" >
<f:selectItems value="#{manualReconAdjReasons}" />


<a4j:support event="onclick"
reRender="sel1"
action="#{manualReconSelections.getManualReconRemitRemarks1}"></a4j:support>
</h:selectOneMenu>
</s:decorate>

<!-- THIS IS AN EXPERIMENT THAT DOESN'T REFRESH THE LIST BELOW -->
<a4j:commandLink value="biteme" id="processUpdateButton" action="#{manualReconSelections.getManualReconRemitRemarks1}"
ajaxSingle="true" immediate="true" reRender="sel1">
</a4j:commandLink>

<s:decorate id="remit" template="/layout/edit.xhtml"> <ui:define name="label">Remittance Remark:</ui:define>

<!-- REFUSEs TO BE UPDATED -->
<h:selectManyListbox size="8" id="remCode"
required="true" value="#{manualReconSelections.remitCode}" >
<!-- THIS NEEDS TO BE REFRESHED DYNAMICALLY - the backing map is refreshed correctly but changes are not displayed -->
<f:selectItems id="sel1" value="#{manualReconRemitRemarks1}"/>
</h:selectManyListbox> </s:decorate> </a4j:region>

Any help or hints is greatly appreciated!
 
Tim Holloway
Bartender
Posts: 18662
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SelectItems are not renderable controls. They are model data specifications. Re-render the "remCode" control, instead.

Note that RichFaces version 3 does NOT work with any version of Internet Explorer past IE8 and never will. Later versions of IE can be forced to act in IE8 emulation mode, but Microsoft has committed to completely dropping IE8 support in less than a year.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!