Revision history [back]

click to hide/show revision 1
initial version

answered 2014-09-03 14:54:46 +0800

terrytornado gravatar image terrytornado flag of Germany

http://www.oxitec.de/

Thanks Chill,

seems it's a problem in the FormImpl class. If a binded component have an intial value of NULL and we insert a few signs, jump to next field to evaluate the changes and than remove the inserted signs back than the state is dirty. the setField method evaluate the origin value 'NULL' is not '' (empty) and set the state to dirty.

public class FormImpl implements Form,FormExt,Serializable { ... public void setField(String field, Object value) { _fields.put(field, value); final Object init = _initFields.get(field); if (!Objects.equals(init, value)) { //different from original _dirtyFieldNames.add(field); } else { _dirtyFieldNames.remove(field); } }

Thanks Chill,

seems it's a problem in the FormImpl class. If a binded component have an intial value of NULL and we insert a few signs, jump to next field to evaluate the changes and than remove the inserted signs back than the state is dirty. the setField method evaluate the origin value 'NULL' is not '' (empty) and set the state to dirty.

public class FormImpl implements Form,FormExt,Serializable {
...
public void setField(String field, Object value) {
        _fields.put(field, value);
        final Object init = _initFields.get(field);
        if (!Objects.equals(init, value)) { //different from original
            _dirtyFieldNames.add(field);
        } else {
            _dirtyFieldNames.remove(field);
        }
    }

}

Thanks Chill,

seems it's a problem in the FormImpl class. If a binded component have an intial value of NULL and we insert a few signs, jump to next field to evaluate the changes and than remove the inserted signs back than the state is dirty. because the setField method evaluate the origin value 'NULL' is not '' (empty) and set (empty). That's right but not in our sense. In the state to dirty.UI it looks equal if a textbox value is NULL or empty.

public class FormImpl implements Form,FormExt,Serializable {
...
public void setField(String field, Object value) {
        _fields.put(field, value);
        final Object init = _initFields.get(field);
        if (!Objects.equals(init, value)) { //different from original
            _dirtyFieldNames.add(field);
        } else {
            _dirtyFieldNames.remove(field);
        }
    }
Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More