Example usage for com.vaadin.server ThemeResource ThemeResource

List of usage examples for com.vaadin.server ThemeResource ThemeResource

Introduction

In this page you can find the example usage for com.vaadin.server ThemeResource ThemeResource.

Prototype

public ThemeResource(String resourceId) 

Source Link

Document

Creates a resource.

Usage

From source file:com.gnts.pem.txn.synd.SyndConstruction.java

License:Open Source License

public void buttonClick(ClickEvent event) {
    notifications.close();//from  www  .j  a v a 2 s.  co m
    if (btnAddNorDoc == event.getButton()) {

        panelNormalDocumentDetails.addComponent(new ComponentIteratorNormlDoc(null, null, "", ""));
    }
    if (btnAddOwner == event.getButton()) {

        layoutOwnerDetails1.addComponent(new ComponentIterOwnerDetails("", ""));
    }
    if (btnAddPlinth == event.getButton()) {

        layoutPlintharea.addComponent(new ComponentIterPlinthArea("", "", ""));
    }
    if (btnAddLegalDoc == event.getButton()) {

        panelLegalDocumentDetails.addComponent(new ComponentIteratorLegalDoc("", "", null));
    }

    if (btnAddAdjoinProperty == event.getButton()) {

        panelAdjoinProperties.addComponent(new ComponentIteratorAdjoinProperty(null, true, true, true));
    }

    if (btnAddDimension == event.getButton()) {
        panelDimension.addComponent(new ComponentIterDimensionofPlot(null, true, true, true));
    }
    if (btnAddGuideline == event.getButton()) {

        layoutGuideline.addComponent(new ComponentIterGuideline("", "", "", ""));
    }
    if (btnAdd == event.getButton()) {
        btnSave.setVisible(true);
        btnCancel.setVisible(true);
        btnSubmit.setVisible(true);
        tablePanel.setVisible(false);
        searchPanel.setVisible(false);
        mainPanel.setVisible(true);
        headerid = beanEvaluation.getNextSequnceId("seq_pem_evaldtls_docid");

        resetAllFieldsFields();
        lblAddEdit.setValue(" > Add New");
        lblAddEdit.setVisible(true);
        lblFormTittle.setVisible(false);
        hlBreadCrumbs.setVisible(true);

    }
    if (btnAddBuildSpec == event.getButton()) {

        panelBuildSpecfication.addComponent(new ComponentIterBuildingSpecfication(null, true, true, true));
    }
    if (btnEdit == event.getButton()) {
        btnSave.setVisible(true);
        btnCancel.setVisible(true);
        btnSubmit.setVisible(true);
        tablePanel.setVisible(false);
        searchPanel.setVisible(false);
        mainPanel.setVisible(true);
        resetAllFieldsFields();
        editDetails();
        lblAddEdit.setValue(" > Modify");
        lblAddEdit.setVisible(true);
        lblFormTittle.setVisible(false);
        hlBreadCrumbs.setVisible(true);

    }
    if (btnDynamicEvaluation1 == event.getButton()) {

        strSelectedPanel = "1";
        showSubWindow();

    }

    if (btnDynamicCustomer == event.getButton()) {
        strSelectedPanel = "2";
        showSubWindow();

    }

    if (btnDynamicAsset == event.getButton()) {
        strSelectedPanel = "3";
        showSubWindow();

    }

    if (btnDynamicTenure == event.getButton()) {
        strSelectedPanel = "4";
        showSubWindow();

    }

    if (btnDynamicmatching == event.getButton()) {
        strSelectedPanel = "5";
        showSubWindow();

    }
    if (btnDynamicConstruction == event.getButton()) {
        strSelectedPanel = "6";
        showSubWindow();

    }
    if (btnDynamicViolation == event.getButton()) {
        strSelectedPanel = "7";
        showSubWindow();

    }
    if (btnDynamicAreaDetail == event.getButton()) {
        strSelectedPanel = "8";
        showSubWindow();

    }
    if (btnDynamicValuation == event.getButton()) {
        strSelectedPanel = "9";
        showSubWindow();

    }
    if (btnDynamicRooms == event.getButton()) {
        strSelectedPanel = "10";
        showSubWindow();

    }
    if (btnDynamicFloor == event.getButton()) {
        strSelectedPanel = "11";
        showSubWindow();

    }
    if (btnDynamicConstVal == event.getButton()) {
        strSelectedPanel = "12";
        showSubWindow();

    }
    if (btnDynamicAppReason == event.getButton()) {
        strSelectedPanel = "14";
        showSubWindow();

    }
    if (btnDynamicEarthQuake == event.getButton()) {
        strSelectedPanel = "15";
        showSubWindow();

    }
    if (btnDynamicCostConst == event.getButton()) {
        if (layoutCostConstruction1.isVisible()) {
            layoutCostConstruction2.setVisible(true);
        } else {
            layoutCostConstruction2.setVisible(false);
        }
        if (layoutCost.isVisible()) {
            layoutCostConstruction1.setVisible(true);

        } else {
            layoutCostConstruction1.setVisible(false);
        }

    }
    if (btnDynamicAppEstimate == event.getButton()) {
        if (layoutApplicantEstimate2.isVisible()) {
            layoutApplicantEstimate3.setVisible(true);

        } else {
            layoutApplicantEstimate3.setVisible(false);
        }
        if (layoutApplicantEstimate1.isVisible()) {
            layoutApplicantEstimate2.setVisible(true);

        } else {
            layoutApplicantEstimate2.setVisible(false);
        }
    }
    if (btnDynamicPlanApproval == event.getButton()) {
        strSelectedPanel = "17";
        showSubWindow();

    }

    if (myButton == event.getButton()) {

        if (tfCaption.getValue() != null && tfCaption.getValue().trim().length() > 0) {

            if (strSelectedPanel.equals("1")) {
                if (tfDynamicEvaluation1.isVisible()) {
                    tfDynamicEvaluation2.setCaption(tfCaption.getValue());
                    tfDynamicEvaluation2.setVisible(true);
                } else {
                    tfDynamicEvaluation1.setCaption(tfCaption.getValue());
                    tfDynamicEvaluation1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("2")) {
                if (tfDynamicCustomer1.isVisible()) {
                    tfDynamicCustomer2.setCaption(tfCaption.getValue());
                    tfDynamicCustomer2.setVisible(true);
                } else {
                    tfDynamicCustomer1.setCaption(tfCaption.getValue());
                    tfDynamicCustomer1.setVisible(true);
                }

            } else if (strSelectedPanel.equals("3")) {
                if (tfDynamicAsset1.isVisible()) {
                    tfDynamicAsset2.setCaption(tfCaption.getValue());
                    tfDynamicAsset2.setVisible(true);
                } else {
                    tfDynamicAsset1.setCaption(tfCaption.getValue());
                    tfDynamicAsset1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("4")) {
                if (tfDynamicTenure1.isVisible()) {
                    tfDynamicTenure2.setCaption(tfCaption.getValue());
                    tfDynamicTenure2.setVisible(true);
                } else {
                    tfDynamicTenure1.setCaption(tfCaption.getValue());
                    tfDynamicTenure1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("5")) {
                if (tfDynamicmatching1.isVisible()) {
                    tfDynamicmatching2.setCaption(tfCaption.getValue());
                    tfDynamicmatching2.setVisible(true);
                } else {
                    tfDynamicmatching1.setCaption(tfCaption.getValue());
                    tfDynamicmatching1.setVisible(true);
                }
            }

            else if (strSelectedPanel.equals("6")) {
                if (tfDynamicConstruction1.isVisible()) {
                    tfDynamicConstruction2.setCaption(tfCaption.getValue());
                    tfDynamicConstruction2.setVisible(true);
                } else {
                    tfDynamicConstruction1.setCaption(tfCaption.getValue());
                    tfDynamicConstruction1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("7")) {
                if (tfDynamicViolation1.isVisible()) {
                    tfDynamicViolation2.setCaption(tfCaption.getValue());
                    tfDynamicViolation2.setVisible(true);
                } else {
                    tfDynamicViolation1.setCaption(tfCaption.getValue());
                    tfDynamicViolation1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("8")) {
                if (tfDynamicAreaDetail1.isVisible()) {
                    tfDynamicAreaDetail2.setCaption(tfCaption.getValue());
                    tfDynamicAreaDetail2.setVisible(true);
                } else {
                    tfDynamicAreaDetail1.setCaption(tfCaption.getValue());
                    tfDynamicAreaDetail1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("9")) {
                if (tfDynamicValuation1.isVisible()) {
                    tfDynamicValuation2.setCaption(tfCaption.getValue());
                    tfDynamicValuation2.setVisible(true);
                } else {
                    tfDynamicValuation1.setCaption(tfCaption.getValue());
                    tfDynamicValuation1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("10")) {
                if (tfDynamicRooms1.isVisible()) {
                    tfDynamicRooms2.setCaption(tfCaption.getValue());
                    tfDynamicRooms2.setVisible(true);
                } else {
                    tfDynamicRooms1.setCaption(tfCaption.getValue());
                    tfDynamicRooms1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("11")) {
                if (tfDynamicFloors1.isVisible()) {
                    tfDynamicFloors2.setCaption(tfCaption.getValue());
                    tfDynamicFloors2.setVisible(true);
                } else {
                    tfDynamicFloors1.setCaption(tfCaption.getValue());
                    tfDynamicFloors1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("12")) {
                if (tfDynamicConstval1.isVisible()) {
                    tfDynamicConstval2.setCaption(tfCaption.getValue());
                    tfDynamicConstval2.setVisible(true);
                } else {
                    tfDynamicConstval1.setCaption(tfCaption.getValue());
                    tfDynamicConstval1.setVisible(true);
                }
            }

            else if (strSelectedPanel.equals("14")) {
                if (tfDynamicAppReason1.isVisible()) {
                    tfDynamicAppReason3.setValue(tfCaption.getValue());
                    tfDynamicAppReason3.setVisible(true);
                } else {
                    tfDynamicAppReason1.setValue(tfCaption.getValue());
                    tfDynamicAppReason1.setVisible(true);

                }
                if (tfDynamicAppReason2.isVisible()) {
                    tfDynamicAppReason4.setValue("");
                    tfDynamicAppReason4.setVisible(true);
                } else {
                    tfDynamicAppReason2.setValue("");
                    tfDynamicAppReason2.setVisible(true);
                }
            } else if (strSelectedPanel.equals("15")) {
                if (tfDynamicEarthquake1.isVisible()) {
                    tfDynamicEarthquake2.setCaption(tfCaption.getValue());
                    tfDynamicEarthquake2.setVisible(true);
                } else {
                    tfDynamicEarthquake1.setCaption(tfCaption.getValue());
                    tfDynamicEarthquake1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("17")) {
                if (tfDynamicPlanApproval1.isVisible()) {
                    tfDynamicPlanApproval2.setCaption(tfCaption.getValue());
                    tfDynamicPlanApproval2.setVisible(true);
                } else {
                    tfDynamicPlanApproval1.setCaption(tfCaption.getValue());
                    tfDynamicPlanApproval1.setVisible(true);
                }
            }

        }
        mywindow.close();
    }

    if (btnSave == event.getButton()) {
        setComponentError();
        if (tfEvaluationNumber.isValid() && tfBankBranch.isValid() && tfEvaluationPurpose.isValid()
                && dfDateofValuation.isValid()) {

            saveEvaluationDetails();
        }
        //btnSave.setVisible(false);
    }
    if (btnSubmit == event.getButton()) {
        setComponentError();
        if (tfEvaluationNumber.isValid() && tfBankBranch.isValid() && tfEvaluationPurpose.isValid()
                && dfDateofValuation.isValid()) {
            saveEvaluationDetails();
            updateEvaluationDetails();
            btnSubmit.setEnabled(false);
            btnSave.setEnabled(false);
        }
        //   saveExcel.setVisible(true);

    }
    if (btnCancel == event.getButton()) {
        btnSave.setVisible(false);
        btnCancel.setVisible(false);
        btnSubmit.setVisible(false);
        btnSave.setEnabled(true);
        btnSubmit.setEnabled(true);
        //saveExcel.setVisible(false);
        tablePanel.setVisible(true);
        searchPanel.setVisible(true);
        mainPanel.setVisible(false);
        btnEdit.setEnabled(false);
        btnAdd.setEnabled(true);
        populateAndConfig(false);
        lblFormTittle.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;Search");
        lblNotificationIcon.setIcon(null);
        lblSaveNotification.setValue("");
        lblFormTittle.setVisible(true);
        hlBreadCrumbs.setVisible(false);
        lblAddEdit.setVisible(false);
        btnView.setEnabled(false);

        hlFileDownloadLayout.removeAllComponents();
        hlFileDownloadLayout.addComponent(btnDownload);
        getExportTableDetails();
    } else if (btnBack == event.getButton()) {
        resetAllFieldsFields();
        btnSave.setVisible(false);
        btnCancel.setVisible(false);
        btnSubmit.setVisible(false);
        //   saveExcel.setVisible(false);
        tablePanel.setVisible(true);
        searchPanel.setVisible(true);
        mainPanel.setVisible(false);
        btnEdit.setEnabled(false);
        btnAdd.setEnabled(true);
        populateAndConfig(false);
        lblFormTittle.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;Search");
        lblNotificationIcon.setIcon(null);
        lblSaveNotification.setValue("");
        lblFormTittle.setVisible(true);
        hlBreadCrumbs.setVisible(false);
        lblAddEdit.setVisible(false);
        btnView.setEnabled(false);
    }

    if (btnSearch == event.getButton()) {
        populateAndConfig(true);
        if (total == 0) {
            lblNotificationIcon.setIcon(new ThemeResource("img/msg_info.png"));
            lblSaveNotification.setValue("No Records found");
        } else {
            lblNotificationIcon.setIcon(null);
            lblSaveNotification.setValue("");
        }
        hlFileDownloadLayout.removeAllComponents();
        hlFileDownloadLayout.addComponent(btnDownload);
        getExportTableDetails();
    }
    if (btnReset == event.getButton()) {
        tfSearchEvalNumber.setValue("");
        dfSearchEvalDate.setValue(null);
        tfSearchCustomer.setValue("");
        tfSearchBankbranch.setValue(null);
        populateAndConfig(false);
    }
}

From source file:com.gnts.pem.txn.synd.SyndConstructionBuilding.java

@SuppressWarnings("deprecation")
void populateAndConfig(boolean search) {
    try {/* w w w . j  a  va 2  s. c  om*/
        tblEvalDetails.removeAllItems();
        tblEvalDetails.setImmediate(true);
        List<TPemCmEvalDetails> evalList = null;
        evalList = new ArrayList<TPemCmEvalDetails>();
        if (search) {
            String evalno = tfSearchEvalNumber.getValue();
            String customer = tfSearchCustomer.getValue();
            String bankbranch = (String) tfSearchBankbranch.getValue();
            evalList = beanEvaluation.getSearchEvalDetailnList(null, evalno, null, customer, bankbranch,
                    selectedBankid, selectCompanyid, null);
        } else {

            evalList = beanEvaluation.getSearchEvalDetailnList(SelectedFormName, null, null, null, null,
                    selectedBankid, selectCompanyid, null);
            total = evalList.size();
        }
        if (total == 0) {
            lblNotificationIcon.setIcon(new ThemeResource("img/msg_info.png"));
            lblSaveNotification.setValue("No Records found");
        } else {
            lblNotificationIcon.setIcon(null);
            lblSaveNotification.setValue("");
        }
        lblNoofRecords.setValue(
                "<font size=\"2\" color=\"black\">No.of Records:</font> <font size=\"2\" color=\"#1E90FF\"> "
                        + total + "</font>");

        beans = new BeanItemContainer<TPemCmEvalDetails>(TPemCmEvalDetails.class);
        beans.addAll(evalList);
        btnEdit.setEnabled(false);
        tblEvalDetails.setContainerDataSource(beans);
        tblEvalDetails.setSelectable(true);
        tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
        tblEvalDetails.setVisibleColumns(new Object[] { "evalNo", "docDate", "bankBranch", "custName",
                "docStatus", "lastUpdtedBy", "lastUpdateDt" });
        tblEvalDetails.setColumnHeaders(new String[] { "Evaluation Number", "Evaluation Date", "Bank Branch",
                "Customer Name", "Status", "Last Updated By", "Last Updated Date" });
        tblEvalDetails.addValueChangeListener(new Property.ValueChangeListener() {
            /**
            * 
            */
            private static final long serialVersionUID = 3729824796823933688L;

            @Override
            public void valueChange(ValueChangeEvent event) {
                StreamResource sr = getPDFStream();

                if (sr != null) {

                    if (filedownloader == null) {
                        filedownloader = new FileDownloader(getPDFStream());
                        filedownloader.extend(btnView);
                    } else {
                        filedownloader.setFileDownloadResource(sr);
                    }
                } else {
                    lblNotificationIcon.setIcon(new ThemeResource("img/msg_info.png"));
                    lblSaveNotification.setValue("No document is there");
                    //   notif.show(Page.getCurrent());
                    if (filedownloader != null) {
                        filedownloader.setFileDownloadResource(null); // reset
                    }

                }

                TPemCmEvalDetails syncList = (TPemCmEvalDetails) event.getProperty().getValue();
                if (syncList != null) {

                    if (syncList.getDocStatus().equals("Draft") || syncList.getDocStatus().equals("Rejected")) {
                        btnEdit.setEnabled(true);
                        btnView.setEnabled(false);
                    } else {
                        btnEdit.setEnabled(false);
                        btnView.setEnabled(true);

                    }
                    btnAdd.setEnabled(false);
                } else {
                    btnEdit.setEnabled(false);
                    btnAdd.setEnabled(true);
                }
            }

        });
        tblEvalDetails.setImmediate(true);
        tblEvalDetails.addItemClickListener(new ItemClickListener() {

            @Override
            public void itemClick(ItemClickEvent event) {
                // TODO Auto-generated method stub
                if (tblEvalDetails.isSelected(event.getItemId())) {

                    btnView.setEnabled(false);
                } else {

                    btnView.setEnabled(true);
                }
            }
        });
    } catch (Exception e) {
        e.printStackTrace();
        logger.info("Error-->" + e);
    }
    getExportTableDetails();

}

From source file:com.gnts.pem.txn.synd.SyndConstructionBuilding.java

private void updateEvaluationDetails() {
    System.out.println("Inside Update Evaluation");
    try {/* ww w.  jav a 2s.  c  om*/
        boolean valid = false;
        TPemCmEvalDetails evalobj = new TPemCmEvalDetails();
        evalNumber = tfEvaluationNumber.getValue();
        customer = tfCustomerName.getValue();
        propertyType = "UNDERCONSTRUTIONBUILDING";

        evalobj.setDocId(headerid);
        evalobj.setDocStatus(Common.DOC_PENDING);
        evalobj.setDocDate(dfDateofValuation.getValue());
        evalobj.setEvalNo(tfEvaluationNumber.getValue());
        evalobj.setEvalDate(dfDateofValuation.getValue());
        evalobj.setValuationBy(tfValuatedBy.getValue());
        MPemCmBank bankid = new MPemCmBank();
        bankid.setBankId(selectedBankid);
        evalobj.setBankId(bankid);
        evalobj.setDoctype(screenName);
        evalobj.setCompanyId(selectCompanyid);
        evalobj.setBankBranch((String) tfBankBranch.getValue());
        evalobj.setEvalPurpose(tfEvaluationPurpose.getValue());
        evalobj.setEvalDate(dfDateofValuation.getValue());
        evalobj.setCheckedBy(tfVerifiedBy.getValue());
        evalobj.setCheckedDt(dfVerifiedDate.getValue());
        evalobj.setInspectionDt(dfDateofValuation.getValue());
        evalobj.setInspectionBy(tfValuatedBy.getValue());
        evalobj.setLastUpdateDt(new Date());
        evalobj.setLastUpdtedBy(loginusername);
        evalobj.setCustName(tfCustomerName.getValue());

        if (tfDynamicEvaluation1.getValue() != null && tfDynamicEvaluation1.getValue().trim().length() > 0) {
            evalobj.setCustomLbl1(tfDynamicEvaluation1.getCaption());
            evalobj.setCustomValue1(tfDynamicEvaluation1.getValue());
        }
        if (tfDynamicEvaluation2.getValue() != null && tfDynamicEvaluation2.getValue().trim().length() > 0) {
            evalobj.setCustomValue2(tfDynamicEvaluation2.getCaption());
            evalobj.setCustomValue2(tfDynamicEvaluation2.getValue());
        }
        try {
            BigDecimal totalAbstract = new BigDecimal(0.00);
            BigDecimal test = new BigDecimal("0.00");
            BigDecimal test1 = new BigDecimal("0.00");
            BigDecimal test2 = new BigDecimal("0.00");
            BigDecimal test3 = new BigDecimal("0.00");
            BigDecimal test4 = new BigDecimal("0.00");
            BigDecimal test5 = new BigDecimal("0.00");
            try {
                test = new BigDecimal(
                        uiflowdata.getTotalExtraItem().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));

            } catch (Exception e) {
                test = new BigDecimal("0.00");
            }
            try {
                test1 = new BigDecimal(
                        uiflowdata.getMarketValue().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));
            } catch (Exception e) {
                test1 = new BigDecimal("0.00");
            }
            try {
                test2 = new BigDecimal(
                        uiflowdata.getTotalAdditional().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));
            } catch (Exception e) {
                test2 = new BigDecimal("0.00");
            }
            try {
                test3 = new BigDecimal(
                        uiflowdata.getTotalMiscellaneous().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));

            } catch (Exception e) {
                test3 = new BigDecimal("0.00");
            }
            try {
                test4 = new BigDecimal(
                        uiflowdata.getTotalServices().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));
            } catch (Exception e) {
                test4 = new BigDecimal("0.00");
            }
            try {
                test5 = new BigDecimal(
                        uiflowdata.getTotalValuation().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));
            } catch (Exception e) {
                test5 = new BigDecimal("0.00");
            }
            totalAbstract = totalAbstract.add(test).add(test1).add(test2).add(test3).add(test4).add(test5);

            uiflowdata.setTotalAbstractvalue(XMLUtil.IndianFormat(new BigDecimal(totalAbstract.toString())));
            String numberOnly = totalAbstract.toString().replaceAll("[^\\d.]", "");
            uiflowdata.setAmountInWords(beanEvaluation.getAmountInWords(numberOnly));
            if (numberOnly.trim().length() == 0) {
                numberOnly = "0";
            }
            evalobj.setPropertyValue(Double.valueOf(numberOnly));
            //   beanEvaluation.saveorUpdateEvalDetails(evalobj);
            uiflowdata.setEvalDtls(evalobj);
            if (tfEvaluationNumber.isValid() && tfBankBranch.isValid() && tfEvaluationPurpose.isValid()
                    && dfDateofValuation.isValid()) {

                if (count == 0) {
                    beanEvaluation.saveorUpdateEvalDetails(evalobj);

                    valid = true;
                }
                lblNotificationIcon.setIcon(new ThemeResource("img/success_small.png"));
                lblSaveNotification.setValue("Successfully Submitted");
            }

            if (valid) {
                /*populateAndConfig(false);
                resetAllFieldsFields();*/
                btnSubmit.setEnabled(false);
            } else {
                btnSubmit.setComponentError(new UserError("Form is invalid"));
            }
        } catch (Exception e) {

        }

    } catch (Exception e) {
        lblNotificationIcon.setIcon(new ThemeResource("img/failure.png"));
        lblSaveNotification.setValue("Submit failed, please check the data and try again ");
        logger.info("Error on SaveApproveReject Status function--->" + e);
    }
}

From source file:com.gnts.pem.txn.synd.SyndConstructionBuilding.java

private void saveEvaluationDetails() {
    uiflowdata = new UIFlowData();
    // for save evaluation details
    boolean valid = false;
    try {/*  ww w .j  a  va 2s .  c  om*/
        TPemCmEvalDetails evalobj = new TPemCmEvalDetails();

        evalobj.setDocId(headerid);
        System.out.println("Headerid-->" + headerid);
        evalobj.setDocDate(dfDateofValuation.getValue());
        evalobj.setEvalNo(tfEvaluationNumber.getValue());
        evalobj.setEvalDate(dfDateofValuation.getValue());
        evalobj.setValuationBy(tfValuatedBy.getValue());
        MPemCmBank bankid = new MPemCmBank();
        bankid.setBankId(selectedBankid);
        evalobj.setBankId(bankid);
        evalobj.setDoctype(screenName);
        evalobj.setCompanyId(selectCompanyid);
        evalobj.setBankBranch((String) tfBankBranch.getValue());
        evalobj.setEvalPurpose(tfEvaluationPurpose.getValue());
        evalobj.setEvalDate(dfDateofValuation.getValue());
        evalobj.setCheckedBy(tfVerifiedBy.getValue());
        evalobj.setCheckedDt(dfVerifiedDate.getValue());
        evalobj.setInspectionDt(dfDateofValuation.getValue());
        evalobj.setInspectionBy(tfValuatedBy.getValue());
        evalobj.setDocStatus(Common.DOC_DRAFT);
        evalobj.setLastUpdateDt(new Date());
        evalobj.setLastUpdtedBy(loginusername);
        evalobj.setCustName(tfCustomerName.getValue());

        if (tfDynamicEvaluation1.getValue() != null && tfDynamicEvaluation1.getValue().trim().length() > 0) {
            evalobj.setCustomLbl1(tfDynamicEvaluation1.getCaption());
            evalobj.setCustomValue1(tfDynamicEvaluation1.getValue());
        }
        if (tfDynamicEvaluation2.getValue() != null && tfDynamicEvaluation2.getValue().trim().length() > 0) {
            evalobj.setCustomValue2(tfDynamicEvaluation2.getCaption());
            evalobj.setCustomValue2(tfDynamicEvaluation2.getValue());
        }
        beanEvaluation.saveorUpdateEvalDetails(evalobj);
        uiflowdata.setEvalDtls(evalobj);
        try {
            saveOwnerDetails();
        } catch (Exception e) {
        }

        try {
            saveAssetDetails();
        } catch (Exception e) {
        }

        try {
            saveNormalDocuments();
        } catch (Exception e) {
        }

        try {
            saveLegalDocuments();
        } catch (Exception e) {
        }

        try {
            saveAdjoinPropertyDetails();
        } catch (Exception e) {
        }

        try {
            saveDimensionValues();
        } catch (Exception e) {
        }

        try {
            saveMatchingBoundaries();
        } catch (Exception e) {
        }
        try {
            saveNoofRooms();
        } catch (Exception e) {
        }
        try {
            saveNoofFloors();
        } catch (Exception e) {
        }
        try {
            saveTenureOccupayDetails();
        } catch (Exception e) {
        }

        try {
            saveConstructionDetails();
        } catch (Exception e) {
        }

        try {
            saveViolationDetails();
        } catch (Exception e) {
        }
        try {
            saveDetailsOfConstruction();
        } catch (Exception e) {
        }
        try {
            saveOldPlinthAreaDetails();
        } catch (Exception e) {
        }
        try {
            saveNewPlinthAreaDetails();
        } catch (Exception e) {
        }
        try {
            saveOldBuildSpecDetails();
        } catch (Exception e) {
        }
        try {
            saveNewBuildSpecDetails();
        } catch (Exception e) {

        }
        try {
            saveEstimateDetails();
        } catch (Exception e) {
        }
        try {
            saveReasonableDetails();
        } catch (Exception e) {
        }
        try {
            saveEarthQuakeDetails();
        } catch (Exception e) {
        }
        try {
            saveCostConstDetails();
        } catch (Exception e) {
        }
        try {
            saveGuidelineValue();
        } catch (Exception e) {
        }

        try {
            saveGuidelineReferenceDetails();
        } catch (Exception e) {
        }
        try {
            savePropertyValueDetails();
        } catch (Exception e) {
        }
        try {
            saveOldPlanApprovalDetails();
        } catch (Exception e) {
            logger.info("Error-->" + e);
        }
        try {
            saveNewPlanApprovalDetails();
        } catch (Exception e) {
            logger.info("Error-->" + e);
        }
        try {
            saveBuildingTechDetails();
        } catch (Exception e) {
            logger.info("Error-->" + e);
        }
        try {
            saveRoofHeightDetails();
        } catch (Exception e) {
        }
        try {
            saveValuationDetails();
        } catch (Exception e) {
        }
        try {
            saveExtraItemsDetails();
        } catch (Exception e) {
        }
        try {
            saveAdditionalDetails();
        } catch (Exception e) {
        }
        try {
            saveMiscellaneousDetails();
        } catch (Exception e) {
        }
        try {
            saveServiceDetails();
        } catch (Exception e) {
        }
        try {
            uiflowdata.setPropertyAddress(tfPropertyAddress.getValue());
            uiflowdata.setBankBranch((String) tfBankBranch.getValue());
            uiflowdata.setEvalnumber(tfEvaluationNumber.getValue());

            if (dfDateofValuation.getValue() != null) {
                SimpleDateFormat dt1 = new SimpleDateFormat("dd-MMM-yyyy");
                uiflowdata.setInspectionDate(dt1.format(dfDateofValuation.getValue()));
            }
            BigDecimal site = new BigDecimal(0.00);
            BigDecimal fair = new BigDecimal(1.00);
            BigDecimal salbale = new BigDecimal(435.60);
            try {
                site = new BigDecimal(tfSiteArea.getValue().replaceAll("[^\\d.]", ""));
            } catch (Exception e) {
                site = new BigDecimal("0.00");

            }
            try {
                site.divide(salbale, 2, RoundingMode.HALF_UP).toPlainString();
                fair.multiply(site.divide(salbale, 2, RoundingMode.HALF_UP))
                        .multiply(new BigDecimal(tfAdopetdMarketRate.getValue().replaceAll("[^\\d.]", "")));
                tfSiteArea.setValue(site.toString() + " sft (or) "
                        + site.divide(salbale, 2, RoundingMode.HALF_UP).toPlainString() + " cents");
                tfSalableArea.setValue(site.toString() + " sft (or) "
                        + site.divide(salbale, 2, RoundingMode.HALF_UP).toPlainString() + " cents");
                tfAreaofLand.setValue(site.toString() + " sft (or) "
                        + site.divide(salbale, 2, RoundingMode.HALF_UP).toPlainString() + " cents");
                tfFairMarketRate.setValue(XMLUtil.IndianFormat(new BigDecimal(fair
                        .multiply(site.divide(salbale, 2, RoundingMode.HALF_UP))
                        .multiply(new BigDecimal(tfAdopetdMarketRate.getValue().replaceAll("[^\\d.]", "")))
                        .toString())));
            } catch (Exception e) {

            }

            try {
                saveAreaDetailsofProperty();
            } catch (Exception e) {
            }

            try {
                saveValuationofLandDetails();
            } catch (Exception e) {
            }
            uiflowdata.setPropDesc((String) slPropertyDesc.getValue());
            uiflowdata.setCustomername(tfCustomerName.getValue());
            uiflowdata.setMarketValue(XMLUtil.IndianFormat(new BigDecimal(
                    tfFairMarketRate.getValue().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""))));
            uiflowdata.setGuidelinevalue(XMLUtil.IndianFormat(new BigDecimal(tfGuidelineRate.getValue())));
            uiflowdata.setConstructionValue(tfCostConstruction.getValue());
        } catch (Exception e) {
            logger.info("Error-->" + e);
        }
        try {
            BigDecimal totalAbstract = new BigDecimal(0.00);
            BigDecimal test = new BigDecimal("0.00");
            BigDecimal test1 = new BigDecimal("0.00");
            BigDecimal test2 = new BigDecimal("0.00");
            BigDecimal test3 = new BigDecimal("0.00");
            BigDecimal test4 = new BigDecimal("0.00");
            BigDecimal test5 = new BigDecimal("0.00");
            try {
                test = new BigDecimal(
                        uiflowdata.getTotalExtraItem().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));

            } catch (Exception e) {
                test = new BigDecimal("0.00");
            }
            try {
                test1 = new BigDecimal(
                        uiflowdata.getMarketValue().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));
            } catch (Exception e) {
                test1 = new BigDecimal("0.00");
            }
            try {
                test2 = new BigDecimal(
                        uiflowdata.getTotalAdditional().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));
            } catch (Exception e) {
                test2 = new BigDecimal("0.00");
            }
            try {
                test3 = new BigDecimal(
                        uiflowdata.getTotalMiscellaneous().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));

            } catch (Exception e) {
                test3 = new BigDecimal("0.00");
            }
            try {
                test4 = new BigDecimal(
                        uiflowdata.getTotalServices().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));
            } catch (Exception e) {
                test4 = new BigDecimal("0.00");
            }
            try {
                test5 = new BigDecimal(
                        uiflowdata.getTotalValuation().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));
            } catch (Exception e) {
                test5 = new BigDecimal("0.00");
            }
            totalAbstract = totalAbstract.add(test).add(test1).add(test2).add(test3).add(test4).add(test5);

            uiflowdata.setTotalAbstractvalue(XMLUtil.IndianFormat(new BigDecimal(totalAbstract.toString())));
            String numberOnly = totalAbstract.toString().replaceAll("[^\\d.]", "");
            uiflowdata.setAmountInWords(beanEvaluation.getAmountInWords(numberOnly));
            String numberOnly1 = tfGuidelineRate.getValue().replaceAll("[^0-9]", "");
            uiflowdata.setAmountWordsGuideline(beanEvaluation.getAmountInWords(numberOnly1));
            /*List<CmCommonSetup> bill = BillGenerator.getEndValueDetails(numberOnly,headerid,loginusername,selectedBankid,selectCompanyid);
            //   bill.setBillNo(Long.toString(beanEvaluation.getNextSequnceId("seq_pem_evaldtls_docid")));
               uiflowdata.setBillDtls(bill);
                       
               TPemCmBillDtls billDtls=BillGenerator.getBillDetails(numberOnly, headerid, loginusername, selectedBankid, selectCompanyid);
               uiflowdata.setBill(billDtls);*/
            BigDecimal realizable = new BigDecimal(0.00);
            BigDecimal distress = new BigDecimal(0.00);
            BigDecimal real = new BigDecimal("0.00");
            BigDecimal distre = new BigDecimal("0.00");

            try {
                real = new BigDecimal(
                        totalAbstract.toString().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));
            } catch (Exception e) {
                real = new BigDecimal("0.00");

            }
            try {
                distre = new BigDecimal(
                        totalAbstract.toString().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));
            } catch (Exception e) {
                distre = new BigDecimal("0.00");

            }
            try {
                realizable = real.multiply(new BigDecimal(95)).divide(new BigDecimal(100));
                realizable = realizable.subtract(realizable.remainder(new BigDecimal(1000)));
                tfRealizabletRate.setValue(realizable.toString());
                uiflowdata.setRealizablevalue(XMLUtil.IndianFormat(new BigDecimal(realizable.toString())));

                distress = (distre.multiply(new BigDecimal(85))).divide(new BigDecimal(100));
                distress = distress.subtract(distress.remainder(new BigDecimal(1000)));
                tfDistressRate.setValue(distress.toString());
                uiflowdata.setDistressvalue(XMLUtil.IndianFormat(new BigDecimal(distress.toString())));
            } catch (Exception e) {

            }

        } catch (Exception e) {

        }
        evalNumber = tfEvaluationNumber.getValue();
        customer = tfCustomerName.getValue();
        propertyType = "UNDERCONSTRUTIONBUILDING";
        ByteArrayOutputStream recvstram = XMLUtil.doMarshall(uiflowdata);
        XMLUtil.getWordDocument(recvstram, evalNumber + "_" + customer + "_" + propertyType, strXslFile);
        if (tfEvaluationNumber.isValid() && tfBankBranch.isValid() && tfEvaluationPurpose.isValid()
                && dfDateofValuation.isValid()) {
            if (count == 0) {
                beanEvaluation.saveorUpdateEvalDetails(evalobj);

                valid = true;
            }
            lblNotificationIcon.setIcon(new ThemeResource("img/success_small.png"));
            lblSaveNotification.setValue(ApplicationConstants.saveMsg);
        }

        if (valid) {
            /*populateAndConfig(false);
            resetAllFieldsFields();*/
            btnSave.setEnabled(false);
        } else {
            btnSave.setComponentError(new UserError("Form is invalid"));
        }

    } catch (Exception e) {
        lblNotificationIcon.setIcon(new ThemeResource("img/failure.png"));
        lblSaveNotification.setValue("Save failed, please check the data and try again ");
        logger.info("Error on SaveApproveReject Status function--->" + e);
    }
}

