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.sbi.SBIConstruction.java

private void updateEvaluationDetails() {
    try {/*from  w w w.j ava2s. c om*/
        boolean valid = false;
        TPemCmEvalDetails evalobj = new TPemCmEvalDetails();
        evalNumber = tfEvaluationNumber.getValue();
        customer = tfCustomerName.getValue();
        propertyType = "CONSTRUCTION";
        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.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.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());
        }

        BigDecimal construction = new BigDecimal(0.00);
        BigDecimal totalFair = new BigDecimal(0.00);
        BigDecimal fairMarket = new BigDecimal(0.00);
        BigDecimal totalRealizable = new BigDecimal(0.00);
        BigDecimal totalDistress = new BigDecimal(0.00);
        BigDecimal totalGuide = 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");

        try {
            test = new BigDecimal(
                    tfCostConstruction.getValue().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));

        } catch (Exception e) {
            test = new BigDecimal("0.00");

        }
        try {
            test1 = new BigDecimal(
                    tfFairMarketRate.getValue().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));

        } catch (Exception e) {

            test1 = new BigDecimal("0.00");
        }

        try {
            test4 = new BigDecimal(
                    tfGuidelineRate.getValue().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));

        } catch (Exception e) {

            test4 = new BigDecimal("0.00");
        }
        try {
            construction = construction.add(test);
            fairMarket = fairMarket.add(test1);
            totalFair = totalFair.add(test1).add(construction);
            uiflowdata.setTotalExtraItem(XMLUtil.IndianFormat(new BigDecimal(totalFair.toString())));

            totalGuide = totalGuide.add(test4);
            uiflowdata.setTotalServices(XMLUtil.IndianFormat(new BigDecimal(totalGuide.toString())));

            uiflowdata.setTotalAbstractvalue(XMLUtil.IndianFormat(new BigDecimal(totalFair.toString())));
            String numberOnly = totalFair.toString().replaceAll("[^\\d.]", "");
            if (numberOnly.trim().length() == 0) {
                numberOnly = "0";
            }
            uiflowdata.setAmountInWords(beanEvaluation.getAmountInWords(numberOnly));
            String numberOnly1 = tfGuidelineRate.getValue().replaceAll("[^0-9]", "");
            uiflowdata.setAmountWordsGuideline(beanEvaluation.getAmountInWords(numberOnly1));
            evalobj.setPropertyValue(Double.valueOf(numberOnly));
            beanEvaluation.saveorUpdateEvalDetails(evalobj);
            uiflowdata.setEvalDtls(evalobj);
            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("Successfully Submitted");
            }

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

            logger.info("Error-->" + 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.sbi.SBIConstruction.java

private void saveEvaluationDetails() {
    // TODO Auto-generated method stub
    uiflowdata = new UIFlowData();
    // for save evaluation details
    boolean valid = false;
    try {//from ww w  .  j  a v a 2 s. co  m
        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) 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.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 {
            saveDescriptionDetails();
        } catch (Exception e) {
        }

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

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

        try {
            savePlinthAreaDetails();
        } 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 {
            saveConstructionDetails();
        } catch (Exception e) {

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

        }
        try {
            uiflowdata.setPropertyAddress(tfPropertyAddress.getValue());
            uiflowdata.setBankBranch((String) slBankBranch.getValue());
            uiflowdata.setCustomername(tfCustomerName.getValue());
            uiflowdata.setEvalnumber(tfEvaluationNumber.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(tfAreaofLand.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.]", "")));
                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 {
                saveValuationofLandDetails();
            } catch (Exception e) {

                logger.info("Error-->" + e);
            }
            uiflowdata.setPropDesc((String) slPropertyDesc.getValue());
            uiflowdata.setMarketValue(XMLUtil.IndianFormat(new BigDecimal(
                    tfFairMarketRate.getValue().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""))));
            uiflowdata.setGuidelinevalue(XMLUtil.IndianFormat(new BigDecimal(tfGuidelineRate.getValue())));
            uiflowdata.setRealizablevalue(XMLUtil.IndianFormat(new BigDecimal(tfRealziableRate.getValue())));
            uiflowdata.setDistressvalue(XMLUtil.IndianFormat(new BigDecimal(tfDistressRate.getValue())));
            uiflowdata
                    .setConstructionValue(XMLUtil.IndianFormat(new BigDecimal(tfCostConstruction.getValue())));

        } catch (Exception e) {
            logger.info("Error-->" + e);
        }
        try {
            savePropertyValueDetails();
        } catch (Exception e) {
        }
        BigDecimal construction = new BigDecimal(0.00);
        BigDecimal totalFair = new BigDecimal(0.00);
        BigDecimal fairMarket = new BigDecimal(0.00);
        BigDecimal totalRealizable = new BigDecimal(0.00);
        BigDecimal totalDistress = new BigDecimal(0.00);
        BigDecimal totalGuide = 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");

        try {
            test = new BigDecimal(
                    tfCostConstruction.getValue().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));

        } catch (Exception e) {
            test = new BigDecimal("0.00");

        }
        try {
            test1 = new BigDecimal(
                    tfFairMarketRate.getValue().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));

        } catch (Exception e) {

            test1 = new BigDecimal("0.00");
        }

        try {
            test4 = new BigDecimal(
                    tfGuidelineRate.getValue().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));

        } catch (Exception e) {

            test4 = new BigDecimal("0.00");
        }
        try {
            construction = construction.add(test);
            fairMarket = fairMarket.add(test1);
            totalFair = totalFair.add(test1).add(construction);
            uiflowdata.setTotalExtraItem(XMLUtil.IndianFormat(new BigDecimal(totalFair.toString())));

            totalGuide = totalGuide.add(test4);
            uiflowdata.setTotalServices(XMLUtil.IndianFormat(new BigDecimal(totalGuide.toString())));

            uiflowdata.setTotalAbstractvalue(XMLUtil.IndianFormat(new BigDecimal(totalFair.toString())));
            String numberOnly = totalFair.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(
                        fairMarket.toString().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));
            } catch (Exception e) {
                real = new BigDecimal("0.00");

            }
            try {
                distre = new BigDecimal(
                        fairMarket.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)));
                tfRealziableRate.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) {

            logger.info("Error-->" + e);
        }
        try {
            test2 = new BigDecimal(
                    uiflowdata.getRealizablevalue().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));

        } catch (Exception e) {

            test2 = new BigDecimal("0.00");
        }
        try {
            test3 = new BigDecimal(
                    uiflowdata.getDistressvalue().replaceFirst("\\.0+$", "").replaceAll("[^0-9]", ""));

        } catch (Exception e) {

            test3 = new BigDecimal("0.00");
        }
        try {
            totalRealizable = totalRealizable.add(test2).add(construction);
            uiflowdata.setTotalAdditional(XMLUtil.IndianFormat(new BigDecimal(totalRealizable.toString())));
            totalDistress = totalDistress.add(test3).add(construction);
            uiflowdata.setTotalMiscellaneous(XMLUtil.IndianFormat(new BigDecimal(totalDistress.toString())));
        } catch (Exception e) {

        }
        evalNumber = tfEvaluationNumber.getValue();
        customer = tfCustomerName.getValue();
        propertyType = "CONSTRUCTION";
        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) {
        e.printStackTrace();
        lblNotificationIcon.setIcon(new ThemeResource("img/failure.png"));
        lblSaveNotification.setValue("Saved failed, please check the data and try again ");
        logger.info("Error on SaveApproveReject Status function--->" + e);

    }

}

