diff --git a/dbPort/src/org/compiere/model/GridFieldVO.java b/dbPort/src/org/compiere/model/GridFieldVO.java index 36e8501dcf..6944b08382 100644 --- a/dbPort/src/org/compiere/model/GridFieldVO.java +++ b/dbPort/src/org/compiere/model/GridFieldVO.java @@ -432,7 +432,7 @@ public class GridFieldVO implements Serializable // Create Lookup, if not ID - if (DisplayType.isLookup(displayType)) + if (DisplayType.isLookup(displayType) && IsDisplayed) { try { diff --git a/dbPort/src/org/compiere/model/GridTabVO.java b/dbPort/src/org/compiere/model/GridTabVO.java index 20845be7ea..cb385e869b 100644 --- a/dbPort/src/org/compiere/model/GridTabVO.java +++ b/dbPort/src/org/compiere/model/GridTabVO.java @@ -64,6 +64,7 @@ public class GridTabVO implements Evaluatee, Serializable { vo.Fields = new ArrayList(); // dummy } + /* else { createFields (vo); @@ -72,7 +73,7 @@ public class GridTabVO implements Evaluatee, Serializable CLogger.get().log(Level.SEVERE, "No Fields"); return null; } - } + }*/ return vo; } // create @@ -270,6 +271,9 @@ public class GridTabVO implements Evaluatee, Serializable CLogger.get().log(Level.SEVERE, "", e); return false; } + + mTabVO.initFields = true; + return mTabVO.Fields.size() != 0; } // createFields @@ -380,8 +384,15 @@ public class GridTabVO implements Evaluatee, Serializable public int onlyCurrentDays = 0; /** Fields contain MFieldVO entities */ - public ArrayList Fields = null; + private ArrayList Fields = null; + private boolean initFields = false; + + public ArrayList getFields() + { + if (!initFields) createFields(this); + return Fields; + } /** * Set Context including contained elements @@ -390,10 +401,13 @@ public class GridTabVO implements Evaluatee, Serializable public void setCtx (Properties newCtx) { ctx = newCtx; - for (int i = 0; i < Fields.size() ; i++) + if (Fields != null) { - GridFieldVO field = (GridFieldVO)Fields.get(i); - field.setCtx(newCtx); + for (int i = 0; i < Fields.size() ; i++) + { + GridFieldVO field = (GridFieldVO)Fields.get(i); + field.setCtx(newCtx); + } } } // setCtx