You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jeremy <jk...@jkassis.com> on 2005/10/13 05:31:44 UTC
Comments? tacos:AjaxForm Rewrite Plans
I have an AjaxForm that presents a single text field and no submit button.
When I type into the text box and hit *return* to submit, the browser
submits through the standard DirectService, not the AjaxDirectService.
That's because the action attribute of the <form> element has a url for the
DirectService, not the AjaxDirectService.
To fix this, the tacos AjaxForm needs to override the Form.getLink() method
and return an AjaxDirectLink. Was working on a patch 2 this. But the
Form.getLink() method is private, so I can't override. Tracing backward, I'd
have to override the Form.renderComponent method, which prolly means I'll
have to just reimplement the whole class without extending the Form object.
Seems like a lot of the Tapestry code is very difficult to extend. Some say
this is good design practice, but seems like kindof a pain to me.
Anyway, would be willing to give this a shot since I need this
functionality. But would like this to go into the release.
If I do, I'd like to eliminate the AjaxForm.isDirect parameter and add an
AjaxForm.isAjax parameter which defaults to true. If isAjax is true, then
the form uses the service injected into its ajaxService property. If false,
it uses the service injected into its altService. These would be the
AjaxDirectService and the DirectService, by default.
That way, I could produce a nifty Form that does this:
presents one field
processes the submit of the one field through ajax and then presents a
second field
processes the submit of the two fields through ajax and then presents yet
another field with the form configured to submit through the direct service
processes the submit of all three fields through the DirectService and
whisks me away to another page.
To be clear, the form would not support the action service. HLS has wanted
to take this out for a while anyway.
Comments?
Re: Comments? tacos:AjaxForm Rewrite Plans
Posted by Jesse Kuhnert <jk...@gmail.com>.
It could be that I broke something in a previous version of AjaxForm, but
the current working copy in cvs definitely behaves correctly when a user
hits enter.
The action part of the form hasn't been as important to me so far because
the form elements "onsubmit" event seems to be behaving the way I want it to
correctly thus far.
Perhaps I should make the "clientScriptingEnabled" parameter true by default
and disallow setting it as it doesn't make sense to not have scripting in an
ajax style form. ?
The scenerio you described wanting to create below has already been realised
(for the most part) in the tacos demo hosted at
http://tacos.mine.nu:8080/tacos-demo4/ as far as I know.
It's probably time for a new release anyways, I've just been low on time
lately and hesitant to release it until I had eliminated as many
dependencies on js libraries (other than dojo of course) as possible.
jesse
On 10/12/05, Jeremy <jk...@jkassis.com> wrote:
>
> I have an AjaxForm that presents a single text field and no submit button.
> When I type into the text box and hit *return* to submit, the browser
> submits through the standard DirectService, not the AjaxDirectService.
> That's because the action attribute of the <form> element has a url for
> the
> DirectService, not the AjaxDirectService.
>
>
>
> To fix this, the tacos AjaxForm needs to override the Form.getLink()
> method
> and return an AjaxDirectLink. Was working on a patch 2 this. But the
> Form.getLink() method is private, so I can't override. Tracing backward,
> I'd
> have to override the Form.renderComponent method, which prolly means I'll
> have to just reimplement the whole class without extending the Form
> object.
> Seems like a lot of the Tapestry code is very difficult to extend. Some
> say
> this is good design practice, but seems like kindof a pain to me.
>
>
>
> Anyway, would be willing to give this a shot since I need this
> functionality. But would like this to go into the release.
>
>
>
> If I do, I'd like to eliminate the AjaxForm.isDirect parameter and add an
> AjaxForm.isAjax parameter which defaults to true. If isAjax is true, then
> the form uses the service injected into its ajaxService property. If
> false,
> it uses the service injected into its altService. These would be the
> AjaxDirectService and the DirectService, by default.
>
>
>
> That way, I could produce a nifty Form that does this:
>
>
>
> presents one field
>
> processes the submit of the one field through ajax and then presents a
> second field
>
> processes the submit of the two fields through ajax and then presents yet
> another field with the form configured to submit through the direct
> service
>
> processes the submit of all three fields through the DirectService and
> whisks me away to another page.
>
>
>
> To be clear, the form would not support the action service. HLS has wanted
> to take this out for a while anyway.
>
>
>
> Comments?
>
>
>
>
>
>
>
>
Re: Comments? tacos:AjaxForm Rewrite Plans
Posted by Jesse Kuhnert <jk...@gmail.com>.
It could be that I broke something in a previous version of AjaxForm, but
the current working copy in cvs definitely behaves correctly when a user
hits enter.
The action part of the form hasn't been as important to me so far because
the form elements "onsubmit" event seems to be behaving the way I want it to
correctly thus far.
Perhaps I should make the "clientScriptingEnabled" parameter true by default
and disallow setting it as it doesn't make sense to not have scripting in an
ajax style form. ?
The scenerio you described wanting to create below has already been realised
(for the most part) in the tacos demo hosted at
http://tacos.mine.nu:8080/tacos-demo4/ as far as I know.
It's probably time for a new release anyways, I've just been low on time
lately and hesitant to release it until I had eliminated as many
dependencies on js libraries (other than dojo of course) as possible.
jesse
On 10/12/05, Jeremy <jk...@jkassis.com> wrote:
>
> I have an AjaxForm that presents a single text field and no submit button.
> When I type into the text box and hit *return* to submit, the browser
> submits through the standard DirectService, not the AjaxDirectService.
> That's because the action attribute of the <form> element has a url for
> the
> DirectService, not the AjaxDirectService.
>
>
>
> To fix this, the tacos AjaxForm needs to override the Form.getLink()
> method
> and return an AjaxDirectLink. Was working on a patch 2 this. But the
> Form.getLink() method is private, so I can't override. Tracing backward,
> I'd
> have to override the Form.renderComponent method, which prolly means I'll
> have to just reimplement the whole class without extending the Form
> object.
> Seems like a lot of the Tapestry code is very difficult to extend. Some
> say
> this is good design practice, but seems like kindof a pain to me.
>
>
>
> Anyway, would be willing to give this a shot since I need this
> functionality. But would like this to go into the release.
>
>
>
> If I do, I'd like to eliminate the AjaxForm.isDirect parameter and add an
> AjaxForm.isAjax parameter which defaults to true. If isAjax is true, then
> the form uses the service injected into its ajaxService property. If
> false,
> it uses the service injected into its altService. These would be the
> AjaxDirectService and the DirectService, by default.
>
>
>
> That way, I could produce a nifty Form that does this:
>
>
>
> presents one field
>
> processes the submit of the one field through ajax and then presents a
> second field
>
> processes the submit of the two fields through ajax and then presents yet
> another field with the form configured to submit through the direct
> service
>
> processes the submit of all three fields through the DirectService and
> whisks me away to another page.
>
>
>
> To be clear, the form would not support the action service. HLS has wanted
> to take this out for a while anyway.
>
>
>
> Comments?
>
>
>
>
>
>
>
>