rich:inplaceSelect not validated
clerum Feb 26, 2009 6:09 PMI'm having an issue where if I am adding a new user to my site. All the fields are null initially on the form.
If I go through and set all the fields, but forget to set the timezone to a value in the inplaceselect the page submits and passes validation and I get the following error
Caused by javax.servlet.ServletException with message: "#{userutil.addUser(organization)}: javax.ejb.EJBTransactionRolledbackException: org.hibernate.PropertyValueException: not-null property references a null or transient value: net.test.sirius.User.timezone"
It appears that the rich:inplaceSelect isn't going through validation. Is there a trick to getting this working?
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition 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:rich="http://richfaces.org/rich" template="/layout/template.xhtml"> <ui:define name="body"> <h:form id="addUserForm"> <rich:panel> <f:facet name="header">User</f:facet> <s:decorate id="usernameDecoration" template="/layout/edit.xhtml"> <ui:define name="label">Email Address</ui:define> <h:inputText id="username" required="true" value="#{user.username}"/> </s:decorate> <s:decorate id="firstnameDecoration" template="/layout/edit.xhtml"> <ui:define name="label">First Name</ui:define> <h:inputText id="firstname" required="true" value="#{user.firstname}"/> </s:decorate> <s:decorate id="lastnameDecoration" template="/layout/edit.xhtml"> <ui:define name="label">Last Name</ui:define> <h:inputText id="lastname" required="true" value="#{user.lastname}"/> </s:decorate> <s:decorate id="passwordDecoration" template="/layout/edit.xhtml"> <ui:define name="label">Password</ui:define> <h:inputText id="password" required="true" value="#{user.password}"/> </s:decorate> <s:decorate id="organizationDecoration" template="/layout/edit.xhtml"> <ui:define name="label">Organization</ui:define> <h:outputText id="organization" required="true" value="#{organization.name}"/> </s:decorate> <s:decorate id="timezone" template="/layout/edit.xhtml"> <ui:define name="label">Time Zone</ui:define> <rich:inplaceSelect id="tzpick" value="#{user.timezone}" defaultLabel="Click to Set" required="true" requiredMessage="A Timezone Must be Selected"> <f:selectItem itemValue="PST8PDT" itemLabel="Pacific" /> <f:selectItem itemValue="MST7MDT" itemLabel="Mountain" /> <f:selectItem itemValue="MST7" itemLabel="Mountain - Arizona" /> <f:selectItem itemValue="CST6CDT" itemLabel="Central" /> <f:selectItem itemValue="EST5EDT" itemLabel="Eastern" /> </rich:inplaceSelect> </s:decorate> <div style="clear:both"/> </rich:panel> <div class="actionButtons"> <h:commandButton id="add" value="Add" action="#{userutil.addUser(organization)}"/> <h:commandButton id="cancel" value="Cancel" action="/home.xhtml"/> </div> </h:form> </ui:define> </ui:composition>