• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ModelDriven does not update model for property List that was emptied

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My JSP has a property i will call as 'itemList', which i allow to be emptied if user wants to remove items to it.
This property is set with initial values from what is stored in the database. So initially, itemList will have values [avocado,tomato].

THe JSP page allows add,update,or delete in itemList.



where optionList may or may have values in it.

Debugging using FireBug shows that the values are set correctly in the following instances:

Example:
a) when user has picked or updated values for itemList
itemList = [avocado,salmon]
b) when user has has removed all items
itemList = []

However when i debug the action class that receives the model, it does update the property when the condition is in example (a), but not when it's (b).
When it's (b), the itemList still stores the previous value of the itemList=[avocado,tomato].

Is this a behaviour of ModelDriven, or what am i missing?

Appreciate your help.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic