Wicket 1.5.1

I have a DropDownChoice with an
AjaxFormComponentUpdatingBehavior("onchange") behavior attached to it, when
a value is chosen in the dropdown the selected value is used to lookup data
via a service call and then update other textfields in the form.  This works
great until you use the dropdown after the form was submitted with
validation errors. The onUpdate event in
the AjaxFormComponentUpdatingBehavior is still called but the other form
textfields are NOT being updated on the screen. Any ideas why the model
isn't being updated? Or, maybe I am misunderstanding what's really
happening. Any Ideas what to try next?

Thanks


new AjaxFormComponentUpdatingBehavior("onchange") {

@Override
protected void onUpdate(final AjaxRequestTarget target) {
 String selectedValue = aiNumberSelection.getValue();
AgencyInterest agencyInterest;

if (!isEmpty(selectedValue) && NumberUtils.isDigits(selectedValue)) {
 agencyInterest =
agencyInterestService.findByAiNumber(new Long(selectedValue));

} else {
agencyInterest = new AgencyInterest();
}

eerBackingModel.setAgencyInterest(agencyInterest);
 form.setDefaultModelObject(eerBackingModel);

target.add(feedbackPanel);
target.add(form.get(CID_AI_NAME));
target.add(form.get(CID_AI_NUMBER));
target.add(form.get(CID_AI_OWNER));
target.add(form.get(CID_AI_IS_STATIONARY));
target.add(form.get(CID_AI_IS_PORTABLE));
target.add(form.get(CID_AI_UTM));
target.add(form.get(CID_AI_LAT));
target.add(form.get(CID_AI_LON));
target.add(form.get(CID_AI_TITLEV_PERMIT));
target.add(form.get(CID_AI_NSR_PERMIT));
}

Reply via email to