Also, attach the formcomponentupdate behavior to the field that needs
to be updated, not to a button.

Martijn

On 4/28/07, wicket0123 <[EMAIL PROTECTED]> wrote:
>
> I want to use ajax to check if a field value is valid w/o submitting the
> entire form.  I add AjaxFormComponentUpdatingBehavior to my ajax object
> (link/button/etc).  But, I don't know how to retrieve the edit field's value
> inside the onUpdate method.  See the code I have:
>
>                 fc = new RequiredTextField("userName");
>                 fc.setLabel(new Model("User Name"));
>                 add(fc);
>
>                 fc = new Button("checkId");
>                 fc.add(new AjaxFormComponentUpdatingBehavior("onClick") {
>                         protected void onUpdate(AjaxRequestTarget target) {
>
>                                 System.out.println("This gets called");
>
>                                 // TODO: how to get the userName field's 
> value?
>
>
>                         }
>                 });
>
>                 add(fc);
> --
> View this message in context: 
> http://www.nabble.com/how-to-get-a-form%27s-field-when-i-click-on-an-ajax-object-tf3660473.html#a10228341
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-- 
Learn Wicket at ApacheCon Europe: http://apachecon.com
Join the wicket community at irc.freenode.net: ##wicket
Wicket 1.2.6 contains a very important fix. Download Wicket now!
http://wicketframework.org

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to