In the same context: is it possible to remove "final" from
org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior.getEventHandler()

I need to tweak the callback url.

On Tue, 2010-04-20 at 15:25 -0700, Igor Vaynberg wrote:
> user AjaxFormComponentUpdatingBehavior
> 
> -igor
> 
> On Tue, Apr 20, 2010 at 2:37 PM, Steven Haines <lyg...@yahoo.com> wrote:
> > Hi,
> >
> > I have a form component to which I added an OnChangeAjaxBehavior derivative 
> > and in its onUpdate() method I want to access the contents of it *and* 
> > another form field.
> >
> > Here's what I'm doing:
> >
> >        form.add( new TextField<String>( "street1" ).setRequired( true ) );
> >        final TextField<String> zipcodeField = new TextField<String>( 
> > "zipcode" );
> >        zipcodeField.setOutputMarkupId( true );
> >        zipcodeField.setMarkupId( "zip" );
> >        form.add( zipcodeField.setRequired( true ) );
> >
> >        // Load cities when the zipcode is updated
> >        zipcodeField.add( new OnChangeAjaxBehavior()
> >        {
> >            private static final long serialVersionUID = 1L;
> >
> >            @Override
> >            protected void onUpdate( AjaxRequestTarget target )
> >            {
> >                //TextField<String> street1 = ( TextField<String> )form.get( 
> > "street1" );
> >                //System.out.println( "Street 1: " + street1.getValue() );
> >                System.out.println( "Zipcode value (form component): " + 
> > getFormComponent().getModelObject() );
> >                // Do something with street1 and the zipcode....
> >            }
> >        } );
> >
> > The problem is that, although I've tried different techniques to obtain the 
> > value of the street1 text field, it is always returning null. I've tried 
> > creating street1 as a final text field and then calling its getValue() 
> > method, I've tried getting it from the form, as above, and I've tried 
> > reading from the underlying form model, all of which return null.
> >
> > Any suggestions?
> >
> > Thanks
> > Steve
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 



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

Reply via email to