public String save_action() { try { para_inventoryDataProvider.commitChanges(); return "editToView"; } catch (Exception ex) { log(" ERROR - para_inventory.Edit : Error Description", ex); error(" ERROR - " + ex.getMessage()); return null; } }
public String edit_action() { int selectedRows = getTableRowGroup1().getSelectedRowsCount(); if (selectedRows > 0) { RowKey[] selectedRowKeys = getTableRowGroup1().getSelectedRowKeys(); for (int i = 0; i < selectedRowKeys.length; i++) { para_loanDataProvider.setCursorRow(selectedRowKeys[i]); para_loanDataProvider.setValue("date_in", calendar1.getValue()); String[] fieldKeys = { "para_inventory.type_prefix_no", "para_inventory.chute_no", "para_inventory.serial_no" }; Object[] values = { para_loanDataProvider.getValue("type_prefix_no"), para_loanDataProvider.getValue("chute_no"), para_loanDataProvider.getValue("serial_no") }; RowKey[] rks = para_inventoryDataProvider.findAll(fieldKeys, values); if (rks.length == 1) { para_inventoryDataProvider.setCursorRow(rks[0]); para_inventoryDataProvider.setValue("para_inventory.status", "returned"); para_loanDataProvider.commitChanges(); para_inventoryDataProvider.commitChanges(); } else { log(" ERROR - para_packing.Add : Too many parachutes"); error(" ERROR - Too many parachutes"); return null; } } return "editToView"; } else { log(" INFO - para_loan.Edit : No row selected"); info(" INFO - Please select a row."); return null; } }