From source file:com.gnts.pem.txn.sbi.SBIConstruction.java

private void setComponentStyle() {
    // TODO Auto-generated method stub
    slSearchBankbranch.setNullSelectionAllowed(false);
    slSearchBankbranch.setInputPrompt(Common.SELECT_PROMPT);
    tfSearchCustomer.setInputPrompt("Enter Customer");
    tfSearchEvalNumber.setInputPrompt("Enter Evaluation Number");

    tfEvaluationNumber.setWidth(strComponentWidth);
    slBankBranch.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);//  w  ww.jav a2s .c o m

    dfDateofValuation.setDateFormat("dd-MMM-yyy");
    dfVerifiedDate.setDateFormat("dd-MMM-yyy");
    dfSearchEvalDate.setDateFormat("dd-MMM-yyy");

    // for dynamic
    btnDynamicEvaluation1.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicEvaluation1.setStyleName(Runo.BUTTON_LINK);
    btnDynamicEstimate.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicEstimate.setStyleName(Runo.BUTTON_LINK);
    btnDynamicPlanApproval.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicPlanApproval.setStyleName(Runo.BUTTON_LINK);
    btnDynamicDescProp.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicDescProp.setStyleName(Runo.BUTTON_LINK);
    btnDynamicCharacter.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicCharacter.setStyleName(Runo.BUTTON_LINK);
    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);
    btnDynamicConstruction.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicConstruction.setStyleName(Runo.BUTTON_LINK);

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

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

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

    btnDynamicValuation.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicValuation.setStyleName(Runo.BUTTON_LINK);
    // for default values
    tfCoverUnderStatCentral.setValue(Common.strNA);
    tfAnyConversionLand.setValue(Common.strNA);
    tfMonthlyRent.setValue(Common.strNA);
    tfElecServiceConnNo.setValue(Common.strNA);
    tfProTaxReceipt.setValue(Common.strNA);
    tfFlood.setValue(Common.strNil);
    tfGeneralRemarks.setValue(Common.strNil);

    // for owner/asset
    tfCustomerName.setWidth(strComponentWidth);
    slPropertyDesc.setWidth(strComponentWidth);
    tfCustomerAddr.setWidth(strComponentWidth);
    tfCustomerAddr.setHeight("130px");
    slPropertyDesc.setNullSelectionAllowed(false);

    tfLandMark.setWidth(strComponentWidth);
    tfPropertyAddress.setWidth(strComponentWidth);
    tfPropertyAddress.setHeight("130px");
    tfDynamicAsset1.setWidth(strComponentWidth);
    tfDynamicAsset2.setWidth(strComponentWidth);
    btnDynamicAsset.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicAsset.setStyleName(Runo.BUTTON_LINK);
    btnAddOwner.setIcon(new ThemeResource(Common.strAddIcon));
    btnAddOwner.setStyleName(Runo.BUTTON_LINK);

    // for document
    btnAddLegalDoc.setIcon(new ThemeResource(Common.strAddIcon));
    btnAddNorDoc.setIcon(new ThemeResource(Common.strAddIcon));
    btnAddNorDoc.setStyleName(Runo.BUTTON_LINK);
    btnAddLegalDoc.setStyleName(Runo.BUTTON_LINK);

    ///for adjoin property and dimension
    btnAddAdjoinProperty.setIcon(new ThemeResource(Common.strAddIcon));
    btnAddAdjoinProperty.setStyleName(Runo.BUTTON_LINK);
    btnAddDimension.setIcon(new ThemeResource(Common.strAddIcon));
    btnAddDimension.setStyleName(Runo.BUTTON_LINK);

    //for description of the property
    tfPostalAddress.setWidth(strComponentWidth);
    tfSiteNumber.setWidth(strComponentWidth);
    tfSFNumber.setWidth(strComponentWidth);
    tfNewSFNumber.setWidth(strComponentWidth);
    tfVillage.setWidth(strComponentWidth);
    tfTaluk.setWidth(strComponentWidth);
    tfDistCorpPanc.setWidth(strComponentWidth);
    tfLocationSketch.setWidth(strComponentWidth);
    tfProTaxReceipt.setWidth(strComponentWidth);
    tfElecServiceConnNo.setWidth(strComponentWidth);
    tfElecConnecName.setWidth(strComponentWidth);
    slHighMiddPoor.setWidth(strComponentWidth);
    slUrbanSemiRural.setWidth(strComponentWidth);
    slResiIndustCommer.setWidth(strComponentWidth);
    slProOccupiedBy.setWidth(strComponentWidth);
    tfMonthlyRent.setWidth(strComponentWidth);
    tfCoverUnderStatCentral.setWidth(strComponentWidth);
    tfAnyConversionLand.setWidth(strComponentWidth);
    tfExtentSite.setWidth(strComponentWidth);
    tfYearAcquistion.setWidth(strComponentWidth);
    tfPurchaseValue.setWidth(strComponentWidth);
    tfPropLandmark.setWidth(strComponentWidth);
    tfDynamicDescProp1.setWidth(strComponentWidth);
    tfDynamicDescProp2.setWidth(strComponentWidth);
    //for Charcteristics of the site
    slLocalClass.setWidth(strComponentWidth);
    slSurroundDevelop.setWidth(strComponentWidth);
    tfFlood.setWidth(strComponentWidth);
    slFeasibility.setWidth(strComponentWidth);
    slLandLevel.setWidth(strComponentWidth);
    slLandShape.setWidth(strComponentWidth);
    slTypeUse.setWidth(strComponentWidth);
    tfUsageRestriction.setWidth(strComponentWidth);
    slIsPlot.setWidth(strComponentWidth);
    tfApprveNo.setWidth(strComponentWidth);
    tfNoReason.setWidth(strComponentWidth);
    tfSubdivide.setWidth(strComponentWidth);
    slDrawApproval.setWidth(strComponentWidth);
    slCornerInter.setWidth(strComponentWidth);
    slRoadFacility.setWidth(strComponentWidth);
    slTypeRoad.setWidth(strComponentWidth);
    slRoadWidth.setWidth(strComponentWidth);
    slLandLock.setWidth(strComponentWidth);
    slWaterPotential.setWidth(strComponentWidth);
    slUnderSewerage.setWidth(strComponentWidth);
    slPowerSupply.setWidth(strComponentWidth);
    tfAdvantageSite.setWidth(strComponentWidth);
    tfDisadvantageSite.setWidth(strComponentWidth);
    tfGeneralRemarks.setWidth(strComponentWidth);
    tfDynamicCharacter1.setWidth(strComponentWidth);
    tfDynamicCharacter2.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);
    //stage of construction
    tfSalablity.setWidth(strComponentWidth);
    tfRentalValues.setWidth(strComponentWidth);
    tfIncome.setWidth(strComponentWidth);
    tfStageofConst.setWidth(strComponentWidth);
    tfDynamicConstruction1.setWidth(strComponentWidth);
    tfDynamicConstruction2.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 land valuation
    tfAreaofLand.setWidth(strComponentWidth);
    tfNorthandSouth.setWidth(strComponentWidth);
    tfMarketRate.setWidth(strComponentWidth);
    tfGuiderate.setWidth(strComponentWidth);
    tfAdopetdMarketRate.setWidth(strComponentWidth);
    tfFairMarketRate.setWidth(strComponentWidth);
    tfGuidelineRate.setWidth(strComponentWidth);
    tfRealziableRate.setWidth(strComponentWidth);
    tfDistressRate.setWidth(strComponentWidth);
    tfDynamicValuation1.setWidth(strComponentWidth);
    tfDynamicValuation2.setWidth(strComponentWidth);

    tfZone.setWidth(strComponentWidth);
    tfSRO.setWidth(strComponentWidth);
    tfVillage1.setWidth(strComponentWidth);
    tfRevnueDist.setWidth(strComponentWidth);
    tfTalukName.setWidth(strComponentWidth);
    tfStreetName.setWidth(strComponentWidth);
    slStreetSerNo.setWidth(strComponentWidth);
    tfGuidelineValue.setWidth(strComponentWidth);
    tfGuidelineValueMatric.setWidth(strComponentWidth);
    slClassification.setWidth(strComponentWidth);

    // for details of plan approval
    tfLandandBuilding.setWidth(strComponentWidth);
    tfBuilding.setWidth(strComponentWidth);
    tfPlanApprovedBy.setWidth(strComponentWidth);
    dfLicenseFrom.setWidth(strComponentWidth);
    tfQuality.setWidth(strComponentWidth);
    slIsLicenceForced.setWidth(strComponentWidth);
    slAllApprovalRecved.setWidth(strComponentWidth);
    slConstAsperAppPlan.setWidth(strComponentWidth);
    tfReason.setWidth(strComponentWidth);
    tfDynamicPlanApproval1.setWidth(strComponentWidth);
    tfDynamicPlanApproval2.setWidth(strComponentWidth);

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

    tfEstimateGiven.setWidth(strComponentWidth);
    tfAppReason.setWidth(strComponentWidth);
    tfSalient.setWidth(strComponentWidth);
    tfBreakup.setWidth(strComponentWidth);
    tfDynamicEstimateConst1.setWidth(strComponentWidth);
    tfDynamicEstimateConst2.setWidth(strComponentWidth);

    //set Null represenrtation
    tfEvaluationNumber.setNullRepresentation("");
    slBankBranch.setNullSelectionAllowed(false);
    tfEvaluationPurpose.setNullRepresentation("");
    dfDateofValuation.setWidth("150px");
    tfValuatedBy.setNullRepresentation("");
    dfVerifiedDate.setWidth("150px");
    tfVerifiedBy.setNullRepresentation("");
    tfDynamicEvaluation1.setNullRepresentation("");
    tfDynamicEvaluation2.setNullRepresentation("");
    slSearchBankbranch.setNullSelectionAllowed(false);

    // for owner/asset
    tfCustomerName.setNullRepresentation("");
    slPropertyDesc.setNullSelectionAllowed(false);
    tfCustomerAddr.setNullRepresentation("");
    slPropertyDesc.setNullSelectionAllowed(false);
    tfLandMark.setNullRepresentation("");
    tfPropertyAddress.setNullRepresentation("");
    tfDynamicAsset1.setNullRepresentation("");
    tfDynamicAsset2.setNullRepresentation("");
    //for description of the property
    tfPostalAddress.setNullRepresentation("");
    tfSiteNumber.setNullRepresentation("");
    tfSFNumber.setNullRepresentation("");
    tfNewSFNumber.setNullRepresentation("");
    tfVillage.setNullRepresentation("");
    tfTaluk.setNullRepresentation("");
    tfDistCorpPanc.setNullRepresentation("");
    tfLocationSketch.setNullRepresentation("");
    tfProTaxReceipt.setNullRepresentation("");
    tfElecServiceConnNo.setNullRepresentation("");
    tfElecConnecName.setNullRepresentation("");
    slHighMiddPoor.setNullSelectionAllowed(false);
    slUrbanSemiRural.setNullSelectionAllowed(false);
    slResiIndustCommer.setNullSelectionAllowed(false);
    slProOccupiedBy.setNullSelectionAllowed(false);
    tfMonthlyRent.setNullRepresentation("");
    tfCoverUnderStatCentral.setNullRepresentation("");
    tfAnyConversionLand.setNullRepresentation("");
    tfExtentSite.setNullRepresentation("");
    tfYearAcquistion.setNullRepresentation("");
    tfPurchaseValue.setNullRepresentation("");
    tfPropLandmark.setNullRepresentation("");
    tfDynamicDescProp1.setNullRepresentation("");
    tfDynamicDescProp2.setNullRepresentation("");
    //for Charcteristics of the site
    slLocalClass.setNullSelectionAllowed(false);
    slSurroundDevelop.setNullSelectionAllowed(false);
    tfFlood.setNullRepresentation("");
    slFeasibility.setNullSelectionAllowed(false);
    slLandLevel.setNullSelectionAllowed(false);
    slLandShape.setNullSelectionAllowed(false);
    slTypeUse.setNullSelectionAllowed(false);
    tfUsageRestriction.setNullRepresentation("");
    slIsPlot.setNullSelectionAllowed(false);
    tfApprveNo.setNullRepresentation("");
    tfNoReason.setNullRepresentation("");
    tfSubdivide.setNullRepresentation("");
    slDrawApproval.setNullSelectionAllowed(false);
    slCornerInter.setNullSelectionAllowed(false);
    slRoadFacility.setNullSelectionAllowed(false);
    slTypeRoad.setNullSelectionAllowed(false);
    slRoadWidth.setNullSelectionAllowed(false);
    slLandLock.setNullSelectionAllowed(false);
    slWaterPotential.setNullSelectionAllowed(false);
    slUnderSewerage.setNullSelectionAllowed(false);
    slPowerSupply.setNullSelectionAllowed(false);
    tfAdvantageSite.setNullRepresentation("");
    tfDisadvantageSite.setNullRepresentation("");
    tfGeneralRemarks.setNullRepresentation("");
    tfDynamicCharacter1.setNullRepresentation("");
    tfDynamicCharacter2.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
    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.setNullRepresentation("");
    tfDynamicAppReason4.setNullRepresentation("");

    //for earth quake
    slEarthQuake.setNullSelectionAllowed(false);
    tfDynamicEarthquake1.setNullRepresentation("");
    tfDynamicEarthquake2.setNullRepresentation("");
    //for construction
    tfStageofConst.setNullRepresentation("");
    tfSalablity.setNullRepresentation("");
    tfRentalValues.setNullRepresentation("");
    tfIncome.setNullRepresentation("");
    tfDynamicConstruction1.setNullRepresentation("");
    tfDynamicConstruction2.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 land valuation
    tfAreaofLand.setNullRepresentation("");
    tfNorthandSouth.setNullRepresentation("");
    tfMarketRate.setNullRepresentation("");
    tfGuiderate.setNullRepresentation("");
    tfAdopetdMarketRate.setNullRepresentation("");
    tfFairMarketRate.setNullRepresentation("");
    tfGuidelineRate.setNullRepresentation("");
    tfRealziableRate.setNullRepresentation("");
    tfDistressRate.setNullRepresentation("");
    tfDynamicValuation1.setNullRepresentation("");
    tfDynamicValuation2.setNullRepresentation("");

    tfZone.setNullRepresentation("");
    tfSRO.setNullRepresentation("");
    tfVillage1.setNullRepresentation("");
    tfRevnueDist.setNullRepresentation("");
    tfTalukName.setNullRepresentation("");
    tfStreetName.setNullRepresentation("");
    slStreetSerNo.setNullSelectionAllowed(false);
    tfGuidelineValue.setNullRepresentation("");
    tfGuidelineValueMatric.setNullRepresentation("");
    slClassification.setNullRepresentation("");

    // for details of plan approval
    tfLandandBuilding.setNullRepresentation("");
    tfBuilding.setNullRepresentation("");
    tfPlanApprovedBy.setNullRepresentation("");
    dfLicenseFrom.setNullRepresentation("");
    tfQuality.setNullRepresentation("");
    tfDynamicPlanApproval1.setNullRepresentation("");
    slIsLicenceForced.setNullSelectionAllowed(false);
    slAllApprovalRecved.setNullSelectionAllowed(false);
    slConstAsperAppPlan.setNullSelectionAllowed(false);
    tfReason.setNullRepresentation("");
    tfDynamicPlanApproval2.setNullRepresentation("");

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

    tfEstimateGiven.setNullRepresentation("");
    tfAppReason.setNullRepresentation("");
    tfSalient.setNullRepresentation("");
    tfBreakup.setNullRepresentation("");
    tfDynamicEstimateConst1.setNullRepresentation("");
    tfDynamicEstimateConst2.setNullRepresentation("");
    tfDynamicEstimateConst2.setNullRepresentation("");
}

