Thanks Matt
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084303#4084303
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084303
___
jboss-user mailing list
jboss-user@lists.jb
Haven't tried it, but found this while googling around (a more detailed version
of what Jason is suggesting):
http://jroller.com/stritti/entry/jsf_stringconverter_for_null_values
I'd recommend not trying to solve this in your domain model. Tedious and ugly.
View the original post :
http://ww
Try this
| public void setField(String field) {
| if(field == null) {
| this.field = null;
| } else {
| if("".equals(field.trim())) {
| this.field = field;
| } else {
| //you could trim before asignement too.
| this.field = field;
| }
How about using a converter that trims the field and if field.trim().equals("")
use null.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4084035#4084035
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4084035
I'm not certain this will work but please try and post results.
Inside your entity bean change the setter method for the field you want to be
null to something like this:
public void setField(String field)
| {
| if("".equals(field))
| {
| this.field = null;
| }
|