This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes In MyFaces 1.2, UPDATE_MODEL_VALUES phase set object model to default value even though it is null 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 » Java » JSF
Bookmark "In MyFaces 1.2, UPDATE_MODEL_VALUES phase set object model to default value even though it is null" Watch "In MyFaces 1.2, UPDATE_MODEL_VALUES phase set object model to default value even though it is null" New topic
Author

In MyFaces 1.2, UPDATE_MODEL_VALUES phase set object model to default value even though it is null

Sajan Patel
Ranch Hand

Joined: Oct 25, 2004
Posts: 77
In my application, I have myFaces 1.2.

In object model I have BigDecimal field and it is populated with Custom converter.

This custom converter return NULL from getAsObject and getAsString if value is null.
Now I can see this custom convert is returning NULL when I keep my Text Field empty but in UPDATE_MODEL_VALUES phase it is populated with default value.

Does this happen with every body ?
Note:- Same program set null value to object model if it is null returned from Custom Converter fine in my Faces 1.1

BEFORE PHASE : UPDATE_MODEL_VALUES(4)
Money : null
AFTER PHASE : UPDATE_MODEL_VALUES(4)
Money : 0
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: In MyFaces 1.2, UPDATE_MODEL_VALUES phase set object model to default value even though it is null
 
Similar Threads
Issues with facelets and saveState?
Action vs ActionListener in JSF/IceFaces
JSF clear fields on validation errors
Struts2 conversion/validation problem
JSF Phase:UPDATE_MODEL_VALUES