private TableDeviceVoCollection getFromTableGrid(IntraOperativeDetailsVo intraOperativeDetails) { TableDeviceVoCollection tempVoColl = new TableDeviceVoCollection(); //wdev-12832 for (int i = 0; i < form.lyr1().tabDetails().ctn1().grdTable().getRows().size(); i++) { TableDeviceVo tableDeviceVo = new TableDeviceVo(); //wdev-12832 if (TableDevices.OTHER.equals(form.lyr1().tabDetails().ctn1().grdTable().getRows().get(i).getValue())) { tableDeviceVo.setOtherTableDevice(form.lyr1().tabDetails().ctn1().grdTable().getRows().get(i).getcolOther()); //wdev-12832 } if (form.lyr1().tabDetails().ctn1().grdTable().getRows().get(i).getcolSelect()) { tableDeviceVo.setTableDevice(form.lyr1().tabDetails().ctn1().grdTable().getRows().get(i).getValue()); //wdev-12832 tempVoColl.add(tableDeviceVo); //wdev-12832 } } return tempVoColl; //wdev-12832 }
private void clearOtherSelectionOnTableGrid(grdTableRow row) { if (row == null || row.getValue() == null) return; form.lyr1().tabDetails().ctn1().grdTable().setValue(row.getValue()); for (int i = 0; i < form.lyr1().tabDetails().ctn1().grdTable().getRows().size(); i++) { if (!row.getValue().equals(form.lyr1().tabDetails().ctn1().grdTable().getRows().get(i).getValue())) { form.lyr1().tabDetails().ctn1().grdTable().getRows().get(i).setcolSelect(false); if (TableDevices.OTHER.equals(form.lyr1().tabDetails().ctn1().grdTable().getRows().get(i).getValue())) { form.lyr1().tabDetails().ctn1().grdTable().getRows().get(i).setcolOther(null); } } } }
private boolean checkOtherTable() { for (int i = 0; i < form.lyr1().tabDetails().ctn1().grdTable().getRows().size(); i++) { if (TableDevices.OTHER.equals(form.lyr1().tabDetails().ctn1().grdTable().getRows().get(i).getValue()) && form.lyr1().tabDetails().ctn1().grdTable().getRows().get(i).getcolSelect() && (form.lyr1().tabDetails().ctn1().grdTable().getRows().get(i).getcolOther() == null || form.lyr1().tabDetails().ctn1().grdTable().getRows().get(i).getcolOther().length() == 0)) return true; } return false; }
private void setTableGrid(TableDeviceVoCollection tableDevices) { if (tableDevices == null) return; for (int j = 0; j < form.lyr1().tabDetails().ctn1().grdTable().getRows().size(); j++) { for(int k = 0; k < tableDevices.size(); k++ ) //wdev-12832 { TableDeviceVo tableDevicesVo = tableDevices.get(k); if(tableDevicesVo == null) continue; if (tableDevicesVo.getTableDevice().equals(form.lyr1().tabDetails().ctn1().grdTable().getRows().get(j).getValue())) { form.lyr1().tabDetails().ctn1().grdTable().getRows().get(j).setcolSelect(true); if (TableDevices.OTHER.equals(tableDevicesVo.getTableDevice())) { form.lyr1().tabDetails().ctn1().grdTable().getRows().get(j).setcolOther(tableDevicesVo.getOtherTableDevice()); form.lyr1().tabDetails().ctn1().grdTable().getRows().get(j).setcolOtherReadOnly(false); } form.lyr1().tabDetails().ctn1().grdTable().setValue(tableDevicesVo.getTableDevice()); form.lyr1().tabDetails().ctn1().grdTable().resetScrollPosition(); break; } } } }
@Override protected void onGrdTableGridCheckBoxClicked(int column, grdTableRow row, boolean isChecked) throws PresentationLogicException { Boolean otherCondition = !(row.getValue() instanceof TableDevices && row.getValue().equals(TableDevices.OTHER) && isChecked); row.setcolOtherReadOnly(otherCondition); if (otherCondition) row.setcolOther(null); //if (isChecked) // clearOtherSelectionOnTableGrid(row); }