You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by MaxLambrecht <ma...@gmail.com> on 2010/10/18 22:57:05 UTC

Can AjaxFormComponentUpdatingBehavior handle more than only one field in the form?

I have a form with some fields, one of them has an ajax request associated to
the onblur event.

See the following code:
 
AjaxFormComponentUpdatingBehavior zipcodeOnBlur = new
AjaxFormComponentUpdatingBehavior("onblur") {
            private static final long serialVersionUID = 1L;

            @Override
            protected void onUpdate(AjaxRequestTarget target) {
                System.out.println("Zipcode value: " +
getFormComponent().getModelObject());
                System.out.print("FormModel: " +
getFormComponent().getForm().getModelObject());
            }
        };
propertyAddress.setZipcode( null );
TextField<String> zipCodeField = new TextField<String>(
"propertyAddress.zipcode" );
zipCodeField.setMarkupId( "zip_code" ).setOutputMarkupId( true );
zipCodeField.add(zipcodeOnBlur);
add(zipCodeField);

I need some values in the form to be submitted and accessible in the
onUpdate method.

Which is the best way to get that working?
-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Can-AjaxFormComponentUpdatingBehavior-handle-more-than-only-one-field-in-the-form-tp3001079p3001079.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Can AjaxFormComponentUpdatingBehavior handle more than only one field in the form?

Posted by Jeremy Thomerson <je...@wickettraining.com>.
AjaxFormSubmitBehavior

On Mon, Oct 18, 2010 at 3:57 PM, MaxLambrecht <ma...@gmail.com>wrote:

>
> I have a form with some fields, one of them has an ajax request associated
> to
> the onblur event.
>
> See the following code:
>
> AjaxFormComponentUpdatingBehavior zipcodeOnBlur = new
> AjaxFormComponentUpdatingBehavior("onblur") {
>            private static final long serialVersionUID = 1L;
>
>            @Override
>            protected void onUpdate(AjaxRequestTarget target) {
>                System.out.println("Zipcode value: " +
> getFormComponent().getModelObject());
>                System.out.print("FormModel: " +
> getFormComponent().getForm().getModelObject());
>            }
>        };
> propertyAddress.setZipcode( null );
> TextField<String> zipCodeField = new TextField<String>(
> "propertyAddress.zipcode" );
> zipCodeField.setMarkupId( "zip_code" ).setOutputMarkupId( true );
> zipCodeField.add(zipcodeOnBlur);
> add(zipCodeField);
>
> I need some values in the form to be submitted and accessible in the
> onUpdate method.
>
> Which is the best way to get that working?
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Can-AjaxFormComponentUpdatingBehavior-handle-more-than-only-one-field-in-the-form-tp3001079p3001079.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>


-- 
Jeremy Thomerson
http://wickettraining.com
*Need a CMS for Wicket?  Use Brix! http://brixcms.org*