Example #1
0
 /**
  * Create new Row with Default values. The new Row is not saved in Results
  *
  * @param windowNo relative window
  * @param AD_Tab_ID tab
  * @param context record context for parent columns and other variables
  * @return array of field values or null if error. You get the columnNames via String[] columns =
  *     uiTab.getColumnNames();
  */
 public ChangeVO newRow(int windowNo, int AD_Tab_ID, Map<String, String> context) {
   UITab tab = getTab(AD_Tab_ID);
   if (tab == null) {
     log.config("Not found AD_Tab_ID=" + AD_Tab_ID);
     return null;
   }
   CContext ctx = new CContext(m_context.entrySet());
   ctx.addWindow(windowNo, context);
   ctx.setIsSOTrx(windowNo, tab.isSOTrx());
   ChangeVO change = tab.newRow(ctx, windowNo);
   /**
    * Very likely not needed if (change.changedDropDowns == null) change.changedDropDowns = new
    * HashMap<String,ArrayList<NamePair>>(); for(UIField f:tab.getFields()) { if
    * (f.isDependentValue()) change.changedDropDowns.put(f.getColumnName(),
    * getLookupValues(windowNo, f.getAD_Field_ID(), change.changedFields)); }
    */
   tab.canUpdate(ctx, windowNo, change);
   return change;
 } // newRow