IDEMPIERE-454 Easy import - peer review

This commit is contained in:
Carlos Ruiz 2013-04-12 13:41:39 -05:00
parent 08d0c19de4
commit fb4bfb1e01
2 changed files with 10 additions and 22 deletions

View File

@ -1038,7 +1038,7 @@ public class GridTabCSVImporter implements IGridTabImporter
} }
} }
} }
gridTab.getTableModel().dataRequery(pquery.getWhereClause()); gridTab.getTableModel().dataRequery(pquery.getWhereClause(), false, 0, false);
if (isInsertMode()){ if (isInsertMode()){
if(gridTab.getTableModel().getRowCount()>=1) if(gridTab.getTableModel().getRowCount()>=1)
logMsg = Msg.getMsg(Env.getCtx(), "AlreadyExists")+" "+pquery; logMsg = Msg.getMsg(Env.getCtx(), "AlreadyExists")+" "+pquery;

View File

@ -100,7 +100,7 @@ public class GridTable extends AbstractTableModel
/** /**
* *
*/ */
private static final long serialVersionUID = 4727235099287761006L; private static final long serialVersionUID = 5782826500266625861L;
public static final String DATA_REFRESH_MESSAGE = "Refreshed"; public static final String DATA_REFRESH_MESSAGE = "Refreshed";
@ -2917,9 +2917,10 @@ public class GridTable extends AbstractTableModel
* @param whereClause sql where clause * @param whereClause sql where clause
* @param onlyCurrentRows only current rows * @param onlyCurrentRows only current rows
* @param onlyCurrentDays how many days back * @param onlyCurrentDays how many days back
* @param fireEvents if tabledatachanged and datastatusievent must be fired
* @return true if success * @return true if success
*/ */
public boolean dataRequery (String whereClause, boolean onlyCurrentRows, int onlyCurrentDays) public boolean dataRequery (String whereClause, boolean onlyCurrentRows, int onlyCurrentDays, boolean fireEvents)
{ {
if (log.isLoggable(Level.INFO)) log.info(whereClause + "; OnlyCurrent=" + onlyCurrentRows); if (log.isLoggable(Level.INFO)) log.info(whereClause + "; OnlyCurrent=" + onlyCurrentRows);
close(false); close(false);
@ -2931,29 +2932,16 @@ public class GridTable extends AbstractTableModel
m_changed = false; m_changed = false;
m_rowChanged = -1; m_rowChanged = -1;
m_inserting = false; m_inserting = false;
fireTableDataChanged(); if (fireEvents) {
fireDataStatusIEvent(DATA_REFRESH_MESSAGE, ""); fireTableDataChanged();
fireDataStatusIEvent(DATA_REFRESH_MESSAGE, "");
}
return true; return true;
} // dataRequery } // dataRequery
/** public boolean dataRequery (String whereClause, boolean onlyCurrentRows, int onlyCurrentDays)
* Requery with new whereClause
* @param whereClause sql where clause
* @return true if success
*/
public boolean dataRequery (String whereClause)
{ {
if (log.isLoggable(Level.INFO)) log.info(whereClause + "; OnlyCurrent=" + 0); return dataRequery (whereClause, onlyCurrentRows, onlyCurrentDays, true);
close(false);
m_onlyCurrentDays = 0;
setSelectWhereClause(whereClause,false, m_onlyCurrentDays);
open(m_maxRows);
// Info
m_rowData = null;
m_changed = false;
m_rowChanged = -1;
m_inserting = false;
return true;
} // dataRequery } // dataRequery
/************************************************************************** /**************************************************************************