wood burning stoves 2.0*
The moose likes Other Application Frameworks and the fly likes Wicket: form issue - modelObject does not get updated Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Wicket: form issue - modelObject does not get updated" Watch "Wicket: form issue - modelObject does not get updated" New topic
Author

Wicket: form issue - modelObject does not get updated

Tiya Khambadkone
Ranch Hand

Joined: Sep 15, 2011
Posts: 52
I have a page with 2 textfields (with validation as mandatory textfields). Both the text fields have their own save button for some reason.
Steps to reproduce my error :
1. Delete all the pre-populated data of textfield #1. Click Save #1.
[ Validation fails. Error message is received. As expected.]
2. Use Cancel button and reder to the previous page.
3. Use Edit button and again render to the original page with 2 textfields.
4. Delete the data from textfield #2.
5. Hit save #2.
6. Save is successful whereas expected is like before validation should fail.

I tried debugging. It seems that the modelobject contains the same old data before my textfield #2 data deletion.

Why ?



After trying to save textfield #2 : page.getModelObject still contains old value of textfield #2 and not the new

Whereas after trying to save textfield # 1 :
FEConfigEntry entry contains new model.

Why?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Wicket: form issue - modelObject does not get updated
 
Similar Threads
Validate at least one checkbox in a Modal Window.
Cursor object not returning data properly.
Pass variables in INSERT statement
layout problems
layout problems