Hey Andy,

I've seen this work so I'm guessing there is something else going on
in the page or it's probably a browser compatibility problem.

What browser are you using? Do you see the same thing in other browsers?
Are you getting a javascript error when the page loads or you post the form?

Have you tried setting a breakpoint in the linkZone function or the
handler to see if they are getting called?

I once named an input field in a form "tagName", which you clearly
aren't doing here, but I spent an hour or two trying to figure out why
my form was reloading the whole page instead of just doing the async
call... I eventually found that tagName is reserved, and used during
linkZone to determine if the element was a form. If you happened to
have something else in the page with the id "resort" then you could be
having a similar problem.

Josh

On Thu, May 22, 2008 at 3:33 AM, Blower, Andy
<[EMAIL PROTECTED]> wrote:
> Thanks for the reply Filip. I have bound the zone parameter on the form like 
> this:
>
>        <form t:type="form" t:id="resort" t:zone="lor">
>                <t:label for="sortType"/>:
>                <select t:type="select" t:id="sortType" t:validate="required"/>
>                <br/>
>                <input type="submit" t:type="submit" t:id="resortButton" 
> value="Resort"/>
>        </form>
>
>        <t:actionLink t:zone="lor" t:context="literal:oldestFirst">oldest 
> first</t:actionLink>
>
> The action link works in an Ajax way, but the form submit doesn't. The even 
> handlers are:
>
>        Object onSubmit() {
>                results.resort(sortType.name());        // sortType is the 
> enum bound to the select box.
>                return lor;
>        }
>
>        Object onAction(String st) {
>                results.resort(st);
>                return lor;
>        }
>
> The form submit does the resort, but refreshes the entire page. I just can't 
> figure this out.
>
>> -----Original Message-----
>> From: Filip S. Adamsen [mailto:[EMAIL PROTECTED]
>> Sent: 22 May 2008 10:52
>> To: Tapestry users
>> Subject: Re: Updating a zone as a result of a form submission
>>
>> Hi Andy,
>>
>> Form has a zone parameter, if you bind it the zone will be updated when
>> the form has been submitted.
>>
>> Just make sure to check Request#isXHR to see if it's actually an
>> Ajaz-request before you return a block/component or Tapestry will bark.
>> The solution, then, is to just do a normal return like you would from a
>> non-Ajax event handler.
>>
>> http://tapestry.apache.org/tapestry5/tapestry-
>> core/ref/org/apache/tapestry/corelib/components/Form.html
>> has the lowdown on events emitted by Form, it's at the bottom of the
>> page.
>>
>> -Filip
>>
>> Blower, Andy skrev:
>> > Is it possible to update a zone as a result of a form submission,
>> rather than having the entire page refresh?
>> >
>> > I have a form with a select box and submit button to change the
>> sorting of a list of search results, and when I return a zone from the
>> event handler method onSubmit() the entire page is refreshed rather
>> than just the zone. The zone updates correctly from other actionlinks
>> on the page and their onAction() event handler. Is the answer to get
>> the form to fire action events somehow?
>> >
>> > I admit that I'm still a little confused still by events, is there a
>> complete list of the event types and their uses/behaviour somewhere
>> that I've missed?
>> >
>> > ---------------------------------------------------------------------
>> > 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]
>
>



-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

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

Reply via email to