From source file:com.gnts.pem.txn.sbi.SBIConstruction.java

@Override
public void buttonClick(ClickEvent event) {
    notifications.close();/*  w  w w .j a  v a 2s.c  o  m*/
    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);

    } else 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 (btnSave == event.getButton()) {
        setComponentError();
        if (tfEvaluationNumber.isValid() && slBankBranch.isValid() && tfEvaluationPurpose.isValid()
                && dfDateofValuation.isValid()) {

            saveEvaluationDetails();
        }
        //btnSave.setVisible(false);
    }
    if (btnSubmit == event.getButton()) {
        setComponentError();
        if (tfEvaluationNumber.isValid() && slBankBranch.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);
    } else 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();
    } else if (btnReset == event.getButton()) {
        tfSearchEvalNumber.setValue("");
        dfSearchEvalDate.setValue(null);
        tfSearchCustomer.setValue("");
        slSearchBankbranch.setValue(null);
        populateAndConfig(false);
    }

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

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

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

    else if (btnAddNorDoc == event.getButton()) {

        panelNormalDocumentDetails.addComponent(new ComponentIteratorNormlDoc(null, null, "", ""));
    }

    else if (btnAddLegalDoc == event.getButton()) {

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

    else if (btnAddOwner == event.getButton()) {

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

        layoutGuideline.addComponent(new ComponentIterGuideline("", "", "", ""));
    } else if (btnDynamicEvaluation1 == event.getButton()) {

        strSelectedPanel = "1";
        showSubWindow();

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

        layoutPlintharea.addComponent(new ComponentIterPlinthArea("", "", ""));
    }
    if (btnDynamicEstimate == event.getButton()) {
        strSelectedPanel = "2";
        showSubWindow();

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

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

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

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

    }

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

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

    }
    if (btnDynamicCharacter == event.getButton()) {
        strSelectedPanel = "9";
        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 = "11";
        showSubWindow();

    }
    if (btnDynamicEarthQuake == event.getButton()) {
        strSelectedPanel = "12";
        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);
        }

    } else 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("3")) {
                if (tfDynamicAsset1.isVisible()) {
                    tfDynamicAsset2.setCaption(tfCaption.getValue());
                    tfDynamicAsset2.setVisible(true);
                } else {
                    tfDynamicAsset1.setCaption(tfCaption.getValue());
                    tfDynamicAsset1.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("6")) {
                if (tfDynamicPlanApproval1.isVisible()) {
                    tfDynamicPlanApproval2.setCaption(tfCaption.getValue());
                    tfDynamicPlanApproval2.setVisible(true);
                } else {
                    tfDynamicPlanApproval1.setCaption(tfCaption.getValue());
                    tfDynamicPlanApproval1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("7")) {
                if (tfDynamicValuation1.isVisible()) {
                    tfDynamicValuation2.setCaption(tfCaption.getValue());
                    tfDynamicValuation2.setVisible(true);
                } else {
                    tfDynamicValuation1.setCaption(tfCaption.getValue());
                    tfDynamicValuation1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("8")) {
                if (tfDynamicDescProp1.isVisible()) {
                    tfDynamicDescProp2.setCaption(tfCaption.getValue());
                    tfDynamicDescProp2.setVisible(true);
                } else {
                    tfDynamicDescProp1.setCaption(tfCaption.getValue());
                    tfDynamicDescProp1.setVisible(true);
                }
            }

            else if (strSelectedPanel.equals("9")) {
                if (tfDynamicCharacter1.isVisible()) {
                    tfDynamicCharacter2.setCaption(tfCaption.getValue());
                    tfDynamicCharacter2.setVisible(true);
                } else {
                    tfDynamicCharacter1.setCaption(tfCaption.getValue());
                    tfDynamicCharacter1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("11")) {
                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("12")) {
                if (tfDynamicEarthquake1.isVisible()) {
                    tfDynamicEarthquake2.setCaption(tfCaption.getValue());
                    tfDynamicEarthquake2.setVisible(true);
                } else {
                    tfDynamicEarthquake1.setCaption(tfCaption.getValue());
                    tfDynamicEarthquake1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("2")) {
                if (tfDynamicEstimateConst1.isVisible()) {
                    tfDynamicEstimateConst2.setCaption(tfCaption.getValue());
                    tfDynamicEstimateConst2.setVisible(true);
                } else {
                    tfDynamicEstimateConst1.setCaption(tfCaption.getValue());
                    tfDynamicEstimateConst1.setVisible(true);
                }
            }

        }
        mywindow.close();
    }
}

From source file:com.gnts.pem.txn.sbi.SBIConstructionBuilding.java

@SuppressWarnings("deprecation")
void populateAndConfig(boolean search) {
    try {// w  w w.j ava  2  s  .co  m
        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);
            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("");
            }
        } else {

            evalList = beanEvaluation.getSearchEvalDetailnList(selectedFormName, null, null, null, null,
                    selectedBankid, selectCompanyid, null);
            total = evalList.size();
        }
        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.sbi.SBIConstructionBuilding.java

private void updateEvaluationDetails() {
    System.out.println("Inside Update Evaluation");
    try {//  ww w. j  a  va 2  s . c  o  m
        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.]", "");
            if (numberOnly.trim().length() == 0) {
                numberOnly = "0";
            }
            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,currencyId);
               uiflowdata.setBill(billDtls);*/
            evalobj.setPropertyValue(Double.valueOf(numberOnly));
            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);
        String basepath = VaadinService.getCurrent().getBaseDirectory().getAbsolutePath();
        System.out.println("Inside Update Evaluation basepath" + basepath + "/WEB-INF/PEM-DOCS/" + evalNumber
                + "_" + customer + "_" + propertyType + ".doc");
        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.setEvalDoc(fileContent);
        //   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) {
        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.sbi.SBIConstructionBuilding.java

