You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@click.apache.org by c-...@hitachijoho.com on 2009/10/05 02:33:22 UTC

HibernateForm

Hello List
 When I use HibernateForm, I find something is not correct.
 Eg.  TextField  name = new TextField("name", "name", true);
 The required flag doesn't work.
 And form.isValid() don't validate.
 Is this a bug?
 
 

Re: HibernateForm

Posted by Bob Schellink <sa...@gmail.com>.
Hi,

HibernateForm should apply the requirement constraints all long as those
constraints are specified in Hibernate mappings. So you should have the
following mapping:

 <property name="firstName" not-null="true"/>

If you do specify the not-null constraint and HibernateForm does not set
the Field to required, then that looks like a bug in HibernateForm.

kind regards

bob

c-bryu@hitachijoho.com wrote:
> Hi, bob
>  Thank you for your response.
> 
>   The HibernateFrom API has wrote "This form will automatically apply the given objects   property required validation constraints to the form fields."
>   And the given example is "form.add(new TextField("firstName");"
>   The required flag don't set explicitly.
>   Maybe change " form.add(new TextField("firstName", true);" to 
>  " form.add(new TextField("firstName");" , will it work?
>  Now I'm in company, I can't test.
> 
>  Best regards.
>  Wateray from Tokyo.
> 
> -----Original Message-----
> From: Bob Schellink [mailto:sabob1@gmail.com] 
> Sent: Monday, October 05, 2009 10:12 AM
> To: click-user@incubator.apache.org
> Subject: Re: HibernateForm
> 
> Hi,
> 
> The idea behind HibernateForm is to automate some common functionality
> such as validation. In this case HibernateForm will automatically set
> the field readonly value based on whether the database column allow a
> null value or not. I guess HibernateForm is overriding the value you set
> explicitly.
> 
> Perhaps HibernateForm should only set the Field readonly flag if the
> value is false?
> 
> kind regards
> 
> bob
> 
> c-bryu@hitachijoho.com wrote:
>> Hello List
>>  When I use HibernateForm, I find something is not correct.
>>  Eg.  TextField  name = new TextField("name", "name", true);
>>  The required flag doesn't work.
>>  And form.isValid() don't validate.
>>  Is this a bug?
>>  
>>  
>>
> 
> 


RE: HibernateForm

Posted by c-...@hitachijoho.com.
Hi, bob
 Thank you for your response.

  The HibernateFrom API has wrote "This form will automatically apply the given objects   property required validation constraints to the form fields."
  And the given example is "form.add(new TextField("firstName");"
  The required flag don't set explicitly.
  Maybe change " form.add(new TextField("firstName", true);" to 
 " form.add(new TextField("firstName");" , will it work?
 Now I'm in company, I can't test.

 Best regards.
 Wateray from Tokyo.

-----Original Message-----
From: Bob Schellink [mailto:sabob1@gmail.com] 
Sent: Monday, October 05, 2009 10:12 AM
To: click-user@incubator.apache.org
Subject: Re: HibernateForm

Hi,

The idea behind HibernateForm is to automate some common functionality
such as validation. In this case HibernateForm will automatically set
the field readonly value based on whether the database column allow a
null value or not. I guess HibernateForm is overriding the value you set
explicitly.

Perhaps HibernateForm should only set the Field readonly flag if the
value is false?

kind regards

bob

c-bryu@hitachijoho.com wrote:
> Hello List
>  When I use HibernateForm, I find something is not correct.
>  Eg.  TextField  name = new TextField("name", "name", true);
>  The required flag doesn't work.
>  And form.isValid() don't validate.
>  Is this a bug?
>  
>  
> 


Re: HibernateForm

Posted by Bob Schellink <sa...@gmail.com>.
Hi,

The idea behind HibernateForm is to automate some common functionality
such as validation. In this case HibernateForm will automatically set
the field readonly value based on whether the database column allow a
null value or not. I guess HibernateForm is overriding the value you set
explicitly.

Perhaps HibernateForm should only set the Field readonly flag if the
value is false?

kind regards

bob

c-bryu@hitachijoho.com wrote:
> Hello List
>  When I use HibernateForm, I find something is not correct.
>  Eg.  TextField  name = new TextField("name", "name", true);
>  The required flag doesn't work.
>  And form.isValid() don't validate.
>  Is this a bug?
>  
>  
>