Diogo Saad wrote:
>
You do not need to create multiple xml entries.
If the two Person objects give different answers to person.getQueryKey()
then you can use
#set ($Person1 = $intake.Person.mapTo($person1))
#set ($Person2 = $intake.Person.mapTo($person2))
This would be the case for two torque created Persons objects that had
been retrieved from storage. If there is no distinguishing information
which might be the case if both Person's are new objects, then you can
make up any key you want.
Note that the
#set ($Person = $intake.Person.Default)
is the same as
#set ($Person = $intake.Person.setKey("_0"))
So you can do this
#set ($Person1 = $intake.Person.setKey("1"))
#set ($Person2 = $intake.Person.setKey("2"))
or
#set ($Person1 = $intake.Person.setKey("manager"))
#set ($Person2 = $intake.Person.setKey("customer"))
Then just use the same keys to retrieve the groups in the next request
(action).
john mcnally
> I'm using intake to validate my forms .....
> I wanna have more than one PERSON validated in a form ..... how can I map them to
>different references of Person class???
> Do I have to create multiple groups in intake.xml to populate each object ?
>
> intake.xml
> <group name="Person" key="pess" mapToObject="om.Person">
>
> <field name="Name" key="nm" type="String">
> <rule name="mask" value="^[a-zA-Z ]*$">
> wrong syntax .</rule>
> </field>
> </group>
>
> bla.vm
> #set ($Person=$intake.Person.Default)
> <input type="TEXT" name="$Person.Name.Key" value="$Person.Name">
>
> Diogo Saad
> Inter Business Tecnologia e Servi�os
> [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]