void setComponentError() {
    tfEvaluationNumber.setComponentError(null);
    dfDateofValuation.setComponentError(null);
    tfEvaluationPurpose.setComponentError(null);
    tfBankBranch.setComponentError(null);
    tfCustomerName.setComponentError(null);
    tfAdopetdMarketRate.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  w w. 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 (tfBankBranch.getValue() == null) {
        tfBankBranch.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";
    }
    if (tfAdopetdMarketRate == null || tfAdopetdMarketRate.getValue().trim().length() == 0) {
        tfAdopetdMarketRate.setComponentError(new UserError("Enter Market Rate"));
        Error = Error + " " + "Market Rate";
    }
    lblNotificationIcon.setIcon(new ThemeResource("img/failure.png"));
    lblSaveNotification.setValue(Error);

}

From source file:com.gnts.pem.txn.sbi.SBIConstructionBuilding.java

private void saveEvaluationDetails() {
    uiflowdata = new UIFlowData();
    boolean valid = false;
    // for save evaluation details
    try {/*  w  w w . ja  va2 s .com*/
        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 {
            saveDescriptionDetails();
        } catch (Exception e) {
        }
        try {
            saveCharacterDetails();
        } catch (Exception e) {

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

        try {
            saveViolationDetails();
        } catch (Exception e) {
        }
        try {
            saveConstValuationDetails();
        } 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 {
            saveElectricalDetails();
        } catch (Exception e) {
        }
        try {
            savePlumbingDetails();
        } 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(tfAreaofLand.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.]", "")));
                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 {
                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));
            //Bill
            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.sbi.SBIConstructionBuilding.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  w w  . j  a v a  2 s.co  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("130px");
    slPropertyDesc.setNullSelectionAllowed(false);

    //for description of the property
    tfPostalAddress.setWidth(strComponentWidth);
    tfSiteNumber.setWidth(strComponentWidth);
    tfSFNumber.setWidth(strComponentWidth);
    tfNewSFNumber.setWidth(strComponentWidth);
    tfVillageLoc.setWidth(strComponentWidth);
    tfTaluk.setWidth(strComponentWidth);
    tfDistCorpPanc.setWidth(strComponentWidth);
    tfLocationSketch.setWidth(strComponentWidth);
    tfProTaxReceipt.setWidth(strComponentWidth);
    tfElecServiceConnNo.setWidth(strComponentWidth);
    tfElecConnecName.setWidth(strComponentWidth);
    slHighMiddPoor.setWidth(strComponentWidth);
    slUrbanSemiRural.setWidth(strComponentWidth);
    slResiIndustCommer.setWidth(strComponentWidth);
    slProOccupiedBy.setWidth(strComponentWidth);
    tfMonthlyRent.setWidth(strComponentWidth);
    tfCoverUnderStatCentral.setWidth(strComponentWidth);
    tfAnyConversionLand.setWidth(strComponentWidth);
    tfExtentSite.setWidth(strComponentWidth);
    tfYearAcquistion.setWidth(strComponentWidth);
    tfPurchaseValue.setWidth(strComponentWidth);
    tfPropLandmark.setWidth(strComponentWidth);
    tfDynamicDescProp1.setWidth(strComponentWidth);
    tfDynamicDescProp2.setWidth(strComponentWidth);
    //for Charcteristics of the site
    slLocalClass.setWidth(strComponentWidth);
    slSurroundDevelop.setWidth(strComponentWidth);
    tfFlood.setWidth(strComponentWidth);
    slFeasibility.setWidth(strComponentWidth);
    slLandLevel.setWidth(strComponentWidth);
    slLandShape.setWidth(strComponentWidth);
    slTypeUse.setWidth(strComponentWidth);
    tfUsageRestriction.setWidth(strComponentWidth);
    slIsPlot.setWidth(strComponentWidth);
    tfApprveNo.setWidth(strComponentWidth);
    tfNoReason.setWidth(strComponentWidth);
    tfSubdivide.setWidth(strComponentWidth);
    slDrawApproval.setWidth(strComponentWidth);
    slCornerInter.setWidth(strComponentWidth);
    slRoadFacility.setWidth(strComponentWidth);
    slTypeRoad.setWidth(strComponentWidth);
    slRoadWidth.setWidth(strComponentWidth);
    slLandLock.setWidth(strComponentWidth);
    slWaterPotential.setWidth(strComponentWidth);
    slUnderSewerage.setWidth(strComponentWidth);
    slPowerSupply.setWidth(strComponentWidth);
    tfAdvantageSite.setWidth(strComponentWidth);
    tfDisadvantageSite.setWidth(strComponentWidth);
    tfGeneralRemarks.setWidth(strComponentWidth);
    tfDynamicCharacter1.setWidth(strComponentWidth);
    tfDynamicCharacter2.setWidth(strComponentWidth);
    //for applicant Estimate
    tfNoofClosets.setWidth(strComponentWidth);
    tfNoofWashbin.setWidth(strComponentWidth);
    tfWatertaps.setWidth(strComponentWidth);
    tfAnyFixtures.setWidth(strComponentWidth);
    tfDynamicPlum1.setWidth(strComponentWidth);
    tfDynamicPlum2.setWidth(strComponentWidth);

    //for applicant Reasonable
    tfTypeofwiring.setWidth(strComponentWidth);
    tfClassFit.setWidth(strComponentWidth);
    tfNOofLight.setWidth(strComponentWidth);
    tfExhaustFan.setWidth(strComponentWidth);
    tfFan.setWidth(strComponentWidth);
    tfSpareplug.setWidth(strComponentWidth);
    tfDynamicElectrical1.setWidth(strComponentWidth);
    tfDynamicElectrical2.setWidth(strComponentWidth);

    //stage of construction
    tfSalablity.setWidth(strComponentWidth);
    tfRentalValues.setWidth(strComponentWidth);
    tfIncome.setWidth(strComponentWidth);
    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 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);
    tfGuiderate.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);
    tfPostalAddress.setNullRepresentation("");
    tfSiteNumber.setNullRepresentation("");
    tfSFNumber.setNullRepresentation("");
    tfNewSFNumber.setNullRepresentation("");
    tfVillageLoc.setNullRepresentation("");
    tfTaluk.setNullRepresentation("");
    tfDistCorpPanc.setNullRepresentation("");
    tfLocationSketch.setNullRepresentation("");
    tfProTaxReceipt.setNullRepresentation("");
    tfElecServiceConnNo.setNullRepresentation("");
    tfElecConnecName.setNullRepresentation("");
    slHighMiddPoor.setNullSelectionAllowed(false);
    slUrbanSemiRural.setNullSelectionAllowed(false);
    slResiIndustCommer.setNullSelectionAllowed(false);
    slProOccupiedBy.setNullSelectionAllowed(false);
    tfMonthlyRent.setNullRepresentation("");
    tfCoverUnderStatCentral.setNullRepresentation("");
    tfAnyConversionLand.setNullRepresentation("");
    tfExtentSite.setNullRepresentation("");
    tfYearAcquistion.setNullRepresentation("");
    tfPurchaseValue.setNullRepresentation("");
    tfPropLandmark.setNullRepresentation("");
    tfDynamicDescProp1.setNullRepresentation("");
    tfDynamicDescProp2.setNullRepresentation("");
    //for Charcteristics of the site
    slLocalClass.setNullSelectionAllowed(false);
    slSurroundDevelop.setNullSelectionAllowed(false);
    tfFlood.setNullRepresentation("");
    slFeasibility.setNullSelectionAllowed(false);
    slLandLevel.setNullSelectionAllowed(false);
    slLandShape.setNullSelectionAllowed(false);
    slTypeUse.setNullSelectionAllowed(false);
    tfUsageRestriction.setNullRepresentation("");
    slIsPlot.setNullSelectionAllowed(false);
    tfApprveNo.setNullRepresentation("");
    tfNoReason.setNullRepresentation("");
    tfSubdivide.setNullRepresentation("");
    slDrawApproval.setNullSelectionAllowed(false);
    slCornerInter.setNullSelectionAllowed(false);
    slRoadFacility.setNullSelectionAllowed(false);
    slTypeRoad.setNullSelectionAllowed(false);
    slRoadWidth.setNullSelectionAllowed(false);
    slLandLock.setNullSelectionAllowed(false);
    slWaterPotential.setNullSelectionAllowed(false);
    slUnderSewerage.setNullSelectionAllowed(false);
    slPowerSupply.setNullSelectionAllowed(false);
    tfAdvantageSite.setNullRepresentation("");
    tfDisadvantageSite.setNullRepresentation("");
    tfGeneralRemarks.setNullRepresentation("");
    tfDynamicCharacter1.setNullRepresentation("");
    tfDynamicCharacter2.setNullRepresentation("");

    tfTypeofwiring.setNullRepresentation("");
    tfClassFit.setNullRepresentation("");
    tfNOofLight.setNullRepresentation("");
    tfExhaustFan.setNullRepresentation("");
    tfFan.setNullRepresentation("");
    tfSpareplug.setNullRepresentation("");
    tfDynamicElectrical1.setNullRepresentation("");
    tfDynamicElectrical2.setNullRepresentation("");

    tfNoofClosets.setNullRepresentation("");
    tfNoofWashbin.setNullRepresentation("");
    tfWatertaps.setNullRepresentation("");
    tfAnyFixtures.setNullRepresentation("");
    tfDynamicPlum1.setNullRepresentation("");
    tfDynamicPlum2.setNullRepresentation("");

    //for construction
    tfStageofConst.setNullRepresentation("");
    tfSalablity.setNullRepresentation("");
    tfRentalValues.setNullRepresentation("");
    tfIncome.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 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("");
    tfGuiderate.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);

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

    btnDynamicConstruction.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicConstruction.setStyleName(Runo.BUTTON_LINK);
    btnDynamicViolation.setIcon(new ThemeResource(Common.strAddIcon));
    btnDynamicViolation.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));

    tfStageofConst.setValue(Common.strNA);

}

