Hi Ryan.
In your case, yes, though I don't think there's a way to differentiate
which of multiple PropertySelections was responsible for a submit.
(Someone please shout out if there is.)
You need some kind of target - for various reasons I prefer a string:
<property-specification name="submitTarget" type="java.lang.String"/>
For your submits do something like this:
<component id="saveSubmit" type="Submit">
<binding name="selected" expression="submitTarget"/>
<binding name="tag" expression="@[EMAIL PROTECTED]"/>
</component>
Tapestry assigns the tag to the target before invoking the
form's listener, and that's where you check for the tags:
public void submitForm(IRequestCycle cycle)
{
// handle the submit action
process:
{
// get the form action
String submitTarget = getSubmitTarget();
if (submitTarget == null)
{
// javascript based form submit (eg PropertySelection)
}
else if (submitTarget.startsWith(saveFormAction))
{
// perform save ...
Notice that the submitTarget is null if not assigned, so in
that case you'll perform your PropertySelection handling.
There's currently a thread about Tapestry 4 not cleaning up
transient properties (to null) so watch out for that.
HTH,
Nick.
Ryan Wynn wrote:
but my preference is to use the tag and selected parameters to
differentiate
submits and handle everything in the one (form) listener.
Is there an easy way to tell which form component caused the submit. I
have 3 possibilities, 2 submit components and 1 propertyselection
component.
Thanks,
Ryan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]