When you use a component in a loop, only one
instance of it is used.
If you want to do a custom cross-field validation
amongst the text fields in the loop, in Java code,
there is a hack mentioned in the archive
http://article.gmane.org/gmane.comp.java.tapestry.user/39123/match=shing+delegate
Shing
--- Miguel Angel Hernández <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> We recently stumbled with the following problem
> regarding a For component.
>
> We have a tamplate more less like this:
>
> <form jwcid="@Form">
> <ul>
> <span jwcid="@For" source="ognl:list"
> value="ognl:element"
> element="li">
> Value: <span
> jwcid="[EMAIL PROTECTED]" value="ognl:
> element.value"/>
> </span>
> <li>
> <span jwcid="@Submit"
> action="listener:submit"/>
> </li>
> </ul>
> </form>
>
>
> The collections has a number elements say three:
>
> public void pageBeginRender(PageEvent arg0) {
> if (getList() == null) {
> setList(new LinkedList<Element>());
> getList().add(new Element());
> getList().add(new Element());
> getList().add(new Element());
> }
> }
>
>
> Tapestry renders the three TextFields giving them
> the names and ids:
> elementTF, elementTF_0, elementTF_1.
>
> But when you inspect the component/page it only has
> the first TextField:
> elementTF, seem the others aren't a member of the
> page at all :(,
> In order to record errors in the delegate we need to
> access all the
> TextFields components form a listener...
>
> Anyone can explain Why this is happening and/or a
> turnaround,
>
> thanks in advance,
>
> Miguel
>
Home page :
http://uk.geocities.com/matmsh/index.html
___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]