[jboss-user] [JBoss Seam] - Ajax4JSF and s:selectItems

pdhaigh do-not-reply at jboss.com
Fri Aug 17 12:33:45 EDT 2007


I'm having some difficulty getting an a4j action trigger a re-evaluation of the value in a h:selectOneMenu using s:selectItems.

Is there anything wrong with the following?


  | <h:form id="mainForm">
  | 	<f:facet name="afterInvalidField">
  | 	<h:panelGroup><br/><s:message/></h:panelGroup>
  | 	</f:facet>
  | 	<f:facet name="aroundInvalidField">
  | 	<s:span styleClass="error"/>
  | 	</f:facet>   		    
  | 	<s:validateAll>			
  | 		<h:panelGrid columns="2" columnClasses="object,value">
  | 			<h:outputText  value="Destination: "/>
  | 			<h:panelGroup>
  | 				<h:selectOneMenu value="#{pressArticle.destination}" >
  | 					<s:selectItems value="#{destinations.resultList}" 
  | 						var="destination" 
  | 						label="#{destination.name}"
  | 						noSelectionLabel="Please select"/>
  | 					<s:convertEntity/>
  | 					<a4j:support ajaxSingle="true" event="onchange" reRender="mainForm,mainForm:dothis" actionListener="#{pressArticleManager.setDestination}"/>
  | 				</h:selectOneMenu>															       
  | 				<h:commandButton styleClass="button" style="margin:0px 0px 0px 5px; padding: 0px" actionListener="#{pressArticleManager.setDestination}" value="Set destination"/>
  | 			</h:panelGroup>	
  | 			<h:outputText  value="Region: "/>
  | 			<h:panelGroup>
  | 				<s:decorate id="dothis">
  | 					<h:selectOneMenu value="#{pressArticle.region}" >
  | 						<s:selectItems value="#{regions.resultList}" 
  | 							var="region" 
  | 							label="#{region.name}"
  | 							noSelectionLabel="Please select"/>
  | 						<s:convertEntity/>
  | 					</h:selectOneMenu>															       
  | 				</s:decorate>
  | 				<h:outputText value="Region: #{pressArticle.region.name}" rendered="#{pressArticle.region!=null}"/>		
  | 			</h:panelGroup>	
  | 		</h:panelGrid>
  | 	</s:validateAll>
  | </h:form>

The a4j tag does correctly call my backing mething, which logs the change to pressArticle.region, but the drop down value does not change. Subsequently calling a standard JSF action back to the same view-id does change the drop down value..

cheers

p

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4075282#4075282

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4075282



More information about the jboss-user mailing list