On 25/11/2012, at 12:37 PM, Lenny Primak wrote:
> Once again, Geoff, fantastic work on JumpStart!
Thanks Lenny.
> Not quite...
> In the first example, none of the action buttons care in which zone/form they
> are in, they just set the global action variable.
> You can readily see the problem if you try to pass a context in the select or
> cancel button, as it will be null.
Sorry, I don't understand the difference. The button event handlers don't need
to carry a context because the Form does it for them.
<form t:id="personForm" t:type="form" t:context="person.id" ...
When you click Edit, the first event handler invoked is this one:
void onPrepareForSubmitFromPersonForm(Long personId)
Now we know the context. Then this event handler is invoked:
void onSelectedFromEdit()
Now we know the action. We're ready to do anything. Then this is invoked:
void onValidateFromPersonForm()
Doesn't that match your situation?
> I actually switched to EventLinks, with buttons inside instead of forms,
> and it works with them, since the context is saved in the event URL,
> which matches closely with your second example.
>
> There is a design issue with the first approach. The only thing that the
> Ajax event handler knows
> is the URL of the request, which is just a page.form. The nitty gritty lies
> in the hidden formdata element,
> which is where everything is stored. I think the only way to solve this
> problem in my original fashion
> is to somehow plug into this mechanism to save/restore the context within the
> form.
>
> On Nov 24, 2012, at 7:53 PM, Geoff Callender wrote:
>
>> Is your problem different to these?
>>
>>
>> http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/formsinaloop
>>
>> http://jumpstart.doublenegative.com.au/jumpstart/examples/ajax/eventlinksinaloop
>>
>> Cheers,
>>
>> Geoff
>>
>> On 25/11/2012, at 7:20 AM, Lenny Primak wrote:
>>
>>> Just tried it, it does not.
>>> I think if the submit components themselves are in a loop, that would work,
>>> but the actual zone and form complex is in a loop itself.
>>>
>>> On Nov 24, 2012, at 3:14 PM, Dragan Sahpaski wrote:
>>>
>>>> Did you try defer="false" ?
>>>> http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/corelib/components/Submit.html
>>>>
>>>> Cheers,
>>>> Dragan Sahpaski
>>>>
>>>>
>>>>
>>>> On Sat, Nov 24, 2012 at 9:12 PM, Lenny Primak
>>>> <[email protected]>wrote:
>>>>
>>>>> I tried that way too, but the problem is I can't correlate the button
>>>>> events with the form submission event either.
>>>>> Thanks for your help though
>>>>>
>>>>> On Nov 24, 2012, at 3:09 PM, Dragan Sahpaski wrote:
>>>>>
>>>>>> Maybe use the form's context param to differentiate which form got
>>>>>> submitted, and handle onSubmit or onSuccess instead of the submit event?
>>>>>>
>>>>>> Cheers,
>>>>>> Dragan Sahpaski
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Sat, Nov 24, 2012 at 8:31 PM, Lenny Primak <[email protected]
>>>>>> wrote:
>>>>>>
>>>>>>> <t:loop source="...">
>>>>>>> <t:zone update="none">
>>>>>>> <form t:type="form" zone="^">
>>>>>>> <input t:type="submit" event="start" value="Start"/>
>>>>>>> </form>
>>>>>>> </t:zone>
>>>>>>> </t:loop>
>>>>>>>
>>>>>>> ... Java
>>>>>>>
>>>>>>> onStart()
>>>>>>> {
>>>>>>> // how do I know which one of the start buttons got pushed?
>>>>>>> // there are n possibilities since there are n loop iterations
>>>>>>> return zone.getBody();
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> Thanks for your help!
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> 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]
>>>>>
>>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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]
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>