You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Janko Muzykant <um...@gmail.com> on 2007/09/20 10:41:21 UTC

T5 how to get form fields

hi, my form is generated in a runtime, i.e. fields are added/removed by
javascript. is there any way to get list (map) of form fields in a submit
handler? i guess they should be stored somewhere in a request but i'm not
sure exactly where.

thanks,
jm.

-- 
View this message in context: http://www.nabble.com/T5-how-to-get-form-fields-tf4486155.html#a12793122
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


RE: T5 how to get form fields

Posted by Kristian Marinkovic <kr...@porsche.co.at>.
have you looked at the Request class methods... 
it also provides a getParameterNames() method
that you could filter

or you could generate a hidden field that contains
the number of dynamically added fields which gets
sent to the server as well

g,
kris





Janko Muzykant <um...@gmail.com> 
20.09.2007 11:12
Bitte antworten an
"Tapestry users" <us...@tapestry.apache.org>


An
users@tapestry.apache.org
Kopie

Thema
RE: T5 how to get form fields







thanks kris,
unfortunately it solves my problem partly. having my form submitted 
actually
i'm not able to query for each  field separately because i don't know how
many fields were inserted . let's assume that each added field has it's 
name
in a form: 'name_x' where x=0,1,2... in such a case i would need rather to
iterate through array of fields rather than doing
req.getParameter('name_0'), req.getParameter('name_1') and so on...

jm.



kristian.marinkovic wrote:
> 
> hi janko,
> 
> just inject the request object into your page and 
> read the values manually:
> 
> @Inject
> Request req;
> 
> ....
> req.getParameter("formfield");
> ...
> 
> g,
> kris
> 
> 
> 
> 
> Janko Muzykant <um...@gmail.com> 
> 20.09.2007 10:41
> Bitte antworten an
> "Tapestry users" <us...@tapestry.apache.org>
> 
> 
> An
> users@tapestry.apache.org
> Kopie
> 
> Thema
> T5 how to get form fields
> 
> 
> 
> 
> 
> 
> 
> hi, my form is generated in a runtime, i.e. fields are added/removed by
> javascript. is there any way to get list (map) of form fields in a 
submit
> handler? i guess they should be stored somewhere in a request but i'm 
not
> sure exactly where.
> 
> thanks,
> jm.
> 
> -- 
> View this message in context: 
> http://www.nabble.com/T5-how-to-get-form-fields-tf4486155.html#a12793122
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5-how-to-get-form-fields-tf4486155.html#a12793548
Sent from the Tapestry - User mailing list archive at Nabble.com.


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



RE: T5 how to get form fields

Posted by Janko Muzykant <um...@gmail.com>.
thanks kris,
unfortunately it solves my problem partly. having my form submitted actually
i'm not able to query for each  field separately because i don't know how
many fields were inserted . let's assume that each added field has it's name
in a form: 'name_x' where x=0,1,2... in such a case i would need rather to
iterate through array of fields rather than doing
req.getParameter('name_0'), req.getParameter('name_1') and so on...

jm.



kristian.marinkovic wrote:
> 
> hi janko,
> 
> just inject the request object into your page and 
> read the values manually:
> 
> @Inject
> Request req;
> 
> ....
> req.getParameter("formfield");
> ...
> 
> g,
> kris
> 
> 
> 
> 
> Janko Muzykant <um...@gmail.com> 
> 20.09.2007 10:41
> Bitte antworten an
> "Tapestry users" <us...@tapestry.apache.org>
> 
> 
> An
> users@tapestry.apache.org
> Kopie
> 
> Thema
> T5 how to get form fields
> 
> 
> 
> 
> 
> 
> 
> hi, my form is generated in a runtime, i.e. fields are added/removed by
> javascript. is there any way to get list (map) of form fields in a submit
> handler? i guess they should be stored somewhere in a request but i'm not
> sure exactly where.
> 
> thanks,
> jm.
> 
> -- 
> View this message in context: 
> http://www.nabble.com/T5-how-to-get-form-fields-tf4486155.html#a12793122
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/T5-how-to-get-form-fields-tf4486155.html#a12793548
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


RE: T5 how to get form fields

Posted by Kristian Marinkovic <kr...@porsche.co.at>.
hi janko,

just inject the request object into your page and 
read the values manually:

@Inject
Request req;

....
req.getParameter("formfield");
...

g,
kris




Janko Muzykant <um...@gmail.com> 
20.09.2007 10:41
Bitte antworten an
"Tapestry users" <us...@tapestry.apache.org>


An
users@tapestry.apache.org
Kopie

Thema
T5 how to get form fields







hi, my form is generated in a runtime, i.e. fields are added/removed by
javascript. is there any way to get list (map) of form fields in a submit
handler? i guess they should be stored somewhere in a request but i'm not
sure exactly where.

thanks,
jm.

-- 
View this message in context: 
http://www.nabble.com/T5-how-to-get-form-fields-tf4486155.html#a12793122
Sent from the Tapestry - User mailing list archive at Nabble.com.


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