[richfaces-issues] [JBoss JIRA] Commented: (RF-3154) Nested ajax rendered components not submitting

Nick Belaevski (JIRA) jira-events at lists.jboss.org
Mon Apr 21 10:37:45 EDT 2008


    [ http://jira.jboss.com/jira/browse/RF-3154?page=comments#action_12409800 ] 
            
Nick Belaevski commented on RF-3154:
------------------------------------

Not the problem of ajax components. That won't work either:

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<html>
	<head>
		<title>This page is for development purposes only</title>

	</head>
	<body>
		<f:view>
			<h:form id="form">
				<h:selectOneMenu id="toggle" value="#{test.rendered}">
					<f:selectItem itemLabel="No" itemValue="false"/>
					<f:selectItem itemLabel="Yes" itemValue="true"/>
				</h:selectOneMenu>

				<h:commandButton value="Submit" />

				<h:panelGrid id="main-grid" columns="2" rendered="#{test.rendered}">
					<h:outputLabel for="some-text" value="Here Is Some Text"/>
					<h:inputText value="#{test.text}" id="some-text" styleClass="new-input optional" title="some text"/>
					<h:outputLabel for="some-select" value="Some drop down"/>
					<h:selectOneMenu value="#{test.selectValue}" id="some-select" styleClass="new-input">
						<f:selectItem itemValue="1" itemLabel="1"/>
						<f:selectItem itemValue="2" itemLabel="2"/>						
					</h:selectOneMenu>
					<h:outputText id="output" value="#{test.selectValue}" rendered="#{test.selectValue gt 0}"/>
				</h:panelGrid>			
			</h:form>
		</f:view>
	</body>	
</html>  

You need to use session-scoped bean for your sample to work. JSF doesn't process components that aren't rendered and h:panelGrid isn't rendered until MODEL_UPDATE phase for the next request.

> Nested ajax rendered components not submitting
> ----------------------------------------------
>
>                 Key: RF-3154
>                 URL: http://jira.jboss.com/jira/browse/RF-3154
>             Project: RichFaces
>          Issue Type: Bug
>    Affects Versions: 3.1.4, 3.1.3, 3.1.2, 3.1.1, 3.1.5, 3.1.x
>         Environment: Jboss + Richfaces + Myfaces
>            Reporter: Adam Jenkins
>            Priority: Blocker
>         Attachments: ValueChangeBugReportBean.java, ValueChangeBugReproduce.jsp
>
>
> When an ajax output panel is rerendered on a selects 'onchange', and it contains a panel and another select (with similar behaviour), the values of the second select aren't being bound to the model...this is more easily explained in code:
> See the attached jsf page and managed bean.  When the first select with id="toggle" is changed, the output panel main-panel reRendered fine, and the child components (which have a 'rendered' attribute) are now visible...perfect
> However the child component that is a select (id="some-select") that has a4j support isn't being bound to the backing bean when the onchange event is fired.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the richfaces-issues mailing list