Example #1
0
 public ChangeVO updateRow(
     int windowNo,
     int AD_Tab_ID,
     int queryResultID,
     int relRowNo,
     Map<String, String> context,
     boolean force) {
   if (context == null || context.size() == 0)
     return new ChangeVO(true, Msg.translate(m_context, "NoContext"));
   ArrayList<String[]> data = m_results.get(queryResultID);
   if (data == null || data.size() == 0)
     return new ChangeVO(true, Msg.translate(m_context, "CachedDataNotFound"));
   UITab tab = getTab(AD_Tab_ID);
   if (tab == null) {
     log.config("Not found AD_Tab_ID=" + AD_Tab_ID);
     return new ChangeVO(true, Msg.translate(m_context, "@NotFound@ @AD_Tab_ID@=" + AD_Tab_ID));
   }
   CContext ctx = new CContext(m_context.entrySet());
   ctx.addWindow(windowNo, context);
   ChangeVO retValue;
   if (force) retValue = tab.saveRow(ctx, windowNo, false, null);
   else retValue = tab.saveRow(ctx, windowNo, false, data.get(relRowNo));
   if (retValue.hasError()) return retValue;
   // Update Results
   String[] dataRow = retValue.rowData.clone();
   data.set(relRowNo, dataRow);
   postProcessChangeVO(retValue, windowNo, context, dataRow, tab);
   retValue.trxInfo = GridTab.getTrxInfo(tab.getTableName(), ctx, windowNo, tab.getTabNo());
   if (retValue.isRefreshAll()) {}
   return retValue;
 }