[ adempiere-Bugs-1891037 ] Tab: if initially grid mode, then no data is displayed

This commit is contained in:
Heng Sin Low 2008-02-11 11:37:41 +00:00
parent 213ff5826a
commit 8340239975
2 changed files with 7 additions and 3 deletions

View File

@ -939,9 +939,9 @@ public class GridController extends CPanel
*/ */
if (comp instanceof VString){ if (comp instanceof VString){
VString vs = (VString)comp; VString vs = (VString)comp;
if ((vs.getVFormat() != null && mField.getVFormat() == null) if ((vs.getVFormat() != null && vs.getVFormat().length() > 0 && mField.getVFormat() == null)
|| (vs.getVFormat() == null && mField.getVFormat() != null) || (vs.getVFormat() == null && mField.getVFormat() != null && mField.getVFormat().length() > 0)
|| (vs.getVFormat() != null && !vs.getVFormat().equals(mField.getVFormat()))) { || (vs.getVFormat() != null && mField.getVFormat() != null && !vs.getVFormat().equals(mField.getVFormat()))) {
vs.setVFormat(mField.getVFormat()); vs.setVFormat(mField.getVFormat());
} }
} }

View File

@ -276,7 +276,11 @@ public final class VString extends CTextField
} catch(ClassCastException ex ){ } catch(ClassCastException ex ){
log.fine("VString.setVFormat - No caret Listeners"); log.fine("VString.setVFormat - No caret Listeners");
} }
//hengsin: [ adempiere-Bugs-1891037 ], preserve current data before change of format
String s = getText();
setDocument(new MDocString(m_VFormat, m_fieldLength, this)); setDocument(new MDocString(m_VFormat, m_fieldLength, this));
setText(s);
} // setVFormat } // setVFormat
/** /**