From source file:com.gnts.pem.txn.synd.SyndConstructionBuilding.java

@SuppressWarnings("deprecation")
void setComponentStyle() {

    tfSearchBankbranch.setNullSelectionAllowed(false);
    tfSearchBankbranch.setInputPrompt(Common.SELECT_PROMPT);
    tfSearchCustomer.setInputPrompt("Enter Customer");
    tfSearchEvalNumber.setInputPrompt("Enter Evaluation Number");

    tfEvaluationNumber.setWidth(strComponentWidth);
    tfBankBranch.setWidth(strComponentWidth);
    tfEvaluationPurpose.setWidth(strComponentWidth);
    dfDateofValuation.setWidth("150px");
    tfValuatedBy.setWidth(strComponentWidth);
    dfVerifiedDate.setWidth("150px");
    tfVerifiedBy.setWidth(strComponentWidth);
    tfDynamicEvaluation1.setWidth(strComponentWidth);
    tfDynamicEvaluation2.setWidth(strComponentWidth);

    dfDateofValuation.addValidator(new DateValidation("Invalid date entered"));
    dfDateofValuation.setImmediate(true);

    dfVerifiedDate.addValidator(new DateValidation("Invalid date entered"));
    dfVerifiedDate.setImmediate(true);/*from   w  ww.  j  a  v  a 2 s .  c o m*/

    dfDateofValuation.setResolution(PopupDateField.RESOLUTION_DAY);
    dfDateofValuation.setDateFormat("dd-MMM-yyyy");

    dfVerifiedDate.setResolution(PopupDateField.RESOLUTION_DAY);
    dfVerifiedDate.setDateFormat("dd-MMM-yyyy");

    tfCustomerName.setWidth(strComponentWidth);
    slPropertyDesc.setWidth(strComponentWidth);
    tfCustomerAddr.setWidth(strComponentWidth);
    tfCustomerAddr.setHeight("150px");
    slPropertyDesc.setNullSelectionAllowed(false);

    //for matching boundary
    slMatchingBoundary.setWidth(strComponentWidth);
    slPlotDemarcated.setWidth(strComponentWidth);
    slApproveLandUse.setWidth(strComponentWidth);
    slTypeofProperty.setWidth(strComponentWidth);
    tfDynamicmatching1.setWidth(strComponentWidth);
    tfDynamicmatching2.setWidth(strComponentWidth);

    //room
    tfNoofRooms.setWidth(strComponentWidth);
    tfLivingDining.setWidth(strComponentWidth);
    tfBedRooms.setWidth(strComponentWidth);
    tfKitchen.setWidth(strComponentWidth);
    tfToilets.setWidth(strComponentWidth);
    tfDynamicRooms1.setWidth(strComponentWidth);
    tfDynamicRooms2.setWidth(strComponentWidth);

    //floor
    tfTotNoofFloors.setWidth(strComponentWidth);
    tfPropertyLocated.setWidth(strComponentWidth);
    tfApproxAgeofBuilding.setWidth(strComponentWidth);
    tfResidualAgeofBuilding.setWidth(strComponentWidth);
    slTypeofStructure.setWidth(strComponentWidth);
    tfDynamicFloors1.setWidth(strComponentWidth);
    tfDynamicFloors2.setWidth(strComponentWidth);

    //tenure/occupancy
    tfStatusofTenure.setWidth(strComponentWidth);
    slOwnedorRent.setWidth(strComponentWidth);
    tfNoOfYears.setWidth(strComponentWidth);
    tfRelationship.setWidth(strComponentWidth);
    tfDynamicTenure1.setWidth(strComponentWidth);
    tfDynamicTenure2.setWidth(strComponentWidth);

    //for construction
    tfStageofConst.setWidth(strComponentWidth);
    tfDynamicConstruction1.setWidth(strComponentWidth);
    tfDynamicConstruction2.setWidth(strComponentWidth);

    //for violation
    tfAnyViolation.setWidth(strComponentWidth);
    tfDynamicViolation1.setWidth(strComponentWidth);
    tfDynamicViolation2.setWidth(strComponentWidth);

    // for cost of construction
    lblCostConst.setWidth(strEstimateWidth);
    tfCostConstruction.setWidth(strComponentWidth);
    tfDynamicCostConst1.setWidth(strEstimateWidth);
    tfDynamicCostConst2.setWidth(strComponentWidth);
    tfDynamicCostConst3.setWidth(strEstimateWidth);
    tfDynamicCostConst4.setWidth(strComponentWidth);
    tfDynamicCostConst5.setWidth(strEstimateWidth);
    tfDynamicCostConst6.setWidth(strComponentWidth);
    tfDynamicCostConst7.setWidth(strEstimateWidth);
    tfDynamicCostConst8.setWidth(strComponentWidth);
    tfDynamicCostConst9.setWidth(strEstimateWidth);
    tfDynamicCostConst10.setWidth(strComponentWidth);
    //for area details
    tfSiteArea.setWidth(strComponentWidth);
    tfPlinthArea.setWidth(strComponentWidth);
    tfCarpetArea.setWidth(strComponentWidth);
    tfSalableArea.setWidth(strComponentWidth);
    tfRemarks.setWidth(strComponentWidth);
    tfRemarks.setHeight("95px");
    tfDynamicAreaDetail1.setWidth(strComponentWidth);
    tfDynamicAreaDetail2.setWidth(strComponentWidth);

    //for construction details
    slTypeProperty.setWidth(strComponentWidth);
    slTypeStructure.setWidth(strComponentWidth);
    tfYearConstruction.setWidth(strComponentWidth);
    tfNoFloors.setWidth(strComponentWidth);
    tfConstQuality.setWidth(strComponentWidth);
    slAllapproval.setWidth(strComponentWidth);
    slIsConstruction.setWidth(strComponentWidth);
    tfReason.setWidth(strComponentWidth);
    tfDynamicConstval1.setWidth(strComponentWidth);
    tfDynamicConstval2.setWidth(strComponentWidth);

    //for land valuation
    tfAreaofLand.setWidth(strComponentWidth);
    tfNorthandSouth.setWidth(strComponentWidth);
    tfMarketRate.setWidth(strComponentWidth);
    tfAdopetdMarketRate.setWidth(strComponentWidth);
    tfFairMarketRate.setWidth(strComponentWidth);
    tfRealizabletRate.setWidth(strComponentWidth);
    tfDistressRate.setWidth(strComponentWidth);
    tfGuidelineRate.setWidth(strComponentWidth);
    tfDynamicValuation1.setWidth(strComponentWidth);
    tfDynamicValuation2.setWidth(strComponentWidth);

    // for applicant Estimate
    lblAppEstimate.setWidth(strEstimateWidth);
    tfAppEstimate.setWidth(strComponentWidth);
    lblDtlsAppEstimate.setWidth(strEstimateWidth);
    tfDtlsAppEstimate.setWidth(strComponentWidth);
    tfDetails1.setWidth(strEstimateWidth);
    tfDetails2.setWidth(strEstimateWidth);
    tfDetails3.setWidth(strEstimateWidth);
    tfDetailVal1.setWidth(strComponentWidth);
    tfDetailVal2.setWidth(strComponentWidth);
    tfDetailVal3.setWidth(strComponentWidth);
    lblTotal.setWidth(strEstimateWidth);
    tfTotalval.setWidth(strComponentWidth);
    tfDynamicAppEstimate1.setWidth(strEstimateWidth);
    tfDynamicAppEstimate2.setWidth(strComponentWidth);
    tfDynamicAppEstimate3.setWidth(strEstimateWidth);
    tfDynamicAppEstimate4.setWidth(strComponentWidth);
    tfDynamicAppEstimate5.setWidth(strEstimateWidth);
    tfDynamicAppEstimate6.setWidth(strComponentWidth);
    tfDynamicAppEstimate7.setWidth(strEstimateWidth);
    tfDynamicAppEstimate8.setWidth(strComponentWidth);
    //for applicant Reasonable
    lblAppReasonable.setWidth(strEstimateWidth);
    slAppReasonable.setWidth(strComponentWidth);
    lblReasonEstimate.setWidth(strEstimateWidth);
    tfReasonEstimateVal.setWidth(strComponentWidth);
    lblDtlsAppReasonable.setWidth(strEstimateWidth);
    tfDtlsAppReasonable.setWidth(strComponentWidth);
    tfDetailsReason1.setWidth(strEstimateWidth);
    tfDetailsReason2.setWidth(strEstimateWidth);
    tfDetailsReason3.setWidth(strEstimateWidth);
    tfDetailReasonVal1.setWidth(strComponentWidth);
    tfDetailReasonVal2.setWidth(strComponentWidth);
    tfDetailReasonVal3.setWidth(strComponentWidth);
    lblReasonTotal.setWidth(strEstimateWidth);
    tfReasonTotalval.setWidth(strComponentWidth);
    tfDynamicAppReason1.setWidth(strEstimateWidth);
    tfDynamicAppReason2.setWidth(strComponentWidth);
    tfDynamicAppReason3.setWidth(strEstimateWidth);
    tfDynamicAppReason4.setWidth(strComponentWidth);

    //for earth quake
    slEarthQuake.setWidth(strComponentWidth);
    tfDynamicEarthquake1.setWidth(strComponentWidth);
    tfDynamicEarthquake2.setWidth(strComponentWidth);

    tfOwnerName.setWidth(strComponentWidth);
    tfOwnerAddress.setWidth(strComponentWidth);
    tfOwnerAddress.setHeight("150px");
    tfLandMark.setWidth(strComponentWidth);
    tfPropertyAddress.setWidth(strComponentWidth);
    tfPropertyAddress.setHeight("130px");
    tfDynamicAsset1.setWidth(strComponentWidth);
    tfDynamicAsset2.setWidth(strComponentWidth);

    tfZone.setWidth(strComponentWidth);
    tfSRO.setWidth(strComponentWidth);
    tfVillage.setWidth(strComponentWidth);
    tfRevnueDist.setWidth(strComponentWidth);
    tfTalukName.setWidth(strComponentWidth);
    tfStreetName.setWidth(strComponentWidth);
    slStreetSerNo.setWidth(strComponentWidth);
    slStreetSerNo.setHeight("25");
    tfStreetName.setHeight("25");
    tfGuidelineValue.setWidth(strComponentWidth);
    tfGuidelineValueMatric.setWidth(strComponentWidth);
    slClassification.setWidth(strComponentWidth);
    // for details of plan approval
    slLandandBuilding.setHeight("25");
    slBuilding.setHeight("25");
    tfBuilding.setHeight("25");
    tfLandandBuilding.setHeight("25");
    tfLandandBuilding.setWidth(strComponentWidth);
    tfBuilding.setWidth(strComponentWidth);
    slLandandBuilding.setWidth(strComponentWidth);
    slBuilding.setWidth(strComponentWidth);
    tfPlanApprovedBy.setWidth(strComponentWidth);
    dfLicenseFrom.setWidth(strComponentWidth);
    tfDynamicPlanApproval1.setWidth(strComponentWidth);
    slIsLicenceForced.setWidth(strComponentWidth);
    slAllApprovalRecved.setWidth(strComponentWidth);
    slConstAsperAppPlan.setWidth(strComponentWidth);
    tfDynamicPlanApproval2.setWidth(strComponentWidth);
    //for detsails of plan approval construction
    slLandBuildConst.setHeight("25");
    tfLandBuildConst.setHeight("25");
    slBuildConst.setHeight("25");
    tfBuildConst.setHeight("25");
    slLandBuildConst.setWidth(strComponentWidth);
    tfLandBuildConst.setWidth(strComponentWidth);
    slBuildConst.setWidth(strComponentWidth);
    tfBuildConst.setWidth(strComponentWidth);
    tfPlanApproveConst.setWidth(strComponentWidth);
    slAllApprovalRecvedConst.setWidth(strComponentWidth);
    slConstAsperAppPlanConst.setWidth(strComponentWidth);
    tfDynamicConstPlanApp1.setWidth(strComponentWidth);
    tfDynamicConstPlanApp2.setWidth(strComponentWidth);

    //for Build details
    slTypeBuilding.setWidth(strComponentWidth);
    slBuildStructure.setWidth(strComponentWidth);
    tfYearConstructionBuild.setWidth(strComponentWidth);
    tfBuildNoFloors.setWidth(strComponentWidth);
    slExterior.setWidth(strComponentWidth);
    slInterior.setWidth(strComponentWidth);
    tfLifeAge.setWidth(strComponentWidth);
    tfFutureLife.setWidth(strComponentWidth);
    tfDetailsPlan.setWidth(strComponentWidth);
    slDeviation.setWidth(strComponentWidth);
    tfDtlsDeviation.setWidth(strComponentWidth);
    tfDynamicBuildval1.setWidth(strComponentWidth);
    tfDynamicBuildval2.setWidth(strComponentWidth);
    //Details of valuation
    lblParticular.setWidth(strWidth);
    lblPlinthArea.setWidth(strLblWidth);
    lblRoofHt.setWidth(strLblWidth);
    lblBuildAge.setWidth(strWidth);
    lblRate.setWidth(strWidth);
    lblReplace.setWidth(strWidth);
    lblDepreciation.setWidth(strWidth);
    lblNetvalue.setWidth(strWidth);
    //set Null representation
    tfEvaluationNumber.setNullRepresentation("");
    tfBankBranch.setNullSelectionAllowed(false);
    tfEvaluationPurpose.setNullRepresentation("");
    tfValuatedBy.setNullRepresentation("");
    tfVerifiedBy.setNullRepresentation("");
    tfDynamicEvaluation1.setNullRepresentation("");
    tfDynamicEvaluation2.setNullRepresentation("");

    tfCustomerName.setNullRepresentation("");
    slPropertyDesc.setNullSelectionAllowed(false);
    tfCustomerAddr.setNullRepresentation("");
    tfCustomerAddr.setHeight("130px");
    slPropertyDesc.setNullSelectionAllowed(false);

    //for matching boundary
    slMatchingBoundary.setNullSelectionAllowed(false);
    slPlotDemarcated.setNullSelectionAllowed(false);
    slApproveLandUse.setNullSelectionAllowed(false);
    slTypeofProperty.setNullSelectionAllowed(false);
    tfDynamicmatching1.setNullRepresentation("");
    tfDynamicmatching2.setNullRepresentation("");

    //room
    tfNoofRooms.setNullRepresentation("");
    tfLivingDining.setNullRepresentation("");
    tfBedRooms.setNullRepresentation("");
    tfKitchen.setNullRepresentation("");
    tfToilets.setNullRepresentation("");
    tfDynamicRooms1.setNullRepresentation("");
    tfDynamicRooms2.setNullRepresentation("");

    //floor
    tfTotNoofFloors.setNullRepresentation("");
    tfPropertyLocated.setNullRepresentation("");
    tfApproxAgeofBuilding.setNullRepresentation("");
    tfResidualAgeofBuilding.setNullRepresentation("");
    slTypeofStructure.setNullSelectionAllowed(false);
    tfDynamicFloors1.setNullRepresentation("");
    tfDynamicFloors2.setNullRepresentation("");

    //tenure/occupancy
    tfStatusofTenure.setNullRepresentation("");
    slOwnedorRent.setNullSelectionAllowed(false);
    tfNoOfYears.setNullRepresentation("");
    tfRelationship.setNullRepresentation("");
    tfDynamicTenure1.setNullRepresentation("");
    tfDynamicTenure2.setNullRepresentation("");

    //for construction
    tfStageofConst.setNullRepresentation("");
    tfDynamicConstruction1.setNullRepresentation("");
    tfDynamicConstruction2.setNullRepresentation("");

    //for violation
    tfAnyViolation.setNullRepresentation("");
    tfDynamicViolation1.setNullRepresentation("");
    tfDynamicViolation2.setNullRepresentation("");

    // for cost of construction
    tfCostConstruction.setNullRepresentation("");
    tfDynamicCostConst1.setNullRepresentation("");
    tfDynamicCostConst2.setNullRepresentation("");
    tfDynamicCostConst3.setNullRepresentation("");
    tfDynamicCostConst4.setNullRepresentation("");
    tfDynamicCostConst5.setNullRepresentation("");
    tfDynamicCostConst6.setNullRepresentation("");
    tfDynamicCostConst7.setNullRepresentation("");
    tfDynamicCostConst8.setNullRepresentation("");
    tfDynamicCostConst9.setNullRepresentation("");
    tfDynamicCostConst10.setNullRepresentation("");

    //for area details
    tfSiteArea.setNullRepresentation("");
    tfPlinthArea.setNullRepresentation("");
    tfCarpetArea.setNullRepresentation("");
    tfSalableArea.setNullRepresentation("");
    tfRemarks.setNullRepresentation("");
    tfRemarks.setHeight("95px");
    tfDynamicAreaDetail1.setNullRepresentation("");
    tfDynamicAreaDetail2.setNullRepresentation("");

    //for construction details
    slTypeProperty.setNullSelectionAllowed(false);
    slTypeStructure.setNullSelectionAllowed(false);
    tfYearConstruction.setNullRepresentation("");
    tfNoFloors.setNullRepresentation("");
    tfConstQuality.setNullRepresentation("");
    slAllapproval.setNullSelectionAllowed(false);
    slIsConstruction.setNullSelectionAllowed(false);
    tfReason.setNullRepresentation("");
    tfDynamicConstval1.setNullRepresentation("");
    tfDynamicConstval2.setNullRepresentation("");

    //for land valuation
    tfAreaofLand.setNullRepresentation("");
    tfNorthandSouth.setNullRepresentation("");
    tfMarketRate.setNullRepresentation("");
    tfAdopetdMarketRate.setNullRepresentation("");
    tfFairMarketRate.setNullRepresentation("");
    tfRealizabletRate.setNullRepresentation("");
    tfDistressRate.setNullRepresentation("");
    tfGuidelineRate.setNullRepresentation("");
    tfDynamicValuation1.setNullRepresentation("");
    tfDynamicValuation2.setNullRepresentation("");

    // for applicant Estimate
    tfAppEstimate.setNullRepresentation("");
    tfDtlsAppEstimate.setNullRepresentation("");
    tfDetails1.setNullRepresentation("");
    tfDetails2.setNullRepresentation("");
    tfDetails3.setNullRepresentation("");
    tfDetailVal1.setNullRepresentation("");
    tfDetailVal2.setNullRepresentation("");
    tfDetailVal3.setNullRepresentation("");
    tfTotalval.setNullRepresentation("");
    tfDynamicAppEstimate1.setNullRepresentation("");
    tfDynamicAppEstimate2.setNullRepresentation("");
    tfDynamicAppEstimate3.setNullRepresentation("");
    tfDynamicAppEstimate4.setNullRepresentation("");
    tfDynamicAppEstimate5.setNullRepresentation("");
    tfDynamicAppEstimate6.setNullRepresentation("");
    tfDynamicAppEstimate7.setNullRepresentation("");
    tfDynamicAppEstimate8.setNullRepresentation("");

    //for applicant Reasonable
    lblAppReasonable.setWidth(strEstimateWidth);
    slAppReasonable.setNullSelectionAllowed(false);
    tfReasonEstimateVal.setNullRepresentation("");
    tfDtlsAppReasonable.setNullRepresentation("");
    tfDetailsReason1.setNullRepresentation("");
    tfDetailsReason2.setNullRepresentation("");
    tfDetailsReason3.setNullRepresentation("");
    tfDetailReasonVal1.setNullRepresentation("");
    tfDetailReasonVal2.setNullRepresentation("");
    tfDetailReasonVal3.setNullRepresentation("");
    tfReasonTotalval.setNullRepresentation("");
    tfDynamicAppReason1.setNullRepresentation("");
    tfDynamicAppReason2.setNullRepresentation("");
    tfDynamicAppReason3.setWidth(strEstimateWidth);
    tfDynamicAppReason4.setNullRepresentation("");

    //for earth quake
    slEarthQuake.setNullSelectionAllowed(false);
    tfDynamicEarthquake1.setNullRepresentation("");
    tfDynamicEarthquake2.setNullRepresentation("");

    tfOwnerName.setNullRepresentation("");
    tfOwnerAddress.setNullRepresentation("");
    tfLandMark.setNullRepresentation("");
    tfPropertyAddress.setNullRepresentation("");
    tfDynamicAsset1.setNullRepresentation("");
    tfDynamicAsset2.setNullRepresentation("");

    tfZone.setNullRepresentation("");
    tfSRO.setNullRepresentation("");
    tfVillage.setNullRepresentation("");
    tfRevnueDist.setNullRepresentation("");
    tfTalukName.setNullRepresentation("");
    tfStreetName.setNullRepresentation("");
    tfGuidelineValue.setNullRepresentation("");
    tfGuidelineValueMatric.setNullRepresentation("");
    slClassification.setNullRepresentation("");

    // for details of plan approval
    slLandandBuilding.setNullSelectionAllowed(false);
    slBuilding.setNullSelectionAllowed(false);
    tfLandandBuilding.setNullRepresentation("");
    tfBuilding.setNullRepresentation("");
    tfPlanApprovedBy.setNullRepresentation("");
    tfDynamicPlanApproval1.setNullRepresentation("");
    slIsLicenceForced.setNullSelectionAllowed(false);
    slAllApprovalRecved.setNullSelectionAllowed(false);
    slConstAsperAppPlan.setNullSelectionAllowed(false);
    tfDynamicPlanApproval2.setNullRepresentation("");
    dfLicenseFrom.setNullRepresentation("");
    //for details of plan approval construction
    slLandBuildConst.setNullSelectionAllowed(false);
    tfLandBuildConst.setNullRepresentation("");
    slBuildConst.setNullSelectionAllowed(false);
    tfBuildConst.setNullRepresentation("");
    tfPlanApproveConst.setNullRepresentation("");
    slAllApprovalRecvedConst.setNullSelectionAllowed(false);
    slConstAsperAppPlanConst.setNullSelectionAllowed(false);
    tfDynamicConstPlanApp1.setNullRepresentation("");
    tfDynamicConstPlanApp2.setNullRepresentation("");
    //for Build details
    slTypeBuilding.setNullSelectionAllowed(false);
    slBuildStructure.setNullSelectionAllowed(false);
    tfYearConstructionBuild.setNullRepresentation("");
    tfBuildNoFloors.setNullRepresentation("");
    slExterior.setNullSelectionAllowed(false);
    slInterior.setNullSelectionAllowed(false);
    tfLifeAge.setNullRepresentation("");
    tfFutureLife.setNullRepresentation("");
    tfDetailsPlan.setNullRepresentation("");
    slDeviation.setNullSelectionAllowed(false);
    tfDtlsDeviation.setNullRepresentation("");
    tfDynamicBuildval1.setNullRepresentation("");
    tfDynamicBuildval2.setNullRepresentation("");

    // for dynamic
    btnDynamicEvaluation1.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicEvaluation1.setStyleName(Runo.BUTTON_LINK);
    btnDynamicCustomer.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicCustomer.setStyleName(Runo.BUTTON_LINK);
    btnDynamicAsset.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicAsset.setStyleName(Runo.BUTTON_LINK);
    btnDynamicBuildVal.setStyleName(Runo.BUTTON_LINK);
    btnDynamicBuildVal.setIcon(new ThemeResource(Common.strAddIcon));

    btnAddLegalDoc.setIcon(new ThemeResource(Common.strAddIcon));
    btnAddNorDoc.setIcon(new ThemeResource(Common.strAddIcon));
    btnAddNorDoc.setStyleName(Runo.BUTTON_LINK);
    btnAddLegalDoc.setStyleName(Runo.BUTTON_LINK);
    btnAddAdjoinProperty.setIcon(new ThemeResource(Common.strAddIcon));
    btnAddAdjoinProperty.setStyleName(Runo.BUTTON_LINK);
    btnAddDimension.setIcon(new ThemeResource(Common.strAddIcon));
    btnAddDimension.setStyleName(Runo.BUTTON_LINK);

    btnAddValDtls.setStyleName(Runo.BUTTON_LINK);
    btnAddValDtls.setIcon(new ThemeResource(Common.strAddIcon));

    btnDynamicExtra.setStyleName(Runo.BUTTON_LINK);
    btnDynamicExtra.setIcon(new ThemeResource(Common.strAddIcon));

    btnDynamicAdditional.setStyleName(Runo.BUTTON_LINK);
    btnDynamicAdditional.setIcon(new ThemeResource(Common.strAddIcon));

    btnDynamicMiscell.setStyleName(Runo.BUTTON_LINK);
    btnDynamicMiscell.setIcon(new ThemeResource(Common.strAddIcon));

    btnDynamicServices.setStyleName(Runo.BUTTON_LINK);
    btnDynamicServices.setIcon(new ThemeResource(Common.strAddIcon));
    btnAddPlinth.setIcon(new ThemeResource(Common.strAddIcon));
    btnAddPlinth.setStyleName(Runo.BUTTON_LINK);
    btnAddPlinthNew.setIcon(new ThemeResource(Common.strAddIcon));
    btnAddPlinthNew.setStyleName(Runo.BUTTON_LINK);

    btnAddRoofHt.setIcon(new ThemeResource(Common.strAddIcon));
    btnAddRoofHt.setStyleName(Runo.BUTTON_LINK);

    btnDynamicTenure.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicTenure.setStyleName(Runo.BUTTON_LINK);
    btnDynamicmatching.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicmatching.setStyleName(Runo.BUTTON_LINK);
    btnDynamicRooms.setStyleName(Runo.BUTTON_LINK);
    btnDynamicRooms.setIcon(new ThemeResource(Common.strAddIcon));

    btnDynamicFloor.setStyleName(Runo.BUTTON_LINK);
    btnDynamicFloor.setIcon(new ThemeResource(Common.strAddIcon));

    btnDynamicConstruction.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicConstruction.setStyleName(Runo.BUTTON_LINK);
    btnDynamicViolation.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicViolation.setStyleName(Runo.BUTTON_LINK);
    btnDynamicAreaDetail.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicAreaDetail.setStyleName(Runo.BUTTON_LINK);
    btnDynamicConstVal.setStyleName(Runo.BUTTON_LINK);
    btnDynamicConstVal.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicPlanApproval.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicPlanApproval.setStyleName(Runo.BUTTON_LINK);
    btnDynamicConstPlan.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicConstPlan.setStyleName(Runo.BUTTON_LINK);
    btnAddBuildSpec.setStyleName(Runo.BUTTON_LINK);
    btnAddBuildSpec.setIcon(new ThemeResource(Common.strAddIcon));

    btnAddBuildSpecNew.setStyleName(Runo.BUTTON_LINK);
    btnAddBuildSpecNew.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicAppEstimate.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicAppEstimate.setStyleName(Runo.BUTTON_LINK);

    btnDynamicAppReason.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicAppReason.setStyleName(Runo.BUTTON_LINK);

    btnDynamicEarthQuake.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicEarthQuake.setStyleName(Runo.BUTTON_LINK);

    btnDynamicCostConst.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicCostConst.setStyleName(Runo.BUTTON_LINK);

    btnAddOwner.setIcon(new ThemeResource(Common.strAddIcon));
    btnAddOwner.setStyleName(Runo.BUTTON_LINK);

    btnDynamicValuation.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicValuation.setStyleName(Runo.BUTTON_LINK);

    btnAddGuideline.setStyleName(Runo.BUTTON_LINK);
    btnAddGuideline.setIcon(new ThemeResource(Common.strAddIcon));

    tfStatusofTenure.setValue(Common.strNA);
    tfRelationship.setValue(Common.strNA);
    tfStageofConst.setValue(Common.strNA);
    tfPlinthArea.setValue(Common.strNil);
    tfCarpetArea.setValue(Common.strNil);
    tfRemarks.setValue(Common.strNil);

}

