tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ron Piterman <rpiter...@gmx.net>
Subject For review
Date Wed, 02 Nov 2005 11:04:04 GMT
Taken from the user list
(title: Fundamental form submit problem?, author: Aslak Gronflaten)
Might be important...


I'm not sure if there is a technique to circumvent this problem,
but I feel tapestry handles this the wrong way.

If I have a page with a form with a default listener,
and two LinkSubmit components, each with its own listener.

When I click either of the links, a hidden field is sat on the form,
(called LinkSubmit  or LinkSubmit_0 respectively) with the value "T".
This indicates which of the links is clicked, and tapestry makes sure
the correct listener is called.

However, if these listeners cause proceeding to a new page,
then clicking Back in the browser gives problems.
The browser then remembers the value of those hidden fields,
causing the wrong listener to be called when submitting again.

In .net, for example, there is only one hidden variable, called event
source or something like that. Clicking link one sets that variable to
"one", thus overwriting whatever the browser remembers. Also, every
component that causes a submit has this behaviour. A dropdown that
causes a submitOnChange must also reset those variables, or we get the
wrong behaviour.

Try this example:
<form jwcid="@Form" listener="listener:one">
	<a jwcid="@LinkSubmit" listener="listener:two">Two</a><br/>
	<a jwcid="@LinkSubmit" listener="listener:three">Three</a><br/>
	<input jwcid="@Submit" label="literal:One"/><br/>

If each listener logs its name out, you'll see that clicking Three
prints "Three" then "One", as expected.
Click Back, then press One, and it'll still print "Three" then "One".
Not just One, as it should.

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-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org

View raw message