On Thu, 2002-05-16 at 13:19, John McNally wrote:
> I guess this is just a matter of preference, but I see no reason to have
> multiple forms for such a template. As you say each form uses the same
> action. The only reason I would see for using multiple forms is that
> they have different actions.
I really have to use diferent forms !
I solved the namespace problem using
<vtl>
#foreach($obj in $objs)
#set($group = $intake.MYGROUP.setKey("$obj.Id")
<form....>
<input name="group_selector" value="$obj.Id">
$intake.newForm()
$intake.declareGroup($group)
</form>
#end
</vtl>
This way I can point erros on diferent lines ( forms ).
If anyone wants to follow this aproach I recomendo you to add another
hidden form field to indicate with key was set to your group. This way
you can retrieve the right group easily using.
<code>
IntakeTool intake = (IntakeTool) ctx.get("intake");
Group group = intake.get("MYGROUP",MYKEY);
</code>
where MYKEY = $obj.Id = group_selector
I don't know if this is the best approach, but it's working perfectly !
I can write a howto a submit it to the list if you want !
>
> john mcnally
>
> On Thu, 2002-05-16 at 07:42, Leandro Rodrigo Saad Cruz wrote:
> > Hi all.
> > I'm trying to use intake in a multi-form page that shows all users in
> > turbine. The page looks like this:
> >
> > --------------------------------------------------------------
> > | ID | USERNAME | PASSWORD | EMAIL | |
> > | 1 | admin | admin | na | remove | update | roles |
> > | 2 | client | client | na | remove | update | roles |
> > --------------------------------------------------------------
> > |AUTO|[________]|[________]|[_____]| add |
> > --------------------------------------------------------------
> >
> > Ok. Every line on this table is a new form which points to the same
> > action.
> > I'm using intake to name/validate all forms in this template, but I'm
> > stuck on this problem : How do I choose between all the forms on the
> > table above when there is an error on form validation. Let me ilustrate.
> > If the user wants to change USER ID = 1 and incurs in a input validation
> > error I'd like only the form on the first line to show error messages !
> >
> > I think there is a way to do this in intake
> > ( yes , I read
> > http://jakarta.apache.org/turbine/turbine-2/services/intake-service.html
> > )
> >
> > but it's not clear to me how do I do it !
> >
> > --
> > Leandro Rodrigo Saad Cruz
> > IT - Inter Business Tecnologia e Servicos (IB)
> > http://www.ibnetwork.com.br
> >
> >
> > --
> > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> >
> >
>
>
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
Leandro Rodrigo Saad Cruz
IT - Inter Business Tecnologia e Servicos (IB)
http://www.ibnetwork.com.br
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>