From source file:com.gnts.pem.txn.synd.SyndConstructionBuilding.java

public void buttonClick(ClickEvent event) {
    notifications.close();//from   www. j ava 2 s . co m
    if (btnAddNorDoc == event.getButton()) {

        panelNormalDocumentDetails.addComponent(new ComponentIteratorNormlDoc(null, null, "", ""));
    }
    if (btnAddOwner == event.getButton()) {

        layoutOwnerDetails1.addComponent(new ComponentIterOwnerDetails("", ""));
    }
    if (btnAddPlinth == event.getButton()) {

        layoutPlintharea.addComponent(new ComponentIterPlinthArea("", "", ""));
    }
    if (btnAddPlinthNew == event.getButton()) {

        vlPlinthAreaNew.addComponent(new ComponentIterPlinthArea("", "", ""));
    }
    if (btnAddLegalDoc == event.getButton()) {

        panelLegalDocumentDetails.addComponent(new ComponentIteratorLegalDoc("", "", null));
    }

    if (btnAddAdjoinProperty == event.getButton()) {

        panelAdjoinProperties.addComponent(new ComponentIteratorAdjoinProperty(null, true, true, true));
    }

    if (btnAddDimension == event.getButton()) {
        panelDimension.addComponent(new ComponentIterDimensionofPlot(null, true, true, true));
    }
    if (btnAddGuideline == event.getButton()) {

        layoutGuideline.addComponent(new ComponentIterGuideline("", "", "", ""));
    }
    if (btnAdd == event.getButton()) {
        btnSave.setVisible(true);
        btnCancel.setVisible(true);
        btnSubmit.setVisible(true);
        tablePanel.setVisible(false);
        searchPanel.setVisible(false);
        mainPanel.setVisible(true);
        headerid = beanEvaluation.getNextSequnceId("seq_pem_evaldtls_docid");

        resetAllFieldsFields();
        lblAddEdit.setValue("&nbsp;>&nbsp;Add New");
        lblAddEdit.setVisible(true);
        lblFormTittle.setVisible(false);
        hlBreadCrumbs.setVisible(true);
    }
    if (btnAddRoofHt == event.getButton()) {
        layoutRoofHeight.addComponent(new ComponentIterRoofHeight("", ""));
    }
    if (btnAddBuildSpec == event.getButton()) {

        panelBuildSpecfication.addComponent(new ComponentIterBuildingSpecfication(null, true, true, true));
    }
    if (btnAddBuildSpecNew == event.getButton()) {

        panelBuildSpecficationNew.addComponent(new ComponentIterBuildingSpecfication(null, true, true, true));
    }
    if (btnEdit == event.getButton()) {
        btnSave.setVisible(true);
        btnCancel.setVisible(true);
        btnSubmit.setVisible(true);
        tablePanel.setVisible(false);
        searchPanel.setVisible(false);
        mainPanel.setVisible(true);
        resetAllFieldsFields();
        editDetails();
        lblAddEdit.setValue("&nbsp;>&nbsp;Modify");
        lblAddEdit.setVisible(true);
        lblFormTittle.setVisible(false);
        hlBreadCrumbs.setVisible(true);

    }
    if (btnAddValDtls == event.getButton()) {

        ValuationDetailsList obj = new ValuationDetailsList();
        layoutValuationDetails.addComponent(new ComponenetIterValuationDetails(obj));
    }
    if (btnDynamicExtra == event.getButton()) {
        layoutExtraItems.addComponent(new ComponentIterExtraItems(null, ""));
    }
    if (btnDynamicAdditional == event.getButton()) {

        layoutAdditionItem.addComponent(new ComponentIterAdditionalItems(null, ""));
    }
    if (btnDynamicMiscell == event.getButton()) {

        layoutMiscellaneous.addComponent(new ComponentIterMiscellaneous(null, ""));
    }
    if (btnDynamicServices == event.getButton()) {

        layoutServices.addComponent(new ComponentIerServices(null, ""));
    }
    if (btnDynamicEvaluation1 == event.getButton()) {

        strSelectedPanel = "1";
        showSubWindow();

    }

    if (btnDynamicCustomer == event.getButton()) {
        strSelectedPanel = "2";
        showSubWindow();

    }

    if (btnDynamicAsset == event.getButton()) {
        strSelectedPanel = "3";
        showSubWindow();

    }

    if (btnDynamicTenure == event.getButton()) {
        strSelectedPanel = "4";
        showSubWindow();

    }

    if (btnDynamicmatching == event.getButton()) {
        strSelectedPanel = "5";
        showSubWindow();

    }
    if (btnDynamicConstruction == event.getButton()) {
        strSelectedPanel = "6";
        showSubWindow();

    }
    if (btnDynamicViolation == event.getButton()) {
        strSelectedPanel = "7";
        showSubWindow();

    }
    if (btnDynamicAreaDetail == event.getButton()) {
        strSelectedPanel = "8";
        showSubWindow();

    }
    if (btnDynamicValuation == event.getButton()) {
        strSelectedPanel = "9";
        showSubWindow();

    }
    if (btnDynamicRooms == event.getButton()) {
        strSelectedPanel = "10";
        showSubWindow();

    }
    if (btnDynamicFloor == event.getButton()) {
        strSelectedPanel = "11";
        showSubWindow();

    }
    if (btnDynamicConstVal == event.getButton()) {
        strSelectedPanel = "12";
        showSubWindow();

    }
    if (btnDynamicAppEstimate == event.getButton()) {
        if (layoutApplicantEstimate2.isVisible()) {
            layoutApplicantEstimate3.setVisible(true);

        } else {
            layoutApplicantEstimate3.setVisible(false);
        }
        if (layoutApplicantEstimate1.isVisible()) {
            layoutApplicantEstimate2.setVisible(true);

        } else {
            layoutApplicantEstimate2.setVisible(false);
        }
    }

    if (btnDynamicAppReason == event.getButton()) {
        strSelectedPanel = "14";
        showSubWindow();

    }
    if (btnDynamicEarthQuake == event.getButton()) {
        strSelectedPanel = "15";
        showSubWindow();

    }
    if (btnDynamicCostConst == event.getButton()) {
        if (layoutCostConstruction1.isVisible()) {
            layoutCostConstruction2.setVisible(true);
        } else {
            layoutCostConstruction2.setVisible(false);
        }
        if (layoutCost.isVisible()) {
            layoutCostConstruction1.setVisible(true);

        } else {
            layoutCostConstruction1.setVisible(false);
        }

    }
    if (btnDynamicPlanApproval == event.getButton()) {
        strSelectedPanel = "17";
        showSubWindow();

    }
    if (btnDynamicBuildVal == event.getButton()) {
        strSelectedPanel = "18";
        showSubWindow();

    }
    if (btnDynamicConstPlan == event.getButton()) {
        strSelectedPanel = "19";
        showSubWindow();

    }

    if (myButton == event.getButton()) {

        if (tfCaption.getValue() != null && tfCaption.getValue().trim().length() > 0) {

            if (strSelectedPanel.equals("1")) {
                if (tfDynamicEvaluation1.isVisible()) {
                    tfDynamicEvaluation2.setCaption(tfCaption.getValue());
                    tfDynamicEvaluation2.setVisible(true);
                } else {
                    tfDynamicEvaluation1.setCaption(tfCaption.getValue());
                    tfDynamicEvaluation1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("2")) {
                if (tfDynamicCustomer1.isVisible()) {
                    tfDynamicCustomer2.setCaption(tfCaption.getValue());
                    tfDynamicCustomer2.setVisible(true);
                } else {
                    tfDynamicCustomer1.setCaption(tfCaption.getValue());
                    tfDynamicCustomer1.setVisible(true);
                }

            } else if (strSelectedPanel.equals("3")) {
                if (tfDynamicAsset1.isVisible()) {
                    tfDynamicAsset2.setCaption(tfCaption.getValue());
                    tfDynamicAsset2.setVisible(true);
                } else {
                    tfDynamicAsset1.setCaption(tfCaption.getValue());
                    tfDynamicAsset1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("4")) {
                if (tfDynamicTenure1.isVisible()) {
                    tfDynamicTenure2.setCaption(tfCaption.getValue());
                    tfDynamicTenure2.setVisible(true);
                } else {
                    tfDynamicTenure1.setCaption(tfCaption.getValue());
                    tfDynamicTenure1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("5")) {
                if (tfDynamicmatching1.isVisible()) {
                    tfDynamicmatching2.setCaption(tfCaption.getValue());
                    tfDynamicmatching2.setVisible(true);
                } else {
                    tfDynamicmatching1.setCaption(tfCaption.getValue());
                    tfDynamicmatching1.setVisible(true);
                }
            }

            else if (strSelectedPanel.equals("6")) {
                if (tfDynamicConstruction1.isVisible()) {
                    tfDynamicConstruction2.setCaption(tfCaption.getValue());
                    tfDynamicConstruction2.setVisible(true);
                } else {
                    tfDynamicConstruction1.setCaption(tfCaption.getValue());
                    tfDynamicConstruction1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("7")) {
                if (tfDynamicViolation1.isVisible()) {
                    tfDynamicViolation2.setCaption(tfCaption.getValue());
                    tfDynamicViolation2.setVisible(true);
                } else {
                    tfDynamicViolation1.setCaption(tfCaption.getValue());
                    tfDynamicViolation1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("8")) {
                if (tfDynamicAreaDetail1.isVisible()) {
                    tfDynamicAreaDetail2.setCaption(tfCaption.getValue());
                    tfDynamicAreaDetail2.setVisible(true);
                } else {
                    tfDynamicAreaDetail1.setCaption(tfCaption.getValue());
                    tfDynamicAreaDetail1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("9")) {
                if (tfDynamicValuation1.isVisible()) {
                    tfDynamicValuation2.setCaption(tfCaption.getValue());
                    tfDynamicValuation2.setVisible(true);
                } else {
                    tfDynamicValuation1.setCaption(tfCaption.getValue());
                    tfDynamicValuation1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("10")) {
                if (tfDynamicRooms1.isVisible()) {
                    tfDynamicRooms2.setCaption(tfCaption.getValue());
                    tfDynamicRooms2.setVisible(true);
                } else {
                    tfDynamicRooms1.setCaption(tfCaption.getValue());
                    tfDynamicRooms1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("11")) {
                if (tfDynamicFloors1.isVisible()) {
                    tfDynamicFloors2.setCaption(tfCaption.getValue());
                    tfDynamicFloors2.setVisible(true);
                } else {
                    tfDynamicFloors1.setCaption(tfCaption.getValue());
                    tfDynamicFloors1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("12")) {
                if (tfDynamicConstval1.isVisible()) {
                    tfDynamicConstval2.setCaption(tfCaption.getValue());
                    tfDynamicConstval2.setVisible(true);
                } else {
                    tfDynamicConstval1.setCaption(tfCaption.getValue());
                    tfDynamicConstval1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("14")) {
                if (tfDynamicAppReason1.isVisible()) {
                    tfDynamicAppReason3.setValue(tfCaption.getValue());
                    tfDynamicAppReason3.setVisible(true);
                } else {
                    tfDynamicAppReason1.setValue(tfCaption.getValue());
                    tfDynamicAppReason1.setVisible(true);

                }
                if (tfDynamicAppReason2.isVisible()) {
                    tfDynamicAppReason4.setValue("");
                    tfDynamicAppReason4.setVisible(true);
                } else {
                    tfDynamicAppReason2.setValue("");
                    tfDynamicAppReason2.setVisible(true);
                }
            } else if (strSelectedPanel.equals("15")) {
                if (tfDynamicEarthquake1.isVisible()) {
                    tfDynamicEarthquake2.setCaption(tfCaption.getValue());
                    tfDynamicEarthquake2.setVisible(true);
                } else {
                    tfDynamicEarthquake1.setCaption(tfCaption.getValue());
                    tfDynamicEarthquake1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("17")) {
                if (tfDynamicPlanApproval1.isVisible()) {
                    tfDynamicPlanApproval2.setCaption(tfCaption.getValue());
                    tfDynamicPlanApproval2.setVisible(true);
                } else {
                    tfDynamicPlanApproval1.setCaption(tfCaption.getValue());
                    tfDynamicPlanApproval1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("18")) {
                if (tfDynamicBuildval1.isVisible()) {
                    tfDynamicBuildval2.setCaption(tfCaption.getValue());
                    tfDynamicBuildval2.setVisible(true);
                } else {
                    tfDynamicBuildval1.setCaption(tfCaption.getValue());
                    tfDynamicBuildval1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("19")) {
                if (tfDynamicConstPlanApp1.isVisible()) {
                    tfDynamicConstPlanApp2.setCaption(tfCaption.getValue());
                    tfDynamicConstPlanApp2.setVisible(true);
                } else {
                    tfDynamicConstPlanApp1.setCaption(tfCaption.getValue());
                    tfDynamicConstPlanApp1.setVisible(true);
                }
            }

        }
        mywindow.close();
    }

    if (btnSave == event.getButton()) {
        setComponentError();
        if (tfEvaluationNumber.isValid() && tfBankBranch.isValid() && tfEvaluationPurpose.isValid()
                && dfDateofValuation.isValid()) {

            saveEvaluationDetails();
        }
        //btnSave.setVisible(false);
    }
    if (btnSubmit == event.getButton()) {
        setComponentError();
        if (tfEvaluationNumber.isValid() && tfBankBranch.isValid() && tfEvaluationPurpose.isValid()
                && dfDateofValuation.isValid()) {
            saveEvaluationDetails();
            updateEvaluationDetails();
            btnSubmit.setEnabled(false);
            btnSave.setEnabled(false);
        }
        //   saveExcel.setVisible(true);

    }
    if (btnCancel == event.getButton()) {
        btnSave.setVisible(false);
        btnCancel.setVisible(false);
        btnSubmit.setVisible(false);
        //saveExcel.setVisible(false);
        btnSave.setEnabled(true);
        btnSubmit.setEnabled(true);
        tablePanel.setVisible(true);
        searchPanel.setVisible(true);
        mainPanel.setVisible(false);
        btnEdit.setEnabled(false);
        btnAdd.setEnabled(true);
        populateAndConfig(false);
        lblFormTittle.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;Search");
        lblNotificationIcon.setIcon(null);
        lblSaveNotification.setValue("");
        lblFormTittle.setVisible(true);
        hlBreadCrumbs.setVisible(false);
        lblAddEdit.setVisible(false);
        btnView.setEnabled(false);

        hlFileDownloadLayout.removeAllComponents();
        hlFileDownloadLayout.addComponent(btnDownload);
        getExportTableDetails();

    }
    if (btnSearch == event.getButton()) {
        populateAndConfig(true);
        if (total == 0) {
            lblNotificationIcon.setIcon(new ThemeResource("img/msg_info.png"));
            lblSaveNotification.setValue("No Records found");
        } else {
            lblNotificationIcon.setIcon(null);
            lblSaveNotification.setValue("");
        }
        hlFileDownloadLayout.removeAllComponents();
        hlFileDownloadLayout.addComponent(btnDownload);
        getExportTableDetails();
    }
    if (btnReset == event.getButton()) {
        tfSearchEvalNumber.setValue("");
        dfSearchEvalDate.setValue(null);
        tfSearchCustomer.setValue("");
        tfSearchBankbranch.setValue(null);
        populateAndConfig(false);
    } else if (btnBack == event.getButton()) {
        resetAllFieldsFields();
        btnSave.setVisible(false);
        btnCancel.setVisible(false);
        btnSubmit.setVisible(false);
        //saveExcel.setVisible(false);
        tablePanel.setVisible(true);
        searchPanel.setVisible(true);
        mainPanel.setVisible(false);
        btnEdit.setEnabled(false);
        btnAdd.setEnabled(true);
        populateAndConfig(false);
        lblFormTittle.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;Search");
        lblNotificationIcon.setIcon(null);
        lblSaveNotification.setValue("");
        lblFormTittle.setVisible(true);
        hlBreadCrumbs.setVisible(false);
        lblAddEdit.setVisible(false);
        btnView.setEnabled(false);

    }
    /*else if (btnView == event.getButton()) {
            
       StreamResource sr = getPDFStream();
       FileDownloader fileDownloader = new FileDownloader(sr);
       fileDownloader.extend(btnView);
            
    }
    */ }

From source file:com.gnts.pem.txn.synd.SyndFlat.java

License:Open Source License

@SuppressWarnings("deprecation")
void populateAndConfig(boolean search) {
    try {//w w  w .  j a  v a  2  s  . c  om
        tblEvalDetails.removeAllItems();
        tblEvalDetails.setImmediate(true);
        List<TPemCmEvalDetails> evalList = null;
        evalList = new ArrayList<TPemCmEvalDetails>();
        if (search) {
            String evalno = tfSearchEvalNumber.getValue();
            String customer = tfSearchCustomer.getValue();
            String bankbranch = (String) tfSearchBankBranch.getValue();
            evalList = beanEvaluation.getSearchEvalDetailnList(null, evalno, null, customer, bankbranch,
                    selectedBankid, selectCompanyid, null);
        } else {

            evalList = beanEvaluation.getSearchEvalDetailnList(selectedFormName, null, null, null, null,
                    selectedBankid, selectCompanyid, null);
            total = evalList.size();
        }
        if (total == 0) {
            lblNotificationIcon.setIcon(new ThemeResource("img/msg_info.png"));
            lblSaveNotification.setValue("No Records found");
        } else {
            lblNotificationIcon.setIcon(null);
            lblSaveNotification.setValue("");
        }
        lblNoofRecords.setValue(
                "<font size=\"2\" color=\"black\">No.of Records:</font> <font size=\"2\" color=\"#1E90FF\"> "
                        + total + "</font>");

        beans = new BeanItemContainer<TPemCmEvalDetails>(TPemCmEvalDetails.class);
        beans.addAll(evalList);
        btnEdit.setEnabled(false);
        tblEvalDetails.setContainerDataSource(beans);
        tblEvalDetails.setSelectable(true);
        tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
        tblEvalDetails.setVisibleColumns(new Object[] { "evalNo", "docDate", "bankBranch", "custName",
                "docStatus", "lastUpdtedBy", "lastUpdateDt" });
        tblEvalDetails.setColumnHeaders(new String[] { "Evaluation Number", "Evaluation Date", "Bank Branch",
                "Customer Name", "Status", "Last Updated By", "Last Updated Date" });
        tblEvalDetails.addValueChangeListener(new Property.ValueChangeListener() {
            /**
            * 
            */
            private static final long serialVersionUID = 3729824796823933688L;

            @Override
            public void valueChange(ValueChangeEvent event) {

                StreamResource sr = getPDFStream();

                if (sr != null) {

                    if (filedownloader == null) {
                        filedownloader = new FileDownloader(getPDFStream());
                        filedownloader.extend(btnView);
                    } else {
                        filedownloader.setFileDownloadResource(sr);
                    }
                } else {
                    lblNotificationIcon.setIcon(new ThemeResource("img/msg_info.png"));
                    lblSaveNotification.setValue("No document is there");
                    //   notif.show(Page.getCurrent());
                    if (filedownloader != null) {
                        filedownloader.setFileDownloadResource(null); // reset
                    }

                }

                TPemCmEvalDetails syncList = (TPemCmEvalDetails) event.getProperty().getValue();
                if (syncList != null) {

                    if (syncList.getDocStatus().equals("Draft") || syncList.getDocStatus().equals("Rejected")) {
                        btnEdit.setEnabled(true);
                        btnView.setEnabled(false);
                    } else {
                        btnEdit.setEnabled(false);
                        btnView.setEnabled(true);

                    }
                    btnAdd.setEnabled(false);
                } else {
                    btnEdit.setEnabled(false);
                    btnAdd.setEnabled(true);
                }
            }

        });
        tblEvalDetails.setImmediate(true);
        tblEvalDetails.addItemClickListener(new ItemClickListener() {

            @Override
            public void itemClick(ItemClickEvent event) {
                // TODO Auto-generated method stub
                if (tblEvalDetails.isSelected(event.getItemId())) {

                    btnView.setEnabled(false);
                } else {

                    btnView.setEnabled(true);
                }
            }
        });
    } catch (Exception e) {
        e.printStackTrace();
        logger.info("Error-->" + e);
    }
    getExportTableDetails();
}

From source file:com.gnts.pem.txn.synd.SyndFlat.java

License:Open Source License

private void updateEvaluationDetails() {

    try {/*from ww w  . jav  a2 s  . com*/
        boolean valid = false;
        TPemCmEvalDetails evalobj = new TPemCmEvalDetails();
        evalNumber = tfEvaluationNumber.getValue();
        customer = tfCustomerName.getValue();
        propertyType = "FLAT";
        String basepath = VaadinService.getCurrent().getBaseDirectory().getAbsolutePath();
        File file = new File(
                basepath + "/WEB-INF/PEM-DOCS/" + evalNumber + "_" + customer + "_" + propertyType + ".doc");
        FileInputStream fin = new FileInputStream(file);
        byte fileContent[] = new byte[(int) file.length()];
        fin.read(fileContent);
        fin.close();
        evalobj.setDocId(headerid);
        evalobj.setEvalDoc(fileContent);
        evalobj.setDocStatus(Common.DOC_PENDING);
        evalobj.setEvalNo(tfEvaluationNumber.getValue());
        evalobj.setValuationBy(tfValuatedBy.getValue());
        MPemCmBank bankid = new MPemCmBank();
        bankid.setBankId(selectedBankid);
        evalobj.setBankId(bankid);
        evalobj.setDoctype(screenName);
        evalobj.setCompanyId(selectCompanyid);
        evalobj.setBankBranch((String) slBankBranch.getValue());
        evalobj.setEvalPurpose(tfEvaluationPurpose.getValue());
        evalobj.setEvalDate(dfDateofValuation.getValue());
        evalobj.setCheckedBy(tfVerifiedBy.getValue());
        evalobj.setCheckedDt(dfVerifiedDate.getValue());
        evalobj.setInspectionDt(dfDateofValuation.getValue());
        evalobj.setInspectionBy(tfValuatedBy.getValue());
        evalobj.setLastUpdateDt(new Date());
        evalobj.setLastUpdtedBy(loginusername);
        evalobj.setCustName(tfCustomerName.getValue());
        if (tfDynamicEvaluation1.getValue() != null && tfDynamicEvaluation1.getValue().trim().length() > 0) {
            evalobj.setCustomLbl1(tfDynamicEvaluation1.getCaption());
            evalobj.setCustomValue1(tfDynamicEvaluation1.getValue());
        }
        if (tfDynamicEvaluation2.getValue() != null && tfDynamicEvaluation2.getValue().trim().length() > 0) {
            evalobj.setCustomValue2(tfDynamicEvaluation2.getCaption());
            evalobj.setCustomValue2(tfDynamicEvaluation2.getValue());
        }
        uiflowdata.setEvalDtls(evalobj);
        String numberOnly = tfCostOfConstAsAtSite.getValue().replaceAll("[^\\d.]", "");
        uiflowdata.setAmountInWords(beanEvaluation.getAmountInWords(numberOnly));
        if (numberOnly.trim().length() == 0) {
            numberOnly = "0";
        }
        evalobj.setPropertyValue(Double.valueOf(numberOnly));

        if (tfEvaluationNumber.isValid() && slBankBranch.isValid() && tfEvaluationPurpose.isValid()
                && dfDateofValuation.isValid()) {

            if (count == 0) {
                beanEvaluation.saveorUpdateEvalDetails(evalobj);

                valid = true;
            }
            lblNotificationIcon.setIcon(new ThemeResource("img/success_small.png"));
            lblSaveNotification.setValue("Submitted Successfully");
        }

        if (valid) {
            /*populateAndConfig(false);
            resetAllFieldsFields();*/
            btnSubmit.setEnabled(false);
        } else {
            btnSubmit.setComponentError(new UserError("Form is invalid"));
        }
    } catch (Exception e) {
        lblNotificationIcon.setIcon(new ThemeResource("img/failure.png"));
        lblSaveNotification.setValue("Submit failed, please check the data and try again ");
        logger.info("Error on SaveApproveReject Status function--->" + e);
    }
}

From source file:com.gnts.pem.txn.synd.SyndFlat.java

License:Open Source License

void setComponentError() {
    tfEvaluationNumber.setComponentError(null);
    dfDateofValuation.setComponentError(null);
    tfEvaluationPurpose.setComponentError(null);
    slBankBranch.setComponentError(null);
    tfCustomerName.setComponentError(null);
    String Error = "Enter";
    if (tfEvaluationNumber.getValue() == null || tfEvaluationNumber.getValue().trim().length() == 0) {
        tfEvaluationNumber.setComponentError(new UserError("Enter Evaluation Number"));
        Error = Error + " " + "Evaluation number";
    }//from  w ww .j a  v  a2  s. c o  m
    if (dfDateofValuation.getValue() == null) {
        dfDateofValuation.setComponentError(new UserError("Select Evaluation Date"));
        Error = Error + " " + "Evaluation Date";
    }
    if (tfEvaluationPurpose.getValue() == null || tfEvaluationPurpose.getValue().trim().length() == 0) {
        tfEvaluationPurpose.setComponentError(new UserError("Select Evaluation Date"));
        Error = Error + " " + "Evaluation Purpose";
    }
    if (slBankBranch.getValue() == null) {
        slBankBranch.setComponentError(new UserError("Select Bank Branch"));
        Error = Error + " " + "Bank Branch";
    }
    if (tfCustomerName == null || tfCustomerName.getValue().trim().length() == 0) {
        tfCustomerName.setComponentError(new UserError("Enter Customer Name"));
        Error = Error + " " + "Customer Name";
    }

    lblNotificationIcon.setIcon(new ThemeResource("img/failure.png"));
    lblSaveNotification.setValue(Error);

}

From source file:com.gnts.pem.txn.synd.SyndFlat.java

License:Open Source License

private void saveEvaluationDetails() {
    uiflowdata = new UIFlowData();
    // for save evaluation details
    boolean valid = false;
    try {/*from  w w w.j a  va2s  . c om*/
        TPemCmEvalDetails evalobj = new TPemCmEvalDetails();

        evalobj.setDocId(headerid);
        evalobj.setDocDate(dfDateofValuation.getValue());
        evalobj.setEvalNo(tfEvaluationNumber.getValue());
        evalobj.setEvalDate(dfDateofValuation.getValue());
        evalobj.setValuationBy(tfValuatedBy.getValue());
        MPemCmBank bankid = new MPemCmBank();
        bankid.setBankId(selectedBankid);
        evalobj.setBankId(bankid);
        evalobj.setDoctype(screenName);
        evalobj.setCompanyId(selectCompanyid);
        evalobj.setBankBranch((String) slBankBranch.getValue());
        evalobj.setEvalPurpose(tfEvaluationPurpose.getValue());
        evalobj.setCheckedBy(tfVerifiedBy.getValue());
        evalobj.setCheckedDt(dfVerifiedDate.getValue());
        evalobj.setInspectionDt(dfDateofValuation.getValue());
        evalobj.setInspectionBy(tfValuatedBy.getValue());
        evalobj.setDocStatus(Common.DOC_DRAFT);
        evalobj.setLastUpdateDt(new Date());
        evalobj.setLastUpdtedBy(loginusername);
        evalobj.setCustName(tfCustomerName.getValue());

        if (tfDynamicEvaluation1.getValue() != null && tfDynamicEvaluation1.getValue().trim().length() > 0) {
            evalobj.setCustomLbl1(tfDynamicEvaluation1.getCaption());
            evalobj.setCustomValue1(tfDynamicEvaluation1.getValue());
        }
        if (tfDynamicEvaluation2.getValue() != null && tfDynamicEvaluation2.getValue().trim().length() > 0) {
            evalobj.setCustomValue2(tfDynamicEvaluation2.getCaption());
            evalobj.setCustomValue2(tfDynamicEvaluation2.getValue());
        }
        beanEvaluation.saveorUpdateEvalDetails(evalobj);
        uiflowdata.setEvalDtls(evalobj);
        try {
            saveOwnerDetails();
        } catch (Exception e) {
        }

        try {
            saveAssetDetails();
        } catch (Exception e) {
        }

        try {
            saveNormalDocuments();
        } catch (Exception e) {
        }

        try {
            saveLegalDocuments();
        } catch (Exception e) {
        }

        try {
            saveAdjoinPropertyDetails();
        } catch (Exception e) {
        }

        try {
            saveDimensionValues();
        } catch (Exception e) {

            logger.info("Error-->" + e);
        }

        try {
            saveMatchingBoundaries();
        } catch (Exception e) {
        }
        try {
            saveNoofRooms();
        } catch (Exception e) {
        }
        try {
            saveNoofFloors();
        } catch (Exception e) {
        }

        try {
            saveTenureOccupayDetails();
        } catch (Exception e) {
        }

        try {
            saveAreaDetailsofProperty();
        } catch (Exception e) {
        }
        try {
            saveDetailsofApartment();
        } catch (Exception e) {
        }
        try {
            saveFlatValuation();
        } catch (Exception e) {
        }

        try {
            savePlanApprovalDetails();
        } catch (Exception e) {
        }
        try {
            saveBuildSpecDetails();
        } catch (Exception e) {
        }

        try {
            saveConstValuationDetails();
        } catch (Exception e) {

        }
        try {
            savePropertyValueDetails();
        } catch (Exception e) {
        }
        try {

            uiflowdata.setPropDesc((String) slPropertyDesc.getValue());
            uiflowdata.setPropertyAddress(tfPropertyAddress.getValue());
            uiflowdata.setEvalnumber(tfEvaluationNumber.getValue());
            uiflowdata.setBankBranch((String) slBankBranch.getValue());
            uiflowdata.setCustomername(tfCustomerName.getValue());
            uiflowdata
                    .setGuidelinevalue(XMLUtil.IndianFormat(new BigDecimal(tfCostOfConstAsAtSite.getValue())));
            uiflowdata.setMarketValue(XMLUtil.IndianFormat(new BigDecimal(tfCostOfConstAsPerAgree.getValue())));

            if (dfDateofValuation.getValue() != null) {
                SimpleDateFormat dt1 = new SimpleDateFormat("dd-MMM-yyyy");
                uiflowdata.setInspectionDate(dt1.format(dfDateofValuation.getValue()));
            }
            uiflowdata.setPropDesc((String) slPropertyDesc.getValue());
            String numberOnly = tfCostOfConstAsAtSite.getValue().replaceAll("[^\\d.]", "");
            uiflowdata.setAmountInWords(beanEvaluation.getAmountInWords(numberOnly));
            //Bill
        } catch (Exception e) {
        }

        evalNumber = tfEvaluationNumber.getValue();
        customer = tfCustomerName.getValue();
        propertyType = "FLAT";
        ByteArrayOutputStream recvstram = XMLUtil.doMarshall(uiflowdata);
        XMLUtil.getWordDocument(recvstram, evalNumber + "_" + customer + "_" + propertyType, strXslFile);
        if (tfEvaluationNumber.isValid() && slBankBranch.isValid() && tfEvaluationPurpose.isValid()
                && dfDateofValuation.isValid()) {
            if (count == 0) {
                beanEvaluation.saveorUpdateEvalDetails(evalobj);

                valid = true;
            }
            lblNotificationIcon.setIcon(new ThemeResource("img/success_small.png"));
            lblSaveNotification.setValue(ApplicationConstants.saveMsg);
        }

        if (valid) {
            /*populateAndConfig(false);
            resetAllFieldsFields();*/
            btnSave.setEnabled(false);
        } else {
            btnSave.setComponentError(new UserError("Form is invalid"));
        }
    } catch (Exception e) {
        lblNotificationIcon.setIcon(new ThemeResource("img/failure.png"));
        lblSaveNotification.setValue("Save failed, please check the data and try again ");
        logger.info("Error on SaveApproveReject Status function--->" + e);
    }
}