You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Josh Long <st...@gmail.com> on 2009/06/01 12:10:17 UTC

div ajax update based on form field events (blur or onkeydown or something..)

Hello,

Im doing my best to get back into Tapestry a bit, but Ive got some
questions.. How would I acheive something that renders a div based on
whether a fields value is invalid. My use case:

a form for registering. You enter first name, last name, email, and
password. The email has to be unique and i want to - as theyre typing
or perhaps on blur - call the server and check the value entered
against registered emails to determine if its alraedy in the system.
If it is, id like to render a red message next to the text box and a
green one if it's not in the system.

I have a faint idea of the pieces I'd need for this, but frankly I
could use some help thinking through my approach:
-- in the java code generate some sort of link (EventLink? FormLink?)
that knows how to create the event (where my dupe checking will be
called ) and use addScript to pass it, along with the text fields id
to the client
-- on the client, i use ajax to hit that url and update the div i want
and render the zone... or block? which is best?

How do i make sure that the method that gets called 'sees' the updated
domain object thats bound to the form? Do I submit the form? I don't
want to invoke validation, though, just to check on the value of one
particular text field and guide the user and she is entering.

What's the "tapestry"-esque way of doing this?

Thanks in advance for the feedback and help,
Joshua Long
http://www.joshlong.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: div ajax update based on form field events (blur or onkeydown or something..)

Posted by Inge Solvoll <in...@gmail.com>.
Here's an example from my blog that might be useful.

http://tinybits.blogspot.com/2009/05/update-zone-on-any-client-side-event.html



On Mon, Jun 1, 2009 at 12:10 PM, Josh Long <st...@gmail.com> wrote:

> Hello,
>
> Im doing my best to get back into Tapestry a bit, but Ive got some
> questions.. How would I acheive something that renders a div based on
> whether a fields value is invalid. My use case:
>
> a form for registering. You enter first name, last name, email, and
> password. The email has to be unique and i want to - as theyre typing
> or perhaps on blur - call the server and check the value entered
> against registered emails to determine if its alraedy in the system.
> If it is, id like to render a red message next to the text box and a
> green one if it's not in the system.
>
> I have a faint idea of the pieces I'd need for this, but frankly I
> could use some help thinking through my approach:
> -- in the java code generate some sort of link (EventLink? FormLink?)
> that knows how to create the event (where my dupe checking will be
> called ) and use addScript to pass it, along with the text fields id
> to the client
> -- on the client, i use ajax to hit that url and update the div i want
> and render the zone... or block? which is best?
>
> How do i make sure that the method that gets called 'sees' the updated
> domain object thats bound to the form? Do I submit the form? I don't
> want to invoke validation, though, just to check on the value of one
> particular text field and guide the user and she is entering.
>
> What's the "tapestry"-esque way of doing this?
>
> Thanks in advance for the feedback and help,
> Joshua Long
> http://www.joshlong.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>