Double select

UI Components for JSF
Post Reply
Hartman
Posts: 1
Joined: 13 Jun 2010, 18:25

13 Jun 2010, 18:33

Hi,
I'm newby primefaces and I have this problem:
when I use double select

Code: Select all

<h:selectOneMenu id="nomeSala" required="true" value="#{ordine.idSala}"
							requiredMessage="#{mex['javax.faces.component.UIInput.REQUIRED']}">
							<f:selectItem itemLabel="" itemValue="" />
							<f:selectItems value="#{ordine.salaImpl.salaListActive}" var="s"
								itemLabel="#{s.nomeSala}" itemValue="#{s.idSala}" />
							<p:ajax process="@parent"  update="nomeTavolo" event="change"
								actionListener="#{ordine.cercaTavolo}" />
						</h:selectOneMenu>
						<h:message for="nomeSala" styleClass="testo_errore" />
						<h:outputText value="#{mex['ordine.label.tavolo']}"
							styleClass="label_form" />
						<h:selectOneMenu id="nomeTavolo" required="true"
							value="#{ordine.idTavolo}" 
							requiredMessage="#{mex['javax.faces.component.UIInput.REQUIRED']}">
							<f:selectItem itemLabel="" itemValue="" />
							<f:selectItems value="#{ordine.tavoloList}" var="t"
								itemLabel="#{t.nomeTavolo}" itemValue="#{t.idTavolo}" />
						</h:selectOneMenu>
in this mode the ajax function is ok but when I submit a form with commandbutton I receive this error:
Validation Error: Value is not valid for the second select.
Before when I used the tomahawk and Jsf 1.2 I used the savestate and this double select work fine but now savestate not exist.
I use jsf 2 and primafaces only
Any ideas for resolve this error?
thanks a lot
Hartman

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

14 Jun 2010, 13:50

This happens when submitted value of a select component is not in the provided selectItems list. You need to make sure ordine.tavoloList is available in the commandButton request. JSF 2.0 has view scope for this.

nessa_uepa
Posts: 7
Joined: 16 Jun 2010, 17:01

16 Jun 2010, 17:04

I have the same problem.
I did put my managed bean in view scope, but the code don't work yet.
Anybody know what do?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 34 guests