"lastName": Error during model data update.
I do not get a lastName required error
On 11/3/06,
Jeff Bischoff <[EMAIL PROTECTED]> wrote:
Mick Knutson wrote:
> When I use the "id="user.firstName"" in the input text I get [Exception]
>
Right, you can't do that. Why would you want to?
> Then I just submit the form with nothing in the text field, I get this:
>
> "lastName": Error during model data update.
>
> in the messages.
>
>
> Why do I not get a "Required" error message?
>
Not sure. Is this before or after you fix the error with firstName's id?
Regards,
Jeff Bischoff
Kenneth L Kurz & Associates, Inc.
Mick Knutson wrote:
> I was creating a BackingBean that has my hibernate POJO inside like:
>
> UserBackingBean:
> ===========================================
> public class UserBackingBean extends BaseObject {
>
>
> private User user;
>
> public User getUser() {
> return user;
> }
>
> public void setUser(User user) {
> this.user = user;
> }
>
>
>
> } // The End...
>
>
>
> User.java:
> =============================
> public class User extends BaseObject {
>
> private static final long serialVersionUID = -5450022397980854742L;
>
> private java.lang.String username;
> private java.lang.String password;
> private java.lang.String passwordConfirm;
> private java.lang.String firstName;
> private java.lang.String email;
> private java.lang.String lastName;
> private java.lang.String address;
> private java.lang.String address2;
> private java.lang.String city;
> private java.lang.String state;
> private java.lang.String otherState;
> private java.lang.String postalCode;
> private java.lang.String country;
>
> private java.util.Date lastUpdate;
> private java.util.Date creationDate;
>
>
> public String getUsername() {
> return username;
> }
>
> ...... more omitted....
>
>
> Registration.jsp:
> ===================================
> <h:form>
>
> <TABLE>
> <TBODY>
>
> <TR>
> <TD>
> <h:outputText value="#{messages['label.firstName']}"
> />:
> </TD>
> <TD>
> <h:inputText value="#{UserBackingBean.user.firstName
> }"
> required="true"
> id=" user.firstName" >
> <f:validateLength minimum="2" />
> </h:inputText>
> <h:message for="" "
> errorClass="error" />
> </TD>
> </TR>
>
>
>
> When I use the "id="user.firstName "" in the input text I get:
>
> 10:37:30,445 ERROR [[jsp]] Servlet.service() for servlet jsp threw
> exception
> java.lang.IllegalArgumentException: Subsequent characters of component
> identifier must be a letter, a digit, an underscore ('_'), or a dash ('-')!
> But comp
> onent identifier contains "."
>
>
>
>
> But when I use
>
> <h:inputText value="#{ UserBackingBean.user.lastName
> }"
> required="true"
> id="lastName" >
> <f:attribute name="lastName" value="#{messages['
> error.required']}" />
> </h:inputText>
> <h:message for="">> errorClass="error" />
>
>
>
> Then I just submit the form with nothing in the text field, I get this:
>
> "lastName": Error during model data update.
>
> in the messages.
>
>
> Why do I not get a "Required" error message?
>
>
>
>
>
>
>
--
Thanks
DJ MICK
http://www.djmick.com
http://www.myspace.com/mickknutson