On Mon, 2006-01-23 at 10:34 +0000, Kent Tong wrote:
> Stijn Christiaens <stichris <at> vub.ac.be> writes:
> 
> > I have the following problem. I have a page which contains a Form and some 
> > RadioButtons and If components. The page represents one question in a 
> > multiple 
> > choice system (hence the form with the radiobuttons).
> 
> Store the question id into a client persistent property or a hidden
> field. Make sure you use that id to determine the # of RadioButtons
> (eg, use a For component to iterate over the answers for the question 
> with that id).

Thanks Mr. Tong (or Kent). 
I tried that approach already, but the problem remains. The problem is
that there are other components inside the Form component as well (eg.
an If component to determine if there is an image attached to the
question/answer). The html that Tapestry then generates contains
references to those component as well, something like:

        <form ...>
                <input type="hidden" values="If_1, If_2, If_3, Hidden">
        </form>
It are these hidden values (references to the If component object
references I presume) that cause the problem, as when Tapestry handles
the submit, it first checks the Form object it currently has by also
checking if all the contained components match.
By pushing the back button, something like
        <form ...>
                <input type="hidden" values=If_1, If_2, Hidden>
        </form
would be sent to Tapestry, which tries to match this with the Form
object it currently has (which is the one that matches with the html
page before pushing the back button). Tapestry throws an Exception at
that point (see the original mail). 
I think that Tapestry just does not store enough information in the html
form part to completely rebuild the Form object it should have (maybe
this is not even possible). 

I also experimented with Wicket (because of this kind of problem) and it
solves that by keeping different versions and passing the version number
in the url (so you would have something like ...version=1 in your url)
and pushing the back button brings you back to the form (which contains
the url ...version=0). I have not tried it with the exact same case
(only the example applications).

Maybe I am still doing something wrong, but I don't know how to solve
it.

Thanks and ciao,

Stijn

Ps. I already read your book as an introduction to Tapestry. In my
humble opinion the layout wasn't all that flashy, but the content, and
the clarity of the explanations, the step-by-step approach make this one
of the best learning books I've come across. Thanks for writing it. And
to all the others: it's worth the buy.

> 
> --
> Author of a book for learning Tapestry (www.agileskills2.org/EWDT)
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to