use of org.adempiere.webui.component.ListModelTable in project adempiere by adempiere.
the class WAcctViewer method onEvent.
// stateChanged
/**
* Event Performed (Event Listener)
* @param e Event
*/
public void onEvent(Event e) throws Exception {
// log.info(e.getActionCommand());
iframe.setContent(null);
Object source = e.getTarget();
if (source == tabResult)
stateChanged();
else if (source == tabQuery)
stateChanged();
else if (source == selAcctSchema)
actionAcctSchema();
else if (source == bQuery)
actionQuery();
else if (source == selDocument)
actionDocument();
else if (source == selTable)
actionTable();
else if (source == bRePost)
actionRePost();
else if (//FR[3435028]
source == bExport)
actionExportExcel();
else if (source == bPrint)
//PrintScreenPainter.printScreen(this);
;
else // InfoButtons
if (source == bExport)
// Export the table.
actionExportExcel();
else if (source instanceof Button)
actionButton((Button) source);
else if (source == paging) {
int pgno = paging.getActivePage();
int start = pgno * PAGE_SIZE;
int end = start + PAGE_SIZE;
if (end > paging.getTotalSize())
end = paging.getTotalSize();
List<ArrayList<Object>> list = m_queryData.subList(start, end);
ListModelTable model = new ListModelTable(list);
table.setModel(model);
}
}
use of org.adempiere.webui.component.ListModelTable in project adempiere by adempiere.
the class WScanBarUI method cleanFields.
private void cleanFields() {
productTable.clear();
ListModelTable model = new ListModelTable(getDataModel());
productTable.setData(model, getColumnNames());
upcField.setValue("");
qtyCountField.setValue(null);
qtyCountField.setVisible(false);
lotField.setValue("");
lotField.setVisible(false);
serNoField.setValue("");
serNoField.setVisible(false);
upcField.getComponent().setFocus(true);
}
use of org.adempiere.webui.component.ListModelTable in project adempiere by adempiere.
the class WExpressReceiptScanBarUI method cleanFields.
private void cleanFields() {
productTable.clear();
ListModelTable model = new ListModelTable(getDataModel());
productTable.setData(model, getColumnNames());
upcField.setValue("");
qtyCountField.setValue(null);
qtyCountField.setVisible(false);
lotField.setValue("");
lotField.setVisible(false);
serNoField.setValue("");
serNoField.setVisible(false);
upcField.getComponent().setFocus(true);
}
use of org.adempiere.webui.component.ListModelTable in project adempiere by adempiere.
the class ListModelTableTest method setUp.
/**
* @throws java.lang.Exception
*/
@Before
public void setUp() throws Exception {
Vector<Integer> row0 = new Vector<Integer>();
Vector<Integer> row1 = new Vector<Integer>();
Vector<Object> data = new Vector<Object>();
// create two rows of data
row0.add(ms_number0);
row0.add(ms_number1);
row1.add(ms_number2);
row1.add(ms_number3);
// create the data
data.add(row0);
data.add(row1);
// instantiate the model
m_table = new ListModelTable(data);
}
use of org.adempiere.webui.component.ListModelTable in project adempiere by adempiere.
the class ListModelTableTest method testListModelTable.
/**
* Test method for {@link org.adempiere.webui.component.ListModelTable#ListModelTable()}.
*/
@Test
public final void testListModelTable() {
ListModelTable table = new ListModelTable();
boolean isException = false;
Object data;
assertEquals(0, table.getNoColumns());
assertEquals(0, table.getSize());
// try to get data from an invalid field
try {
data = table.getDataAt(0, 0);
// never reach here, but removes warnings
assertNull(data);
} catch (IllegalArgumentException exception) {
isException = true;
}
assertTrue(isException);
}
Aggregations