You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Thomas Hackel <th...@bi-so.com> on 2005/02/21 18:31:04 UTC

Access Components inside ListEdit (or Foreach) when in listener?

Hi!

We have some Fields which are being iterated by a ListEdit.
How to access the Component in the listener of the Form ?

We can only get the last component for each column.
Is there a solution for this?

Thanks in advance,
Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Access Components inside ListEdit (or Foreach) when in listener?

Posted by John Reynolds <jo...@gmail.com>.
You're right Thomas.

You will have to cache the values of the individual components, and
validate after they've all been rendered.  Components inside ListEdit
and Table are transient.... I'm sure there are good reasons for this,
but when you need to do Form-level validation it's a pain.


On Tue, 22 Feb 2005 10:23:01 +0100, Thomas Hackel
<th...@bi-so.com> wrote:
> Kent Tong wrote:
> > Thomas Hackel <thomas.hackel <at> bi-so.com> writes:
> >
> >
> >>We have some Fields which are being iterated by a ListEdit.
> >>How to access the Component in the listener of the Form ?
> > Why do you want to do that?
> 
> To do (semantic) validation of the content, and putting an
> error/delegation into the component which has an semantic/logic error.
> 
> The form can only be validated as a whole when all the fields are
> filled, and ne number of fields is dynamic.
> 
> (stupid) example:
> 
> field1-value: 4
> field2-value: 6
> field3-value: 5
> field4-value: 8
> .
> .
> .
> 
> the field3 has a logic error because its not larger than the field before...
> 
> IMHO this cant be done with the normal validation.
> 
> Best regards,
> Thomas
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Access Components inside ListEdit (or Foreach) when in listener?

Posted by Thomas Hackel <th...@bi-so.com>.
Kent Tong wrote:
> Thomas Hackel <thomas.hackel <at> bi-so.com> writes:
> 
> 
>>We have some Fields which are being iterated by a ListEdit.
>>How to access the Component in the listener of the Form ?
> Why do you want to do that?

To do (semantic) validation of the content, and putting an 
error/delegation into the component which has an semantic/logic error.

The form can only be validated as a whole when all the fields are 
filled, and ne number of fields is dynamic.

(stupid) example:

field1-value: 4
field2-value: 6
field3-value: 5
field4-value: 8
.
.
.

the field3 has a logic error because its not larger than the field before...

IMHO this cant be done with the normal validation.

Best regards,
Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Access Components inside ListEdit (or Foreach) when in listener?

Posted by Kent Tong <ke...@cpttm.org.mo>.
Thomas Hackel <thomas.hackel <at> bi-so.com> writes:

> We have some Fields which are being iterated by a ListEdit.
> How to access the Component in the listener of the Form ?

Why do you want to do that?


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Access Components inside ListEdit (or Foreach) when in listener? [auf Viren geprueft]

Posted by Jonathan O'Connor <Jo...@xcom.de>.
Thomas,
I wanted to do something similar a few months ago, and ran into the same 
problem.
It seems that each row gets the same component id in the foreach. So, then 
Tapestry adds each component into a HashSet, keyed on component id.
Bingo! That's why you only see the last one, because each put() overrides 
the value of the previous one.

Unfortunately, you will have to find an alternative way of doing what you 
want. However, maybe you can augment your model collection, and then 
create the new components the way you want in the view.
Ciao,
Jonathan O'Connor
XCOM Dublin



Thomas Hackel <th...@bi-so.com> 
21/02/2005 17:31
Please respond to
"Tapestry users" <ta...@jakarta.apache.org>


To
tapestry-user@jakarta.apache.org
cc

Subject
Access Components inside ListEdit (or Foreach) when in listener? [auf 
Viren geprueft]






Hi!

We have some Fields which are being iterated by a ListEdit.
How to access the Component in the listener of the Form ?

We can only get the last component for each column.
Is there a solution for this?

Thanks in advance,
Thomas

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org





*** Aktuelle Veranstaltungen der XCOM AG ***

XCOM laedt ein zur IBM Workplace Roadshow in Frankfurt (16.02.2005), Duesseldorf (23.02.2005) und Berlin (02.03.2005)
Anmeldung und Information unter http://lotus.xcom.de/events

Workshop-Reihe "Mobilisierung von Lotus Notes Applikationen"  in Frankfurt (17.02.2005), Duesseldorf (24.02.2005) und Berlin (05.03.2005) 
Anmeldung und Information unter http://lotus.xcom.de/events


*** XCOM AG Legal Disclaimer ***

Diese E-Mail einschliesslich ihrer Anhaenge ist vertraulich und ist allein fur den Gebrauch durch den vorgesehenen Empfaenger bestimmt. Dritten ist das Lesen, Verteilen oder Weiterleiten dieser E-Mail untersagt. Wir bitten, eine fehlgeleitete E-Mail unverzueglich vollstaendig zu loeschen und uns eine Nachricht zukommen zu lassen.

This email may contain material that is confidential and for the sole use of the intended recipient. Any review, distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.