Re: [studs-user] How to implement validation?
Status: Beta
Brought to you by:
mojavelinux
|
From: Dan A. <dan...@gm...> - 2005-07-06 00:37:39
|
I am going to add a wiki page for this cycle so that is clear to
everyone how it is supposed to work. I am also adding validation as
part of the golflog demo in order to demonstrate how it works. I
figure this will be the best way to document and explain it. Check
the wiki soon.
/dan
On 7/2/05, Adriano Bonat <adr...@gm...> wrote:
> Hello!
>=20
> I'm doing some tests in Golflog sample application, and could not
> implement a validation at the present moment.
>=20
> I looked golflog\WEB-INF\classes\golflog\form\PlayerActionForm.php and
> added the follow method:
>=20
> function validate(&$mapping, &$request)
> {
> $messages =3D& new ActionMessages();
> $message =3D& new ActionMessage('bonat.teste');
> $messages->add(c('ActionMessages::GLOBAL_MESSAGE'), $mess=
age);
> return $messages;
> }
>=20
> Yeah, this always produces an error in the validation process, is just
> for tests.
>=20
> The struts-config.xml part that is important for PlayerActionForm
> validation was modified to this:
> <action
> path=3D"/EditPlayerSubmit"
> type=3D"golflog.action.EditPlayerSubmitAction"
> name=3D"playerForm"
> scope=3D"request"
> validate=3D"true"
> input=3D"Player Editor"
> >
> <forward name=3D"next" path=3D"/ListPlayers.action" redirect=
=3D"true"/>
> </action>
>=20
> I think that value of the 'input' attribute is wrong, but this is the
> unique value that go back to the player editor form, but the
> ActionMessages are not printed.
>=20
> Best regards,
> -Adriano
>=20
>=20
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id=16492&opclick
> _______________________________________________
> studs-user mailing list
> stu...@li...
> https://lists.sourceforge.net/lists/listinfo/studs-user
>=20
--=20
Open Source Advocacy
http://www.mojavelinux.com
|