Re: [Stripes-users] problem with validation

2012-08-17 Thread VANKEISBELCK Remi
I haven't checked out deeply, but I guess those fields starting upper-cased
ain't no good.

Stripes relies on JavaBean conventions : the field name should start
lower-cased, so that getters/setters actually represent the name of the
field :

private String myField;
public String getMyField();
public void setMyField(String myField);

Two options :
1/ stick to the convention, and rename TahunTerbit to tahunTerbit (and all
other fields)
2/ move your @Validate annotation to the getter (getTahunTerbit)

Of course, 1/ is most recommended. It's common practice to start field
names lower case.

HTH

Remi

2012/8/17 Frans fasisi2...@yahoo.com

 Hello,

 I am trying to put validation to form fields.

 Here is the link to the .java file :
 (https://dl.dropbox.com/u/16178250/Stripes/CatalogActionBean.java)

 Here is the link to the StripesResources.properties :
 (https://dl.dropbox.com/u/16178250/Stripes/StripesResources.properties)

 The problems are:
 1. minvalue and maxvalue for TahunTerbit are not working. I submit the
 form with
 value less then 1000 but didn't get error message
 2. I always get error message when I submit invalid number for TahunTerbit
 like
 '12q'
 3. I submit the form without set a value for NamaPengarang field but
 didn't get
 error message.

 Why the minvalue and maxvalue do not working?
 Why I always get error message for TahunTerbit?
 Why I never get error message when NamaPengarang is empty?

 Thank you



 --
 Live Security Virtual Conference
 Exclusive live event will cover all the ways today's security and
 threat landscape has changed and how IT managers can respond. Discussions
 will include endpoint security, mobile security and the latest in malware
 threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
 ___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


[Stripes-users] problem with validation

2012-08-16 Thread Frans
Hello,

I am trying to put validation to form fields.

Here is the link to the .java file :
(https://dl.dropbox.com/u/16178250/Stripes/CatalogActionBean.java)

Here is the link to the StripesResources.properties :
(https://dl.dropbox.com/u/16178250/Stripes/StripesResources.properties)

The problems are:
1. minvalue and maxvalue for TahunTerbit are not working. I submit the form 
with 
value less then 1000 but didn't get error message
2. I always get error message when I submit invalid number for TahunTerbit like 
'12q'
3. I submit the form without set a value for NamaPengarang field but didn't get 
error message.

Why the minvalue and maxvalue do not working?
Why I always get error message for TahunTerbit?
Why I never get error message when NamaPengarang is empty?

Thank you


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


[Stripes-users] Problem with validation and select tags

2010-06-06 Thread daniel cioriia
Hello,

I have the folowing problem: I want to validate some of the fields from my 
action bean. I have validated them using the ValidateNestedProperties 
annotation and everything is working well, but the problem I am facing is that 
the stripes-select fields from the jsp don't get populated. I have investigated 
and the problem appears because the sourcePage parameter points to the jsp 
page, so when Stripes performs the validation and it finds errors, it creates a 
ForwadResolution to the jsp page that is referred  to into the sourcePage 
parameter. But now the problem is that the jsp uses a collection provided by 
the ActionBean to populate the select, so because the forward resolution to the 
jsp page does not come from the ActionBean the collection is not set and 
nothing appears in the select when the page with errors is displayed to the 
users.
For example, for the jsp below:

stripes:form action=/AddOrganisation.action
 stripes:errors/
stripes:label for=name/
stripes:text name=organisation.name/
stripes:label for=orgType/
stripes:select name=organisation.orgType.id
stripes:options-collection collection=${requestScope.actionBean.allTypes} 
label=name value=id/
/stripes:select
stripes:label for=individual /
stripes:select name=organisation.individual multiple=multiple
stripes:options-collection 
collection=${requestScope.actionBean.allIndividuals} label=title 
value=id/
/stripes:select
stripes:submit name=save/
stripes:reset name=Reset/
/stripes:form

the collection ${requestScope.actionBean.allTypes} comes from the ActionBean 
and it is set correctly the first time. But, if there are validation errors the 
page will be displayed to the user and since the user is forwarded to the page 
by stripes not by the action bean the collection allTypes it is empty.

How should I manage this situation?

Thanks,
Dan



  --
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Problem with validation and select tags

2010-06-06 Thread Ben Gunter
There are a couple of ways. Personally, I advocate the lazy initialization
approach. Basically, your getter for the collection looks something like

if (collection == null) {
collection = doSomethingToMakeTheCollection();
}

return collection;

Another way to do it -- one which many prefer -- is to use Stripes'
@Before(stages=LifecycleStage.BindingAndValidation) on a method that
initializes the collection. That will ensure the collection is initialized
whether validation succeeds or fails.

-Ben

On Sun, Jun 6, 2010 at 6:45 AM, daniel cioriia danielcior...@yahoo.comwrote:

 Hello,

 I have the folowing problem: I want to validate some of the fields from my
 action bean. I have validated them using the ValidateNestedProperties
 annotation and everything is working well, but the problem I am facing is
 that the stripes-select fields from the jsp don't get populated. I have
 investigated and the problem appears because the sourcePage parameter points
 to the jsp page, so when Stripes performs the validation and it finds
 errors, it creates a ForwadResolution to the jsp page that is referred  to
 into the sourcePage parameter. But now the problem is that the jsp uses a
 collection provided by the ActionBean to populate the select, so because the
 forward resolution to the jsp page does not come from the ActionBean the
 collection is not set and nothing appears in the select when the page with
 errors is displayed to the users.
 For example, for the jsp below:

 stripes:form action=/AddOrganisation.action
  stripes:errors/
 stripes:label for=name/
 stripes:text name=organisation.name/
 stripes:label for=orgType/
 stripes:select name=organisation.orgType.id
 stripes:options-collection
 collection=${requestScope.actionBean.allTypes} label=name value=id/
 /stripes:select
 stripes:label for=individual /
 stripes:select name=organisation.individual multiple=multiple
 stripes:options-collection
 collection=${requestScope.actionBean.allIndividuals} label=title
 value=id/
 /stripes:select
 stripes:submit name=save/
 stripes:reset name=Reset/
 /stripes:form

 the collection ${requestScope.actionBean.allTypes} comes from the
 ActionBean and it is set correctly the first time. But, if there are
 validation errors the page will be displayed to the user and since the user
 is forwarded to the page by stripes not by the action bean the collection
 allTypes it is empty.

 How should I manage this situation?

 Thanks,
 Dan



 --
 ThinkGeek and WIRED's GeekDad team up for the Ultimate
 GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
 lucky parental unit.  See the prize list and enter to win:
 http://p.sf.net/sfu/thinkgeek-promo
 ___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Problem with validation and select tags

2010-06-06 Thread daniel cioriia
Hi,

Thanks for replying, Ben. I have used the lazy initialization approach you 
described and it works perfectly.

Regards,
Dan



  --
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Problem with Validation

2008-11-17 Thread marijan milicevic

On 11/17/2008 05:58 AM, Gregg Bolinger wrote:
 Alex, I tend to not open attachments in mailing lists. :)  It would 
 really be best if you could just copy and paste the most relevant bits 
 of code in the message, for me at least.  I obviously don't speak for 
 everyone.



windows user?
;-)

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Problem with Validation

2008-11-16 Thread Gregg Bolinger
Alex, I tend to not open attachments in mailing lists. :)  It would really
be best if you could just copy and paste the most relevant bits of code in
the message, for me at least.  I obviously don't speak for everyone.

Gregg

On Fri, Nov 14, 2008 at 2:51 PM, Alex Turner [EMAIL PROTECTED] wrote:

 Hello all,

 I'm having a problem with my form.  Stripes does validation and throws it
 back to the jsp that just displays Please fix the following errors:
 without showing any errors.

 I'm wondering if it has something to do with asking it to validate an
 object instead of an object value, but it didn't work with the id value for
 the object, so I was thinking this seems to be the right way.

 Thanks,

 Alex



 -
 This SF.Net email is sponsored by the Moblin Your Move Developer's
 challenge
 Build the coolest Linux based applications with Moblin SDK  win great
 prizes
 Grand prize is a trip for two to an Open Source event anywhere in the world
 http://moblin-contest.org/redirect.php?banner_id=100url=/
 ___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


[Stripes-users] Problem with Validation

2008-11-14 Thread Alex Turner
Hello all,

I'm having a problem with my form.  Stripes does validation and throws it
back to the jsp that just displays Please fix the following errors:
without showing any errors.

I'm wondering if it has something to do with asking it to validate an object
instead of an object value, but it didn't work with the id value for the
object, so I was thinking this seems to be the right way.

Thanks,

Alex


master_workflow.jsp
Description: Binary data


WorkflowMasterActionBean.java
Description: Binary data


WorkflowMasterItem.java
Description: Binary data


Project.java
Description: Binary data
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK  win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100url=/___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users