From source file:com.gnts.pem.txn.sbi.SBIConstructionBuilding.java

public void buttonClick(ClickEvent event) {
    notifications.close();//ww w.ja  v a2s .  com
    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");
        lblAddEdit.setValue("&nbsp;>&nbsp;Add New");
        lblAddEdit.setVisible(true);
        lblFormTittle.setVisible(false);
        hlBreadCrumbs.setVisible(true);
        resetAllFieldsFields();

    }
    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 (btnDynamicElectrical == event.getButton()) {
        strSelectedPanel = "4";
        showSubWindow();

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

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

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

    }

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

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

    }
    if (btnDynamicCharacter == 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 (tfDynamicElectrical1.isVisible()) {
                    tfDynamicElectrical2.setCaption(tfCaption.getValue());
                    tfDynamicElectrical2.setVisible(true);
                } else {
                    tfDynamicElectrical1.setCaption(tfCaption.getValue());
                    tfDynamicElectrical1.setVisible(true);
                }
            } else if (strSelectedPanel.equals("5")) {
                if (tfDynamicPlum1.isVisible()) {
                    tfDynamicPlum2.setCaption(tfCaption.getValue());
                    tfDynamicPlum2.setVisible(true);
                } else {
                    tfDynamicPlum1.setCaption(tfCaption.getValue());
                    tfDynamicPlum1.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("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 (tfDynamicDescProp1.isVisible()) {
                    tfDynamicDescProp2.setCaption(tfCaption.getValue());
                    tfDynamicDescProp2.setVisible(true);
                } else {
                    tfDynamicDescProp1.setCaption(tfCaption.getValue());
                    tfDynamicDescProp1.setVisible(true);
                }
            }

            else if (strSelectedPanel.equals("11")) {
                if (tfDynamicCharacter1.isVisible()) {
                    tfDynamicCharacter2.setCaption(tfCaption.getValue());
                    tfDynamicCharacter2.setVisible(true);
                } else {
                    tfDynamicCharacter1.setCaption(tfCaption.getValue());
                    tfDynamicCharacter1.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);
        btnSubmit.setVisible(false);
        btnCancel.setVisible(false);
        //.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);
    }

}