[jboss-user] [JBoss Seam] - Re: selectItems strange behavior
rodrigotico
do-not-reply at jboss.com
Fri Aug 10 06:58:18 EDT 2007
Thanks for your answer Pete, I put h:messages component.
If a city is selected, the error is "value is not valid" when I submit the form, but I don't know why.
Is that possible: inject the client's address with the selected city?
Thanks.
Here is the complete code of the page:
| <?xml version='1.0' encoding='ISO-8859-1'?>
| <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
| <rich:panel xmlns="http://www.w3.org/1999/xhtml"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:a="https://ajax4jsf.dev.java.net/ajax"
| xmlns:rich="http://richfaces.ajax4jsf.org/rich">
|
| <h:messages></h:messages>
| <h:form>
| <h:panelGrid columns="2">
| <h:outputText value="Name:"></h:outputText>
| <h:inputText value="#{client.name}"></h:inputText>
| <h:outputText value="Street:"></h:outputText>
| <h:inputText value="#{client.address.street}"></h:inputText>
|
| <h:outputText value="State:"></h:outputText>
|
| <h:selectOneMenu value="#{state}" id="state"
| valueChangeListener="#{insertClient.updateCities}">
| <s:selectItems value="#{insertClient.states}" var="state"
| label="#{state.name}" noSelectionLabel="Please Select..." />
| <a:support event="onchange" reRender="city"></a:support>
| <s:convertEntity />
| </h:selectOneMenu>
|
| <h:outputText value="City:"></h:outputText>
| <h:selectOneMenu value="#{client.address.city}" id="city">
| <s:selectItems value="#{insertClient.cities}" var="city"
| label="#{city.name}" noSelectionLabel="Please Select..." />
| <s:convertEntity />
| </h:selectOneMenu>
|
| <h:commandButton action="#{insertClient.saveClient}" value="ok h:"></h:commandButton>
| <s:button action="#{insertClient.saveClient}" value="ok s:"></s:button>
|
| </h:panelGrid>
| </h:form>
|
| </rich:panel>
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4072971#4072971
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4072971
More information about the jboss-user
mailing list