You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by SWC <ma...@crissman.net> on 2003/08/05 19:42:11 UTC
Handling Dynamically Sized Forms
I'm just learning Tapestry, and am approaching the point of
understanding it. I've put together a couple small "web-apps" to test
out the functionality, and have been successful in with those. I have
used JSP's in the past, and one of the features I love about tapestry
is the automatic handling of form variables getting put into the page
member variables. This is exceleent, and saves me alot of time with
drudge work.
Now, I have been able to get the automatic assigning to work when I
know the variables I will be collecting from the form at design time,
and have a 1 to 1 mapping to the page class member variables. I still
do not understand how (or if) it is possible to automatically handle
forms with a number of inputs which will not be determined until run
time. For instance, if I have a questionaire that creates a number of
questions based upon what it finds in the database, and the user fills
out that questionaire and submits it, and I wish to somehow have the
answers they have submitted be collected into an array, or in some
other way accessible. When this was in JSPs, I just had each answer's
input named after the question_id, and then retrieved the input for
each question when the form was submitted. This was a hassle, but I'm
not sure how to handle this at all in tapestry. Correction, I could do
it the exact same way, but I see no more elegant solution. Am I
missing anything?
To be clear, I understand I can use for each to create the form at run
time, but it is the method of handling the form's variables after
submission which I am unclear on. Is there any way to automate that.
I am attempting to learn the 3.0b2 framework, in case that matters.
Thanks for any help in advance.
Spencer