Search in sources :

Example 6 with ListModelTable

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);
    }
}
Also used : Button(org.adempiere.webui.component.Button) ListModelTable(org.adempiere.webui.component.ListModelTable) List(java.util.List) ArrayList(java.util.ArrayList)

Example 7 with ListModelTable

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);
}
Also used : ListModelTable(org.adempiere.webui.component.ListModelTable)

Example 8 with ListModelTable

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);
}
Also used : ListModelTable(org.adempiere.webui.component.ListModelTable)

Example 9 with ListModelTable

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);
}
Also used : ListModelTable(org.adempiere.webui.component.ListModelTable) Vector(java.util.Vector) Before(org.junit.Before)

Example 10 with ListModelTable

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);
}
Also used : ListModelTable(org.adempiere.webui.component.ListModelTable) Test(org.junit.Test)

Aggregations

ListModelTable (org.adempiere.webui.component.ListModelTable)35 Vector (java.util.Vector)9 PreparedStatement (java.sql.PreparedStatement)4 ResultSet (java.sql.ResultSet)4 SQLException (java.sql.SQLException)3 ArrayList (java.util.ArrayList)3 BigDecimal (java.math.BigDecimal)2 WListItemRenderer (org.adempiere.webui.component.WListItemRenderer)2 IDColumn (org.compiere.minigrid.IDColumn)2 KeyNamePair (org.compiere.util.KeyNamePair)2 TrxRunnable (org.compiere.util.TrxRunnable)2 IOException (java.io.IOException)1 Timestamp (java.sql.Timestamp)1 List (java.util.List)1 Button (org.adempiere.webui.component.Button)1 Checkbox (org.adempiere.webui.component.Checkbox)1 Combobox (org.adempiere.webui.component.Combobox)1 ListHeader (org.adempiere.webui.component.ListHeader)1 Textbox (org.adempiere.webui.component.Textbox)1 MAcctSchema (org.compiere.model.MAcctSchema)1