Hey, this doesn't work i only get the last textfield. But i guess you are mean 
@InjectComponent instead of @Inject?

My code looks like:

<t:loop source="begegnungen" value="tipp">
        <t:submitnotifier>
        <t:textfield t:id="tippHeim" value="tipp.heimTipp"                      
                disabled="tippenVerboten"/>
        <t:textfield t:id="tippGast" value="tipp.gastTipp"                      
                disabled="tippenVerboten"/>
        </t:submitnotifier>
</t:loop>

        @InjectComponent
        private TextField tippHeim;
        @InjectComponent
        private TextField tippGast;
        @Persist
        private Map<Tipp,TextField[]> tfMap;
        void onAfterSubmit(){
                for(Tipp t:tipps){
                        if(tipp.equals(t)){
                                tfMap.put(tipp, new 
TextField[]{tippGast,tippHeim});
                        }
                }
        }

I checked the onAfterSubmit() with my debugger and find always the two same 
TextField Objects.


Dominik


-----Ursprüngliche Nachricht-----
Von: Ulrich Stärk [mailto:u...@spielviel.de] 
Gesendet: Dienstag, 16. Februar 2010 15:38
An: Tapestry users
Betreff: Re: Cross Validation in dynamic Forms

Depends on how you are doing the "dynamic" part. If you are looping over your 
textfields, then 
injecting them into the page class should work, e.g. <t:loop ...><t:textfield 
t:id="foo" ... 
/></t:loop> and "@Inject private TextField foo" should give you the field of 
the current iteration.

Uli

On 16.02.2010 14:34 schrieb Dominik Gätjens:
> Hello List,
>
>
>
> I'm building a dynamic form with textfields on the fly and need to do some 
> cross validation. This all works pretty and i find two fields that are 
> invalid together.
>
> But how can I report this error AND mark both fields as invalid? I don't have 
> a component to call  Form.recordError(field, errorMessage)
>
>
>
> Thanks
>
>
>
> Dominik
>
>
>
>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to