Re: AjaxFormComponentUpdatingBehavior broken after invalid submit

2011-10-28 Thread Martin Grigorov
On Fri, Oct 28, 2011 at 7:22 AM, Hans Lesmeister 2
hans.lesmeis...@lessy-software.de wrote:
 Hi,

 did you already try a call to form.modelChanged() in onUpdate?

form.modelChanging() is even more important because it marks the page
as dirty and thus saves the new state of it at the end of the request


 -
 --
 Regards,
 Hans

 http://cantaa.de

 --
 View this message in context: 
 http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-broken-after-invalid-submit-tp3945964p3946955.html
 Sent from the Users forum mailing list archive at Nabble.com.

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





-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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



Re: AjaxFormComponentUpdatingBehavior broken after invalid submit

2011-10-28 Thread Russell Pitre
Great!  That's exactly what I needed.  Thanks.

-Russ

On Fri, Oct 28, 2011 at 2:56 AM, Martin Grigorov mgrigo...@apache.orgwrote:

 On Fri, Oct 28, 2011 at 7:22 AM, Hans Lesmeister 2
 hans.lesmeis...@lessy-software.de wrote:
  Hi,
 
  did you already try a call to form.modelChanged() in onUpdate?

 form.modelChanging() is even more important because it marks the page
 as dirty and thus saves the new state of it at the end of the request

 
  -
  --
  Regards,
  Hans
 
  http://cantaa.de
 
  --
  View this message in context:
 http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-broken-after-invalid-submit-tp3945964p3946955.html
  Sent from the Users forum mailing list archive at Nabble.com.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
  For additional commands, e-mail: users-h...@wicket.apache.org
 
 



 --
 Martin Grigorov
 jWeekend
 Training, Consulting, Development
 http://jWeekend.com

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




AjaxFormComponentUpdatingBehavior broken after invalid submit

2011-10-27 Thread Russell Pitre
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));
}


Re: AjaxFormComponentUpdatingBehavior broken after invalid submit

2011-10-27 Thread Hans Lesmeister 2
Hi, 

did you already try a call to form.modelChanged() in onUpdate?

-
-- 
Regards, 
Hans 

http://cantaa.de 

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxFormComponentUpdatingBehavior-broken-after-invalid-submit-tp3945964p3946955.html
Sent from the Users forum mailing list archive at Nabble.com.

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