Example usage for com.vaadin.ui Alignment TOP_CENTER

List of usage examples for com.vaadin.ui Alignment TOP_CENTER

Introduction

In this page you can find the example usage for com.vaadin.ui Alignment TOP_CENTER.

Prototype

Alignment TOP_CENTER

To view the source code for com.vaadin.ui Alignment TOP_CENTER.

Click Source Link

Usage

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

@SuppressWarnings("deprecation")
void buildView(VerticalLayout layoutPage, HorizontalLayout hlHeaderLayout) {
    // for component width
    setComponentStyle();/*from w w  w .  j a va 2s .  c  om*/
    hlHeaderLayout.removeAllComponents();

    tblEvalDetails = new Table();
    tblEvalDetails.setStyleName(Runo.TABLE_SMALL);
    tblEvalDetails.setPageLength(14);
    tblEvalDetails.setSizeFull();
    tblEvalDetails.setFooterVisible(true);
    tblEvalDetails.setSelectable(true);
    tblEvalDetails.setImmediate(true);
    tblEvalDetails.setColumnCollapsingAllowed(true);

    // for evaluation details
    tfEvaluationPurpose.setValue("Collateral Security to the Bank");
    slStreetSerNo.addItem("STREET NAME");
    slStreetSerNo.addItem("SURVEY NO");
    slStreetSerNo.setNullSelectionAllowed(false);

    tfEvaluationNumber.setRequired(true);
    slBankBranch.setRequired(true);
    dfDateofValuation.setRequired(true);
    tfEvaluationPurpose.setRequired(true);
    layoutEvaluationDetails1.setColumns(4);

    layoutEvaluationDetails1.addComponent(tfEvaluationNumber);
    layoutEvaluationDetails1.addComponent(slBankBranch);
    layoutEvaluationDetails1.addComponent(tfEvaluationPurpose);
    layoutEvaluationDetails1.addComponent(tfValuatedBy);
    layoutEvaluationDetails1.addComponent(dfDateofValuation);
    layoutEvaluationDetails1.addComponent(dfVerifiedDate);
    layoutEvaluationDetails1.addComponent(tfVerifiedBy);
    layoutEvaluationDetails1.addComponent(tfDynamicEvaluation1);
    layoutEvaluationDetails1.addComponent(tfDynamicEvaluation2);
    tfDynamicEvaluation1.setVisible(false);
    tfDynamicEvaluation2.setVisible(false);
    layoutEvaluationDetails1.setSpacing(true);
    layoutEvaluationDetails1.setMargin(true);

    layoutEvaluationDetails.addComponent(btnDynamicEvaluation1);
    layoutEvaluationDetails.setComponentAlignment(btnDynamicEvaluation1, Alignment.TOP_RIGHT);
    layoutEvaluationDetails.addComponent(layoutEvaluationDetails1);

    // for asset details
    VerticalLayout formAsset1 = new VerticalLayout();
    VerticalLayout formAsset2 = new VerticalLayout();
    VerticalLayout formAsset3 = new VerticalLayout();
    VerticalLayout formAsset4 = new VerticalLayout();
    formAsset1.setSpacing(true);
    formAsset2.setSpacing(true);
    formAsset4.setSpacing(true);

    formAsset1.addComponent(tfCustomerName);
    formAsset1.addComponent(tfLandMark);
    formAsset1.addComponent(slPropertyDesc);
    formAsset2.addComponent(tfCustomerAddr);
    formAsset3.addComponent(tfPropertyAddress);
    formAsset3.addComponent(chkSameAddress);
    formAsset4.addComponent(tfDynamicAsset1);
    formAsset4.addComponent(tfDynamicAsset2);
    tfDynamicAsset1.setVisible(false);
    tfDynamicAsset2.setVisible(false);

    chkSameAddress.setImmediate(true);
    chkSameAddress.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {

            if (chkSameAddress.getValue().equals(true)) {
                tfPropertyAddress.setValue(tfCustomerAddr.getValue());

            } else {
                tfPropertyAddress.setValue("");
            }
        }
    });

    layoutAssetDetails1.setSpacing(true);
    layoutAssetDetails1.setColumns(4);
    layoutAssetDetails1.addComponent(formAsset1);
    layoutAssetDetails1.addComponent(formAsset2);
    layoutAssetDetails1.addComponent(formAsset3);
    layoutAssetDetails1.addComponent(formAsset4);
    layoutAssetDetails1.setMargin(true);

    layoutAssetDetails.addComponent(btnDynamicAsset);
    layoutAssetDetails.setComponentAlignment(btnDynamicAsset, Alignment.TOP_RIGHT);
    layoutAssetDetails.addComponent(layoutAssetDetails1);

    lblHeading = new Label("Owner Details");
    layoutAssetOwner.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutAssetOwner.addComponent(PanelGenerator.createPanel(layoutOwnerDetails));
    lblHeading = new Label("Asset Details");
    layoutAssetOwner.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutAssetOwner.addComponent(PanelGenerator.createPanel(layoutAssetDetails));

    // for Owner Details
    layoutOwnerDetails.addComponent(btnAddOwner);
    layoutOwnerDetails.setComponentAlignment(btnAddOwner, Alignment.TOP_RIGHT);
    layoutOwnerDetails1.setColumns(4);
    layoutOwnerDetails1.addComponent(new ComponentIterOwnerDetails("", ""));
    layoutOwnerDetails.addComponent(layoutOwnerDetails1);
    layoutOwnerDetails1.setSpacing(true);
    layoutOwnerDetails1.setMargin(true);

    // for document details
    panelNormalDocumentDetails.addComponent(btnAddNorDoc);
    panelNormalDocumentDetails.setComponentAlignment(btnAddNorDoc, Alignment.TOP_RIGHT);
    panelNormalDocumentDetails.addComponent(new ComponentIteratorNormlDoc(null, null, "", ""));
    panelNormalDocumentDetails.setMargin(true);
    panelLegalDocumentDetails.addComponent(btnAddLegalDoc);
    panelLegalDocumentDetails.setComponentAlignment(btnAddLegalDoc, Alignment.TOP_RIGHT);
    panelLegalDocumentDetails.addComponent(new ComponentIteratorLegalDoc("", "", null));
    panelLegalDocumentDetails.setMargin(true);
    layoutNormalLegal.addComponent(PanelGenerator.createPanel(panelNormalDocumentDetails));
    lblHeading = new Label("Legal Documents");
    layoutNormalLegal.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutNormalLegal.addComponent(PanelGenerator.createPanel(panelLegalDocumentDetails));
    layoutNormalLegal.setMargin(true);
    panelNormalDocumentDetails.setWidth("100%");
    panelLegalDocumentDetails.setWidth("100%");

    // for adjoin properties
    panelAdjoinProperties.addComponent(btnAddAdjoinProperty);
    panelAdjoinProperties.setComponentAlignment(btnAddAdjoinProperty, Alignment.BOTTOM_RIGHT);
    panelAdjoinProperties.addComponent(new ComponentIteratorAdjoinProperty(null, true, true, true));

    // for dimensions
    panelDimension.addComponent(btnAddDimension);
    panelDimension.setComponentAlignment(btnAddDimension, Alignment.BOTTOM_RIGHT);
    panelDimension.addComponent(new ComponentIterDimensionofPlot(null, true, true, true));

    //for description of the property
    layoutDescProperty.setMargin(true);
    layoutDescProperty1.setSpacing(true);
    layoutDescProperty1.setColumns(4);
    layoutDescProperty.addComponent(btnDynamicDescProp);
    layoutDescProperty.setComponentAlignment(btnDynamicDescProp, Alignment.TOP_RIGHT);
    layoutDescProperty1.addComponent(tfSiteNumber);
    layoutDescProperty1.addComponent(tfSFNumber);
    layoutDescProperty1.addComponent(tfNewSFNumber);
    layoutDescProperty1.addComponent(tfVillage);
    layoutDescProperty1.addComponent(tfTaluk);
    layoutDescProperty1.addComponent(tfDistCorpPanc);
    layoutDescProperty1.addComponent(tfLocationSketch);
    layoutDescProperty1.addComponent(tfProTaxReceipt);
    layoutDescProperty1.addComponent(tfElecServiceConnNo);
    layoutDescProperty1.addComponent(tfElecConnecName);
    layoutDescProperty1.addComponent(slHighMiddPoor);
    layoutDescProperty1.addComponent(slUrbanSemiRural);
    layoutDescProperty1.addComponent(slResiIndustCommer);
    layoutDescProperty1.addComponent(slProOccupiedBy);
    layoutDescProperty1.addComponent(tfMonthlyRent);
    layoutDescProperty1.addComponent(tfCoverUnderStatCentral);
    layoutDescProperty1.addComponent(tfAnyConversionLand);
    layoutDescProperty1.addComponent(tfExtentSite);
    layoutDescProperty1.addComponent(tfYearAcquistion);
    layoutDescProperty1.addComponent(tfPurchaseValue);
    layoutDescProperty1.addComponent(tfPropLandmark);
    layoutDescProperty1.addComponent(tfPostalAddress);
    layoutDescProperty1.addComponent(tfDynamicDescProp1);
    layoutDescProperty1.addComponent(tfDynamicDescProp2);
    layoutDescProperty.addComponent(layoutDescProperty1);
    tfDynamicDescProp1.setVisible(false);
    tfDynamicDescProp2.setVisible(false);
    //for charcteristiccs of the site
    layoutCharcterSite1.setSpacing(true);
    layoutCharcterSite1.setColumns(4);
    layoutCharcterSite.setMargin(true);
    layoutCharcterSite.addComponent(btnDynamicCharacter);
    layoutCharcterSite.setComponentAlignment(btnDynamicCharacter, Alignment.TOP_RIGHT);
    layoutCharcterSite1.addComponent(slLocalClass);
    layoutCharcterSite1.addComponent(slSurroundDevelop);
    layoutCharcterSite1.addComponent(tfFlood);
    layoutCharcterSite1.addComponent(slFeasibility);
    layoutCharcterSite1.addComponent(slLandLevel);
    layoutCharcterSite1.addComponent(slLandShape);
    layoutCharcterSite1.addComponent(slTypeUse);
    layoutCharcterSite1.addComponent(tfUsageRestriction);
    layoutCharcterSite1.addComponent(slIsPlot);
    layoutCharcterSite1.addComponent(tfApprveNo);
    layoutCharcterSite1.addComponent(tfNoReason);
    layoutCharcterSite1.addComponent(tfSubdivide);
    layoutCharcterSite1.addComponent(slDrawApproval);
    layoutCharcterSite1.addComponent(slCornerInter);
    layoutCharcterSite1.addComponent(slRoadFacility);
    layoutCharcterSite1.addComponent(slTypeRoad);
    layoutCharcterSite1.addComponent(slRoadWidth);
    layoutCharcterSite1.addComponent(slLandLock);
    layoutCharcterSite1.addComponent(slWaterPotential);
    layoutCharcterSite1.addComponent(slUnderSewerage);
    layoutCharcterSite1.addComponent(slPowerSupply);
    layoutCharcterSite1.addComponent(tfAdvantageSite);
    layoutCharcterSite1.addComponent(tfDisadvantageSite);
    layoutCharcterSite1.addComponent(tfGeneralRemarks);
    layoutCharcterSite1.addComponent(tfDynamicCharacter1);
    layoutCharcterSite1.addComponent(tfDynamicCharacter2);
    layoutCharcterSite.addComponent(layoutCharcterSite1);
    tfDynamicCharacter1.setVisible(false);
    tfDynamicCharacter2.setVisible(false);

    // valuation of land
    layoutValuationLand.setSpacing(true);
    layoutValuationLand1.setSpacing(true);
    layoutValuationLand1.setColumns(4);
    layoutValuationLand1.addComponent(tfAreaofLand);
    layoutValuationLand1.addComponent(tfNorthandSouth);
    layoutValuationLand1.addComponent(tfMarketRate);
    layoutValuationLand1.addComponent(tfGuiderate);
    layoutValuationLand1.addComponent(tfAdopetdMarketRate);
    layoutValuationLand1.addComponent(tfFairMarketRate);
    layoutValuationLand1.addComponent(tfDynamicValuation1);
    layoutValuationLand1.addComponent(tfDynamicValuation2);
    tfDynamicValuation1.setVisible(false);
    tfDynamicValuation2.setVisible(false);
    layoutValuationLand.addComponent(btnDynamicValuation);
    layoutValuationLand.setComponentAlignment(btnDynamicValuation, Alignment.TOP_RIGHT);
    layoutValuationLand.addComponent(layoutValuationLand1);
    layoutValuationLand.setMargin(true);
    tfFairMarketRate.setValue("0.00");
    tfAdopetdMarketRate.setRequired(true);
    //property value
    layoutPropertyValue.setSpacing(true);
    layoutPropertyValue.setMargin(true);
    layoutPropertyValue1.setColumns(4);
    layoutPropertyValue1.setSpacing(true);
    layoutPropertyValue1.addComponent(tfRealziableRate);
    layoutPropertyValue1.addComponent(tfDistressRate);
    layoutPropertyValue1.addComponent(tfGuidelineRate);
    layoutPropertyValue.addComponent(layoutPropertyValue1);

    //for flat1
    layoutForFlats.setMargin(true);
    layoutForFlats.setSpacing(true);
    layoutForFlats1.setSpacing(true);
    layoutForFlats.addComponent(btnDynamicForFlat);
    layoutForFlats.setComponentAlignment(btnDynamicForFlat, Alignment.TOP_RIGHT);
    layoutForFlats1.addComponent(slUndivideShare);
    layoutForFlats1.addComponent(tfUDSproportion);
    layoutForFlats1.addComponent(tfUDSArea);
    layoutForFlats1.addComponent(tfFlatsApproved);
    layoutForFlats1.addComponent(tfFlatsWorkplan);
    layoutForFlats1.addComponent(slUnderPermissable);
    layoutForFlats1.addComponent(lblFloorIndex);
    layoutForFlats1.addComponent(tfIndexPlan);
    layoutForFlats1.addComponent(tfIndexSite);
    layoutForFlats1.addComponent(tfIndexCalculation);
    layoutForFlats1.addComponent(tfDynamicForFlat1);
    layoutForFlats1.addComponent(tfDynamicForFlat2);
    tfDynamicForFlat1.setVisible(false);
    tfDynamicForFlat2.setVisible(false);
    layoutForFlats.addComponent(layoutForFlats1);

    //for Calculation-extra Items
    layoutExtraItems.setCaption("Extra Items");
    layoutExtraItems.setWidth("420px");
    layoutExtraItems.addComponent(btnDynamicExtra);
    layoutExtraItems.setComponentAlignment(btnDynamicExtra, Alignment.TOP_RIGHT);
    layoutExtraItems.addComponent(new ComponentIterExtraItems(null, ""));

    layoutAdditionItem.setCaption("Additional Items");
    layoutAdditionItem.setWidth("400px");
    layoutAdditionItem.addComponent(btnDynamicAdditional);
    layoutAdditionItem.setComponentAlignment(btnDynamicAdditional, Alignment.TOP_RIGHT);
    layoutAdditionItem.addComponent(new ComponentIterAdditionalItems(null, ""));

    layoutExtraAddItems1.setSpacing(true);
    layoutExtraAddItems1.setMargin(true);
    layoutExtraAddItems.setColumns(2);
    layoutExtraAddItems.addComponent(layoutExtraItems);
    layoutExtraAddItems.addComponent(layoutAdditionItem);
    layoutExtraAddItems1.addComponent(layoutExtraAddItems);

    //for Miscellaneous
    layoutMiscellaneous.setCaption("Miscellaneous");
    layoutMiscellaneous.setWidth("420px");
    layoutMiscellaneous.addComponent(btnDynamicMiscell);
    layoutMiscellaneous.setComponentAlignment(btnDynamicMiscell, Alignment.TOP_RIGHT);
    layoutMiscellaneous.addComponent(new ComponentIterMiscellaneous(null, ""));

    layoutServices.setCaption("Services");
    layoutServices.setWidth("400px");
    layoutServices.addComponent(btnDynamicServices);
    layoutServices.setComponentAlignment(btnDynamicServices, Alignment.TOP_RIGHT);
    layoutServices.addComponent(new ComponentIerServices(null, ""));

    layoutMiscellService1.setSpacing(true);
    layoutMiscellService1.setMargin(true);
    layoutMiscellService.setColumns(2);
    layoutMiscellService.addComponent(layoutMiscellaneous);
    layoutMiscellService.addComponent(layoutServices);
    layoutMiscellService1.addComponent(layoutMiscellService);

    // for details of plan approval
    layoutPlanApproval1.setColumns(2);
    FormLayout lay1 = new FormLayout();
    FormLayout lay2 = new FormLayout();
    lay1.addComponent(tfLandandBuilding);
    lay1.addComponent(tfBuilding);
    lay1.addComponent(tfPlanApprovedBy);
    lay1.addComponent(dfLicenseFrom);
    lay1.addComponent(slIsLicenceForced);
    lay1.addComponent(tfDynamicPlanApproval2);

    lay2.addComponent(tfQuality);
    lay2.addComponent(slAllApprovalRecved);
    lay2.addComponent(slConstAsperAppPlan);
    lay2.addComponent(tfReason);
    lay2.addComponent(tfDynamicPlanApproval1);
    tfDynamicPlanApproval1.setVisible(false);
    tfDynamicPlanApproval2.setVisible(false);
    lay1.setSpacing(true);
    lay2.setSpacing(true);
    layoutPlanApproval1.addComponent(lay1);
    layoutPlanApproval1.addComponent(lay2);
    layoutPlanApproval1.setSpacing(true);
    layoutPlanApproval1.setMargin(true);
    layoutPlanApproval.addComponent(btnDynamicPlanApproval);
    layoutPlanApproval.setComponentAlignment(btnDynamicPlanApproval, Alignment.TOP_RIGHT);
    layoutPlanApproval.addComponent(layoutPlanApproval1);
    //valuation of Construction
    formConstValuation1.addComponent(slTypeProperty);
    formConstValuation1.addComponent(slTypeStructure);
    formConstValuation1.addComponent(tfYearConstruction);
    formConstValuation1.addComponent(slExterior);
    formConstValuation1.addComponent(slInterior);
    formConstValuation1.addComponent(tfLifeAge);
    formConstValuation1.addComponent(tfFutureLife);
    formConstValuation1.addComponent(tfDetailsPlan);
    formConstValuation1.addComponent(slDeviation);
    formConstValuation1.addComponent(tfDtlsDeviation);

    formConstValuation2.addComponent(btnAddRoofHt);
    formConstValuation2.addComponent(tfNoFloors);

    layoutConstValuation.setSpacing(true);
    layoutConstValuation1.setSpacing(true);
    layoutConstValuation1.setColumns(2);
    layoutConstValuation1.addComponent(formConstValuation1);
    layoutConstValuation1.addComponent(new VerticalLayout() {
        {
            addComponent(formConstValuation2);
            addComponent(layoutRoofHeight);
        }

    });

    formConstValuation1.addComponent(tfDynamicConstval1);
    formConstValuation1.addComponent(tfDynamicConstval2);
    layoutConstValuation.addComponent(btnDynamicConstVal);
    layoutConstValuation.setComponentAlignment(btnDynamicConstVal, Alignment.TOP_RIGHT);
    layoutConstValuation.addComponent(layoutConstValuation1);
    layoutConstValuation.setMargin(true);

    // for Build Specification
    panelBuildSpecfication.addComponent(btnAddBuildSpec);
    panelBuildSpecfication.setComponentAlignment(btnAddBuildSpec, Alignment.BOTTOM_RIGHT);
    panelBuildSpecfication.addComponent(new ComponentIterBuildingSpecfication(null, true, true, true));
    panelBuildSpecfication.setWidth("100%");

    //for Valuation Details
    layoutValuationDetails.addComponent(btnAddValDtls);
    layoutValuationDetails1.setColumns(8);
    layoutValuationDetails1.setSpacing(true);
    layoutValuationDetails.setComponentAlignment(btnAddValDtls, Alignment.TOP_RIGHT);
    layoutValuationDetails1.addComponent(lblParticular);
    layoutValuationDetails1.addComponent(lblPlinthArea);
    layoutValuationDetails1.addComponent(lblRoofHt);
    layoutValuationDetails1.addComponent(lblBuildAge);
    layoutValuationDetails1.addComponent(lblRate);
    layoutValuationDetails1.addComponent(lblReplace);
    layoutValuationDetails1.addComponent(lblDepreciation);
    layoutValuationDetails1.addComponent(lblNetvalue);
    layoutValuationDetails1.setComponentAlignment(lblParticular, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblPlinthArea, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblRoofHt, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblBuildAge, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblRate, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblReplace, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblDepreciation, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblNetvalue, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setWidth("650px");
    layoutValuationDetails.addComponent(layoutValuationDetails1);
    layoutValuationDetails.addComponent(layoutValuationDetails2);
    layoutValuationDetails.setWidth("100%");
    layoutValuationDetails.setMargin(true);
    ValuationDetailsList obj = new ValuationDetailsList();
    ValuationDetailsList obj1 = new ValuationDetailsList();
    obj.setFloorDtlsLabel("Ground Floor Building");
    obj1.setFloorDtlsLabel("First Floor Building");
    layoutValuationDetails2.addComponent(new ComponenetIterValuationDetails(obj));
    layoutValuationDetails2.addComponent(new ComponenetIterValuationDetails(obj1));

    // for plinth area
    layoutPlintharea.addComponent(btnAddPlinth);
    layoutPlintharea.setComponentAlignment(btnAddPlinth, Alignment.BOTTOM_RIGHT);
    layoutPlintharea.setMargin(true);
    layoutPlintharea.addComponent(new ComponentIterPlinthArea("Ground Floor", "", ""));
    layoutPlintharea.addComponent(new ComponentIterPlinthArea("Portico and Stair", "", ""));

    //for applicant estimate
    layoutElectrical.setSpacing(true);
    layoutElectrical1.setSpacing(true);
    layoutElectrical1.setColumns(4);
    layoutElectrical1.addComponent(tfTypeofwiring);
    layoutElectrical1.addComponent(tfClassFit);
    layoutElectrical1.addComponent(tfNOofLight);
    layoutElectrical1.addComponent(tfExhaustFan);
    layoutElectrical1.addComponent(tfSpareplug);
    layoutElectrical1.addComponent(tfDynamicElectrical1);
    layoutElectrical1.addComponent(tfDynamicElectrical2);
    tfDynamicElectrical1.setVisible(false);
    tfDynamicElectrical2.setVisible(false);
    layoutElectrical.addComponent(btnDynamicElectrical);
    layoutElectrical.setComponentAlignment(btnDynamicElectrical, Alignment.TOP_RIGHT);
    layoutElectrical.addComponent(layoutElectrical1);
    layoutElectrical.setMargin(true);

    //for applicant reasonable
    layoutPlumbing.setSpacing(true);
    layoutPlumbing1.setSpacing(true);
    layoutPlumbing1.setColumns(4);
    layoutPlumbing1.addComponent(tfNoofClosets);
    layoutPlumbing1.addComponent(tfNoofWashbin);
    layoutPlumbing1.addComponent(tfWatertaps);
    layoutPlumbing1.addComponent(tfAnyFixtures);
    layoutPlumbing1.addComponent(tfDynamicPlum1);
    layoutPlumbing1.addComponent(tfDynamicPlum2);

    layoutPlumbing.addComponent(btnDynamicPlumbing);
    layoutPlumbing.setComponentAlignment(btnDynamicPlumbing, Alignment.TOP_RIGHT);
    layoutPlumbing.addComponent(layoutPlumbing1);
    layoutPlumbing.setMargin(true);

    // for Guideline area
    layoutGuideline.addComponent(btnAddGuideline);
    layoutGuideline.setComponentAlignment(btnAddGuideline, Alignment.TOP_RIGHT);
    layoutGuideline.setMargin(true);
    layoutGuideline.addComponent(new ComponentIterGuideline("Land", "", "", ""));
    layoutGuideline.addComponent(new ComponentIterGuideline("Construction", "", "", ""));

    // for guide line reference
    streetLayout.addComponent(slStreetSerNo);
    streetLayout.addComponent(tfStreetName);

    layoutGuidelineReference1.setColumns(4);
    layoutGuidelineReference1.setSpacing(true);
    layoutGuidelineReference1.addComponent(tfZone);
    layoutGuidelineReference1.addComponent(tfSRO);
    layoutGuidelineReference1.addComponent(tfVillage);
    layoutGuidelineReference1.addComponent(tfRevnueDist);
    layoutGuidelineReference1.addComponent(tfTalukName);
    layoutGuidelineReference1.addComponent(streetLayout);
    layoutGuidelineReference1.addComponent(tfGuidelineValue);
    layoutGuidelineReference1.addComponent(tfGuidelineValueMatric);
    layoutGuidelineReference1.addComponent(slClassification);
    layoutGuidelineReference1.setMargin(true);

    layoutGuidelineReference.setSpacing(true);
    layoutGuidelineReference.addComponent(layoutGuidelineReference1);

    // add components in main panel
    accordion.setWidth("100%");
    layoutEvaluationDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutEvaluationDetails), "Evaluation Details");

    layoutOwnerDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutAssetOwner), "Owner Details/Asset Details");
    layoutAssetDetails.setStyleName("bluebar");

    layoutNormalLegal.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutNormalLegal), "Document Details");

    panelAdjoinProperties.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(panelAdjoinProperties), "Adjoining Properties");
    panelDimension.setStyleName("bluebar");
    accordion.addTab(panelDimension, "Dimension");

    layoutDescProperty.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutDescProperty), "Description of the property");
    layoutCharcterSite.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutCharcterSite), "Characteristics of the site");
    layoutValuationLand.setStyleName("bluebar");
    accordion.addTab(layoutValuationLand, "Valuation of Land");
    layoutPlanApproval.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPlanApproval), "Details of Plan Approval");
    layoutPlintharea.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPlintharea), "Plinth Area Details");
    layoutForFlats.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutForFlats), "For Flats");
    layoutConstValuation.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutConstValuation), "Technical Details of the Building");
    panelBuildSpecfication.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(panelBuildSpecfication), "Specification");
    layoutValuationDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutValuationDetails), "Details of Valuation");
    layoutExtraAddItems1.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutExtraAddItems1), "Extra/Additional Items");
    layoutMiscellService1.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutMiscellService1), "Miscellaneous/Services");
    layoutElectrical.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutElectrical), "Electrical Installation");

    layoutPlumbing.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPlumbing), "Plumbing Installation");

    layoutGuideline.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutGuideline), "Guideline Details");

    layoutGuidelineReference.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutGuidelineReference), "Guideline Reference Details");
    layoutPropertyValue.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPropertyValue), "Property Value Details");
    this.accordion.addListener(new SelectedTabChangeListener() {
        public void selectedTabChange(SelectedTabChangeEvent event) {
            if (event.getTabSheet().getSelectedTab().equals(panelDimension)) {
                Iterator<Component> myComps = panelDimension.getComponentIterator();
                BigDecimal siteArea = new BigDecimal(0.00);
                while (myComps.hasNext()) {
                    final Component component = myComps.next();
                    int i = 1;

                    if (component instanceof ComponentIterDimensionofPlot) {

                        ComponentIterDimensionofPlot mycomponent = (ComponentIterDimensionofPlot) component;
                        List<TPemCmPropDimension> getList = mycomponent.getDimensionPropertyList();

                        try {
                            List<String> mylist = mycomponent.getLeastValaue();
                            siteArea = siteArea.add(new BigDecimal(mylist.get(0).replaceAll("[^\\d.]", "")));
                            tfNorthandSouth.setValue(mylist.get(1));
                            tfAreaofLand.setValue(siteArea.toString());
                        } catch (Exception e) {

                            logger.info("Error-->" + e);
                        }
                    }
                }
                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) {

                }
            }

        }
    });
    /*tfEvaluationNumber.addValidator(new IntegerValidator("Enter numbers only"));
    tfEvaluationNumber.addBlurListener(new SaarcValidate(tfEvaluationNumber));*/
    tfEvaluationNumber.setImmediate(true);

    tfEvaluationNumber.addBlurListener(new BlurListener() {

        private static final long serialVersionUID = 1L;

        public void blur(BlurEvent event) {
            // TODO Auto-generated method stub
            if (!tfEvaluationNumber.isReadOnly()) {
                tfEvaluationNumber.setComponentError(null);
                try {
                    tfEvaluationNumber.setComponentError(null);
                    String evalno = tfEvaluationNumber.getValue().toString();
                    count = beanEvaluation.getEvalNoCount(evalno);

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

                        if (count == 0) {

                            tfEvaluationNumber.setComponentError(null);

                        } else {

                            tfEvaluationNumber
                                    .setComponentError(new UserError("Evaluation number is already Exist"));

                        }
                    }
                } catch (Exception e) {

                }
            }

        }
    });
    layoutMainForm.addComponent(PanelGenerator.createPanel(accordion));

    mainPanel.addComponent(layoutMainForm);
    mainPanel.addComponent(layoutButton2);
    mainPanel.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);
    mainPanel.setVisible(false);

    layoutMainForm.setMargin(true);
    layoutMainForm.setSpacing(true);
    // for main panel
    layoutButton2.setSpacing(true);
    btnSave.setStyleName("savebt");
    btnCancel.setStyleName("cancelbt");
    btnSubmit.setStyleName("submitbt");
    //   saveExcel.addStyleName("downloadbt");
    btnSave.setVisible(false);
    btnSubmit.setVisible(false);
    btnCancel.setVisible(false);

    layoutButton2.addComponent(btnSave);
    //   layoutButton2.addComponent(saveExcel);
    layoutButton2.addComponent(btnSubmit);
    layoutButton2.addComponent(btnCancel);
    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);

    // Initaited the Label Function here by Hohul
    lblTableTitle = new Label();
    lblSaveNotification = new Label();
    lblSaveNotification.setContentMode(ContentMode.HTML);
    lblNotificationIcon = new Label();
    lblTableTitle.setValue("<B>&nbsp;&nbsp;Action:</B>");
    lblTableTitle.setContentMode(ContentMode.HTML);
    lblFormTittle = new Label();
    lblFormTittle.setContentMode(ContentMode.HTML);
    lblFormTittle.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;Home");
    lblFormTitle1 = new Label();
    lblFormTitle1.setContentMode(ContentMode.HTML);
    lblFormTitle1.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;");
    lblAddEdit = new Label();
    lblAddEdit.setContentMode(ContentMode.HTML);

    // Button Back declaration by Hohul
    btnBack = new Button("Home", this);
    btnBack.setStyleName("link");

    // Bread Scrumbs initiated here by Hohul

    hlBreadCrumbs = new HorizontalLayout();
    hlBreadCrumbs.addComponent(lblFormTitle1);
    hlBreadCrumbs.addComponent(btnBack);
    hlBreadCrumbs.setComponentAlignment(btnBack, Alignment.TOP_CENTER);
    hlBreadCrumbs.addComponent(lblAddEdit);
    hlBreadCrumbs.setComponentAlignment(lblAddEdit, Alignment.MIDDLE_CENTER);
    hlBreadCrumbs.setVisible(false);

    // for search panel
    // for search panel
    // Added by Hohul ----->  For Search Panel Layouts
    FormLayout flSearchEvalNumber = new FormLayout();
    flSearchEvalNumber.addComponent(tfSearchEvalNumber);

    FormLayout flSearchBankbranch = new FormLayout();
    flSearchBankbranch.addComponent(slSearchBankbranch);

    FormLayout flSearchCustomer = new FormLayout();
    flSearchCustomer.addComponent(tfSearchCustomer);

    HorizontalLayout hlSearchComponentLayout = new HorizontalLayout();
    hlSearchComponentLayout.addComponent(flSearchEvalNumber);
    hlSearchComponentLayout.addComponent(flSearchBankbranch);
    hlSearchComponentLayout.addComponent(flSearchCustomer);
    hlSearchComponentLayout.setSpacing(true);
    hlSearchComponentLayout.setMargin(true);

    //Initialization and properties for btnDownload      
    btnDownload = new Button("Download");
    //btnDownload.setDescription("Download");
    btnDownload.addStyleName("downloadbt");
    btnDownload.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            //  UI.getCurrent()..clearDashboardButtonBadge();
            event.getButton().removeStyleName("unread");
            if (notifications != null && notifications.getUI() != null)
                notifications.close();
            else {
                buildNotifications(event);
                UI.getCurrent().addWindow(notifications);
                notifications.focus();
                ((VerticalLayout) UI.getCurrent().getContent())
                        .addLayoutClickListener(new LayoutClickListener() {
                            @Override
                            public void layoutClick(LayoutClickEvent event) {
                                notifications.close();
                                ((VerticalLayout) UI.getCurrent().getContent()).removeLayoutClickListener(this);
                            }
                        });
            }

        }
    });

    hlFileDownloadLayout = new HorizontalLayout();
    hlFileDownloadLayout.setSpacing(true);
    hlFileDownloadLayout.addComponent(btnDownload);
    hlFileDownloadLayout.setComponentAlignment(btnDownload, Alignment.MIDDLE_CENTER);

    VerticalLayout vlSearchandResetButtonLAyout = new VerticalLayout();
    vlSearchandResetButtonLAyout.setSpacing(true);
    vlSearchandResetButtonLAyout.addComponent(btnReset);
    vlSearchandResetButtonLAyout.setWidth("100");
    vlSearchandResetButtonLAyout.addStyleName("topbarthree");
    vlSearchandResetButtonLAyout.setMargin(true);

    HorizontalLayout hlSearchComponentandButtonLayout = new HorizontalLayout();
    hlSearchComponentandButtonLayout.setSizeFull();
    hlSearchComponentandButtonLayout.setSpacing(true);
    hlSearchComponentandButtonLayout.addComponent(hlSearchComponentLayout);
    hlSearchComponentandButtonLayout.setComponentAlignment(hlSearchComponentLayout, Alignment.MIDDLE_LEFT);
    hlSearchComponentandButtonLayout.addComponent(vlSearchandResetButtonLAyout);
    hlSearchComponentandButtonLayout.setComponentAlignment(vlSearchandResetButtonLAyout,
            Alignment.MIDDLE_RIGHT);
    hlSearchComponentandButtonLayout.setExpandRatio(vlSearchandResetButtonLAyout, 1);
    final VerticalLayout vlSearchComponentandButtonLayout = new VerticalLayout();
    vlSearchComponentandButtonLayout.setSpacing(true);
    vlSearchComponentandButtonLayout.setSizeFull();
    vlSearchComponentandButtonLayout.addComponent(hlSearchComponentandButtonLayout);

    /*layoutSearch.addComponent(tfSearchEvalNumber);
    layoutSearch.addComponent(slSearchBankbranch);
    layoutSearch.addComponent(tfSearchCustomer);
    layoutSearch.addComponent(btnReset);
    layoutSearch.setComponentAlignment(btnReset, Alignment.BOTTOM_LEFT);
    btnSearch.addStyleName("default");*/
    btnReset.addStyleName("resetbt");
    tfSearchCustomer.setImmediate(true);
    tfSearchCustomer.addListener(new TextChangeListener() {
        private static final long serialVersionUID = 1L;
        SimpleStringFilter filter = null;

        public void textChange(TextChangeEvent event) {
            Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
            if (filter != null)
                f.removeContainerFilter(filter);

            filter = new SimpleStringFilter("custName", event.getText(), true, false);

            f.addContainerFilter(filter);
            total = f.size();
            tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
        }
    });
    tfSearchEvalNumber.setImmediate(true);
    tfSearchEvalNumber.addListener(new TextChangeListener() {
        private static final long serialVersionUID = 1L;
        SimpleStringFilter filter = null;

        public void textChange(TextChangeEvent event) {
            Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
            if (filter != null)
                f.removeContainerFilter(filter);

            filter = new SimpleStringFilter("evalNo", event.getText(), true, false);

            f.addContainerFilter(filter);
            total = f.size();
            tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
        }
    });
    slSearchBankbranch.setImmediate(true);
    slSearchBankbranch.addValueChangeListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;
        Filter filter = null;

        @Override
        public void valueChange(ValueChangeEvent event) {
            // TODO Auto-generated method stub

            try {
                String strBankBranch = slSearchBankbranch.getValue().toString();
                Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
                if (filter != null)
                    f.removeContainerFilter(filter);

                filter = new Compare.Equal("bankBranch", strBankBranch);
                f.addContainerFilter(filter);
                f.addContainerFilter(filter);
                total = f.size();
                tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
            } catch (Exception e) {
            }
        }

    });
    searchPanel.addComponent(PanelGenerator.createPanel(vlSearchComponentandButtonLayout));
    searchPanel.setMargin(true);

    // Add Layout table panel by Hohul

    HorizontalLayout flTableCaption = new HorizontalLayout();
    flTableCaption.addComponent(lblTableTitle);
    flTableCaption.setComponentAlignment(lblTableTitle, Alignment.MIDDLE_CENTER);
    flTableCaption.addStyleName("lightgray");
    flTableCaption.setHeight("25px");
    flTableCaption.setWidth("60px");
    lblNoofRecords = new Label(" ", ContentMode.HTML);
    lblNoofRecords.addStyleName("lblfooter");
    HorizontalLayout hlTableTittleLayout = new HorizontalLayout();
    hlTableTittleLayout.addComponent(flTableCaption);
    hlTableTittleLayout.addComponent(btnAdd);
    hlTableTittleLayout.addComponent(btnEdit);
    hlTableTittleLayout.addComponent(btnView);
    hlTableTittleLayout.setHeight("25px");
    hlTableTittleLayout.setSpacing(true);

    HorizontalLayout hlTableTitleandCaptionLayout = new HorizontalLayout();
    hlTableTitleandCaptionLayout.addStyleName("topbarthree");
    hlTableTitleandCaptionLayout.setWidth("100%");
    hlTableTitleandCaptionLayout.addComponent(hlTableTittleLayout);
    hlTableTitleandCaptionLayout.addComponent(hlFileDownloadLayout);
    hlTableTitleandCaptionLayout.setComponentAlignment(hlFileDownloadLayout, Alignment.MIDDLE_RIGHT);
    hlTableTitleandCaptionLayout.setHeight("28px");

    // for table panel
    btnAdd.addStyleName("add");
    btnEdit.addStyleName("editbt");
    btnView.addStyleName("view");
    btnView.setEnabled(false);

    hlAddEditLayout.addStyleName("topbarthree");
    hlAddEditLayout.setWidth("100%");
    hlAddEditLayout.addComponent(hlTableTitleandCaptionLayout);
    hlAddEditLayout.setHeight("28px");
    // Added Action Label to Table

    layoutTable.addComponent(hlAddEditLayout);
    layoutTable.setComponentAlignment(hlAddEditLayout, Alignment.TOP_LEFT);
    layoutTable.addComponent(tblEvalDetails);

    tablePanel.addComponent(layoutTable);
    tablePanel.setWidth("100%");
    tablePanel.setMargin(true);

    slSearchBankbranch.setNullSelectionAllowed(false);
    slSearchBankbranch.setInputPrompt(Common.SELECT_PROMPT);
    tfSearchCustomer.setInputPrompt("Enter Customer");
    tfSearchEvalNumber.setInputPrompt("Enter Evaluation Number");
    tfAdopetdMarketRate.setInputPrompt("Enter Market Rate");
    tfAdvantageSite.setInputPrompt("Enter Advantage Site");
    tfAnyConversionLand.setInputPrompt("Enter Conversion Land");
    tfAnyFixtures.setInputPrompt("Enter Fixtures");
    tfApprveNo.setInputPrompt("Enter Approve No");
    tfAreaofLand.setInputPrompt("Enter Area Of Land");
    tfBuilding.setInputPrompt("Enter Building");
    tfCaption.setInputPrompt("Enter Caption");
    tfClassFit.setInputPrompt("Enter Class Fit");
    tfCoverUnderStatCentral.setInputPrompt("Enter Cover Under State Central");
    //tfCustomerAddr.setInputPrompt("Enter Customer Address");
    //tfCustomerName.setInputPrompt("Enter Customer Name");
    tfDetailsPlan.setInputPrompt("Enter Detail Plan");
    tfDisadvantageSite.setInputPrompt("Enter Disadvantages");
    tfDistCorpPanc.setInputPrompt("Enter District");
    tfDistressRate.setInputPrompt("Enter Distress Rate");
    tfDtlsDeviation.setInputPrompt("Enter Deviation Details");
    tfDynamicAsset1.setInputPrompt("Enter Dynamic Asset");
    tfDynamicAsset2.setInputPrompt("Enter Dynamic Asset");
    tfDynamicCharacter1.setInputPrompt("Enter Dynamic Character");
    tfDynamicCharacter2.setInputPrompt("Enter Dynamic Character");
    tfDynamicConstval1.setInputPrompt("Enter Dynamic Constant Value");
    tfDynamicConstval2.setInputPrompt("Enter Dynamic Constant Value");
    tfDynamicDescProp1.setInputPrompt("Enter Dynamic Description");
    tfDynamicDescProp2.setInputPrompt("Enter Dynamic Description");
    tfDynamicElectrical1.setInputPrompt("Enter Dynamic Electrial");
    tfDynamicElectrical2.setInputPrompt("Enter Dynamic Electrial");
    tfDynamicEvaluation1.setInputPrompt("Enter Dynamic Evaluation");
    tfDynamicEvaluation2.setInputPrompt("Enter Dynamic Evaluation");
    tfDynamicForFlat1.setInputPrompt("Enter Flat");
    tfDynamicForFlat2.setInputPrompt("Enter Flat");
    tfDynamicPlanApproval1.setInputPrompt("Enter Plan Approval");
    tfDynamicPlanApproval2.setInputPrompt("Enter Plan Approval");
    tfDynamicPlum1.setInputPrompt("Enter Plumping");
    tfDynamicPlum2.setInputPrompt("Enter Plumping");
    tfDynamicValuation1.setInputPrompt("Enter Valuation");
    tfDynamicValuation2.setInputPrompt("Enter Valuation");

    layoutPage.addComponent(mainPanel);
    layoutPage.addComponent(searchPanel);
    layoutPage.addComponent(tablePanel);

    // Added labels and titles to respective Location by Hohul

    HorizontalLayout hlNotificationLayout = new HorizontalLayout();
    hlNotificationLayout.addComponent(lblNotificationIcon);
    hlNotificationLayout.setComponentAlignment(lblNotificationIcon, Alignment.MIDDLE_LEFT);
    hlNotificationLayout.addComponent(lblSaveNotification);
    hlNotificationLayout.setComponentAlignment(lblSaveNotification, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(lblFormTittle);
    hlHeaderLayout.setComponentAlignment(lblFormTittle, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(hlBreadCrumbs);
    hlHeaderLayout.setComponentAlignment(hlBreadCrumbs, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(hlNotificationLayout);
    hlHeaderLayout.setComponentAlignment(hlNotificationLayout, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.MIDDLE_RIGHT);

    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);

    // load Component list values
    loadComponentListValues();

    //   setTableProperties();
    populateAndConfig(false);

}

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

@SuppressWarnings("deprecation")
void buildView(VerticalLayout layoutPage, HorizontalLayout hlHeaderLayout) {
    // for component width
    setComponentStyle();/* w  w  w.  ja v a  2  s. c o  m*/
    hlHeaderLayout.removeAllComponents();

    tblEvalDetails = new Table();
    tblEvalDetails.setStyleName(Runo.TABLE_SMALL);
    tblEvalDetails.setPageLength(14);
    tblEvalDetails.setSizeFull();
    tblEvalDetails.setFooterVisible(true);
    tblEvalDetails.setSelectable(true);
    tblEvalDetails.setImmediate(true);
    tblEvalDetails.setColumnCollapsingAllowed(true);
    // for evaluation details
    tfEvaluationPurpose.setValue("Collateral Security to the Bank");
    slStreetSerNo.addItem("Street Name");
    slStreetSerNo.addItem("Survey Number");
    slStreetSerNo.setNullSelectionAllowed(false);
    tfEvaluationNumber.setRequired(true);
    slBankBranch.setRequired(true);
    dfDateofValuation.setRequired(true);
    tfEvaluationPurpose.setRequired(true);
    layoutEvaluationDetails1.setColumns(4);

    layoutEvaluationDetails1.addComponent(tfEvaluationNumber);
    layoutEvaluationDetails1.addComponent(slBankBranch);
    layoutEvaluationDetails1.addComponent(tfEvaluationPurpose);
    layoutEvaluationDetails1.addComponent(tfValuatedBy);
    layoutEvaluationDetails1.addComponent(dfDateofValuation);
    layoutEvaluationDetails1.addComponent(dfVerifiedDate);
    layoutEvaluationDetails1.addComponent(tfVerifiedBy);
    layoutEvaluationDetails1.addComponent(tfDynamicEvaluation1);
    layoutEvaluationDetails1.addComponent(tfDynamicEvaluation2);
    tfDynamicEvaluation1.setVisible(false);
    tfDynamicEvaluation2.setVisible(false);
    layoutEvaluationDetails1.setSpacing(true);
    layoutEvaluationDetails1.setMargin(true);

    layoutEvaluationDetails.addComponent(btnDynamicEvaluation1);
    layoutEvaluationDetails.setComponentAlignment(btnDynamicEvaluation1, Alignment.TOP_RIGHT);
    layoutEvaluationDetails.addComponent(layoutEvaluationDetails1);

    // for asset details
    VerticalLayout formAsset1 = new VerticalLayout();
    VerticalLayout formAsset2 = new VerticalLayout();
    VerticalLayout formAsset3 = new VerticalLayout();
    VerticalLayout formAsset4 = new VerticalLayout();
    formAsset1.setSpacing(true);
    formAsset2.setSpacing(true);
    formAsset4.setSpacing(true);

    formAsset1.addComponent(tfCustomerName);
    formAsset1.addComponent(tfLandMark);
    formAsset1.addComponent(slPropertyDesc);
    formAsset2.addComponent(tfCustomerAddr);
    formAsset3.addComponent(tfPropertyAddress);
    formAsset3.addComponent(chkSameAddress);
    formAsset4.addComponent(tfDynamicAsset1);
    formAsset4.addComponent(tfDynamicAsset2);
    tfDynamicAsset1.setVisible(false);
    tfDynamicAsset2.setVisible(false);

    chkSameAddress.setImmediate(true);
    chkSameAddress.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {

            if (chkSameAddress.getValue().equals(true)) {
                tfPropertyAddress.setValue(tfCustomerAddr.getValue());

            } else {
                tfPropertyAddress.setValue("");
            }
        }
    });

    layoutAssetDetails1.setSpacing(true);
    layoutAssetDetails1.setColumns(4);
    layoutAssetDetails1.addComponent(formAsset1);
    layoutAssetDetails1.addComponent(formAsset2);
    layoutAssetDetails1.addComponent(formAsset3);
    layoutAssetDetails1.addComponent(formAsset4);
    layoutAssetDetails1.setMargin(true);

    layoutAssetDetails.addComponent(btnDynamicAsset);
    layoutAssetDetails.setComponentAlignment(btnDynamicAsset, Alignment.TOP_RIGHT);
    layoutAssetDetails.addComponent(layoutAssetDetails1);

    lblHeading = new Label("Owner Details");
    layoutAssetOwner.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutAssetOwner.addComponent(PanelGenerator.createPanel(layoutOwnerDetails));
    lblHeading = new Label("Asset Details");
    layoutAssetOwner.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutAssetOwner.addComponent(PanelGenerator.createPanel(layoutAssetDetails));

    // for Owner Details
    layoutOwnerDetails.addComponent(btnAddOwner);
    layoutOwnerDetails.setComponentAlignment(btnAddOwner, Alignment.TOP_RIGHT);
    layoutOwnerDetails1.setColumns(4);
    layoutOwnerDetails1.addComponent(new ComponentIterOwnerDetails("", ""));
    layoutOwnerDetails.addComponent(layoutOwnerDetails1);
    layoutOwnerDetails1.setSpacing(true);
    layoutOwnerDetails1.setMargin(true);

    // for document details
    panelNormalDocumentDetails.addComponent(btnAddNorDoc);
    panelNormalDocumentDetails.setComponentAlignment(btnAddNorDoc, Alignment.TOP_RIGHT);
    panelNormalDocumentDetails.addComponent(new ComponentIteratorNormlDoc(null, null, "", ""));
    panelNormalDocumentDetails.setMargin(true);
    panelLegalDocumentDetails.addComponent(btnAddLegalDoc);
    panelLegalDocumentDetails.setComponentAlignment(btnAddLegalDoc, Alignment.TOP_RIGHT);
    panelLegalDocumentDetails.addComponent(new ComponentIteratorLegalDoc("", "", null));
    panelLegalDocumentDetails.setMargin(true);
    layoutNormalLegal.addComponent(PanelGenerator.createPanel(panelNormalDocumentDetails));
    lblHeading = new Label("Legal Documents");
    layoutNormalLegal.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutNormalLegal.addComponent(PanelGenerator.createPanel(panelLegalDocumentDetails));
    layoutNormalLegal.setMargin(true);
    panelNormalDocumentDetails.setWidth("100%");
    panelLegalDocumentDetails.setWidth("100%");

    // for adjoin properties
    panelAdjoinProperties.addComponent(btnAddAdjoinProperty);
    panelAdjoinProperties.setComponentAlignment(btnAddAdjoinProperty, Alignment.BOTTOM_RIGHT);
    panelAdjoinProperties.addComponent(new ComponentIteratorAdjoinProperty(null, true, true, true));

    // for dimensions
    panelDimension.addComponent(btnAddDimension);
    panelDimension.setComponentAlignment(btnAddDimension, Alignment.BOTTOM_RIGHT);
    panelDimension.addComponent(new ComponentIterDimensionofPlot(null, true, true, true));

    //for description of the property
    layoutDescProperty.setMargin(true);
    layoutDescProperty1.setSpacing(true);
    layoutDescProperty1.setColumns(4);
    layoutDescProperty.addComponent(btnDynamicDescProp);
    layoutDescProperty.setComponentAlignment(btnDynamicDescProp, Alignment.TOP_RIGHT);
    layoutDescProperty1.addComponent(tfSiteNumber);
    layoutDescProperty1.addComponent(tfSFNumber);
    layoutDescProperty1.addComponent(tfNewSFNumber);
    layoutDescProperty1.addComponent(tfVillage);
    layoutDescProperty1.addComponent(tfTaluk);
    layoutDescProperty1.addComponent(tfDistCorpPanc);
    layoutDescProperty1.addComponent(tfLocationSketch);
    layoutDescProperty1.addComponent(tfProTaxReceipt);
    layoutDescProperty1.addComponent(tfElecServiceConnNo);
    layoutDescProperty1.addComponent(tfElecConnecName);
    layoutDescProperty1.addComponent(slHighMiddPoor);
    layoutDescProperty1.addComponent(slUrbanSemiRural);
    layoutDescProperty1.addComponent(slResiIndustCommer);
    layoutDescProperty1.addComponent(slProOccupiedBy);
    layoutDescProperty1.addComponent(tfMonthlyRent);
    layoutDescProperty1.addComponent(tfCoverUnderStatCentral);
    layoutDescProperty1.addComponent(tfAnyConversionLand);
    layoutDescProperty1.addComponent(tfExtentSite);
    layoutDescProperty1.addComponent(tfYearAcquistion);
    layoutDescProperty1.addComponent(tfPurchaseValue);
    layoutDescProperty1.addComponent(tfPropLandmark);
    layoutDescProperty1.addComponent(tfPostalAddress);
    layoutDescProperty1.addComponent(tfDynamicDescProp1);
    layoutDescProperty1.addComponent(tfDynamicDescProp2);
    layoutDescProperty.addComponent(layoutDescProperty1);
    tfDynamicDescProp1.setVisible(false);
    tfDynamicDescProp2.setVisible(false);
    //for charcteristiccs of the site
    layoutCharcterSite1.setSpacing(true);
    layoutCharcterSite1.setColumns(4);
    layoutCharcterSite.setMargin(true);
    layoutCharcterSite.addComponent(btnDynamicCharacter);
    layoutCharcterSite.setComponentAlignment(btnDynamicCharacter, Alignment.TOP_RIGHT);
    layoutCharcterSite1.addComponent(slLocalClass);
    layoutCharcterSite1.addComponent(slSurroundDevelop);
    layoutCharcterSite1.addComponent(tfFlood);
    layoutCharcterSite1.addComponent(slFeasibility);
    layoutCharcterSite1.addComponent(slLandLevel);
    layoutCharcterSite1.addComponent(slLandShape);
    layoutCharcterSite1.addComponent(slTypeUse);
    layoutCharcterSite1.addComponent(tfUsageRestriction);
    layoutCharcterSite1.addComponent(slIsPlot);
    layoutCharcterSite1.addComponent(tfApprveNo);
    layoutCharcterSite1.addComponent(tfNoReason);
    layoutCharcterSite1.addComponent(tfSubdivide);
    layoutCharcterSite1.addComponent(slDrawApproval);
    layoutCharcterSite1.addComponent(slCornerInter);
    layoutCharcterSite1.addComponent(slRoadFacility);
    layoutCharcterSite1.addComponent(slTypeRoad);
    layoutCharcterSite1.addComponent(slRoadWidth);
    layoutCharcterSite1.addComponent(slLandLock);
    layoutCharcterSite1.addComponent(slWaterPotential);
    layoutCharcterSite1.addComponent(slUnderSewerage);
    layoutCharcterSite1.addComponent(slPowerSupply);
    layoutCharcterSite1.addComponent(tfAdvantageSite);
    layoutCharcterSite1.addComponent(tfDisadvantageSite);
    layoutCharcterSite1.addComponent(tfGeneralRemarks);
    layoutCharcterSite1.addComponent(tfDynamicCharacter1);
    layoutCharcterSite1.addComponent(tfDynamicCharacter2);
    layoutCharcterSite.addComponent(layoutCharcterSite1);
    tfDynamicCharacter1.setVisible(false);
    tfDynamicCharacter2.setVisible(false);

    // valuation of land
    layoutValuationLand.setSpacing(true);
    layoutValuationLand1.setSpacing(true);
    layoutValuationLand1.setColumns(4);
    layoutValuationLand1.addComponent(tfAreaofLand);
    layoutValuationLand1.addComponent(tfNorthandSouth);
    layoutValuationLand1.addComponent(tfMarketRate);
    layoutValuationLand1.addComponent(tfGuiderate);
    layoutValuationLand1.addComponent(tfAdopetdMarketRate);
    layoutValuationLand1.addComponent(tfFairMarketRate);
    layoutValuationLand1.addComponent(tfDynamicValuation1);
    layoutValuationLand1.addComponent(tfDynamicValuation2);
    tfDynamicValuation1.setVisible(false);
    tfDynamicValuation2.setVisible(false);
    tfAdopetdMarketRate.setRequired(true);
    layoutValuationLand.addComponent(btnDynamicValuation);
    layoutValuationLand.setComponentAlignment(btnDynamicValuation, Alignment.TOP_RIGHT);
    layoutValuationLand.addComponent(layoutValuationLand1);
    layoutValuationLand.setMargin(true);
    tfFairMarketRate.setValue("0.00");
    tfFairMarketRate.setImmediate(true);
    tfFairMarketRate.addBlurListener(new BlurListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void blur(BlurEvent event) {
            try {
                String numberOnly = tfFairMarketRate.getValue().replaceAll("[^0-9]", "");
                BigDecimal fairmarket = new BigDecimal(numberOnly);

                BigDecimal realizable = (fairmarket.multiply(new BigDecimal(95))).divide(new BigDecimal(100));
                realizable = realizable.subtract(realizable.remainder(new BigDecimal(1000)));
                tfRealziableRate.setValue(realizable.toString());

                BigDecimal distress = (fairmarket.multiply(new BigDecimal(85))).divide(new BigDecimal(100));
                distress = distress.subtract(distress.remainder(new BigDecimal(1000)));
                tfDistressRate.setValue(distress.toString());

            } catch (Exception e) {
            }
        }
    });
    //tfEvaluationNumber.addValidator(new IntegerValidator("Enter numbers only"));
    //tfEvaluationNumber.addBlurListener(new SaarcValidate(tfEvaluationNumber));
    tfEvaluationNumber.setImmediate(true);

    tfEvaluationNumber.addBlurListener(new BlurListener() {

        private static final long serialVersionUID = 1L;

        public void blur(BlurEvent event) {
            // TODO Auto-generated method stub
            if (!tfEvaluationNumber.isReadOnly()) {
                tfEvaluationNumber.setComponentError(null);
                try {
                    tfEvaluationNumber.setComponentError(null);
                    String evalno = tfEvaluationNumber.getValue().toString();
                    count = beanEvaluation.getEvalNoCount(evalno);

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

                        if (count == 0) {

                            tfEvaluationNumber.setComponentError(null);

                        } else {

                            tfEvaluationNumber
                                    .setComponentError(new UserError("Evaluation number is already Exist"));

                        }
                    }
                } catch (Exception e) {

                }
            }

        }
    });
    //property value
    layoutPropertyValue.setSpacing(true);
    layoutPropertyValue.setMargin(true);
    layoutPropertyValue1.setColumns(4);
    layoutPropertyValue1.setSpacing(true);
    layoutPropertyValue1.addComponent(tfRealziableRate);
    layoutPropertyValue1.addComponent(tfDistressRate);
    layoutPropertyValue1.addComponent(tfGuidelineRate);
    layoutPropertyValue.addComponent(layoutPropertyValue1);

    //for Estimate Construction
    layoutEstimateConstruction.setSpacing(true);
    layoutEstimateConstruction.setMargin(true);
    layoutEstimateConstruction.addComponent(btnDynamicEstimate);
    layoutEstimateConstruction.setComponentAlignment(btnDynamicEstimate, Alignment.TOP_RIGHT);
    layoutEstimateConstruction1.setSpacing(true);
    layoutEstimateConstruction1.addComponent(tfEstimateGiven);
    layoutEstimateConstruction1.addComponent(tfAppReason);
    layoutEstimateConstruction1.addComponent(tfSalient);
    layoutEstimateConstruction1.addComponent(tfBreakup);
    layoutEstimateConstruction1.addComponent(tfDynamicEstimateConst1);
    layoutEstimateConstruction1.addComponent(tfDynamicEstimateConst2);
    layoutEstimateConstruction.addComponent(layoutEstimateConstruction1);
    tfDynamicEstimateConst1.setVisible(false);
    tfDynamicEstimateConst2.setVisible(false);
    // for details of plan approval
    layoutPlanApproval1.setColumns(2);
    FormLayout lay1 = new FormLayout();
    FormLayout lay2 = new FormLayout();
    lay1.addComponent(tfLandandBuilding);
    lay1.addComponent(tfBuilding);
    lay1.addComponent(tfPlanApprovedBy);
    lay1.addComponent(dfLicenseFrom);
    lay1.addComponent(slIsLicenceForced);
    lay1.addComponent(tfDynamicPlanApproval2);

    lay2.addComponent(tfQuality);
    lay2.addComponent(slAllApprovalRecved);
    lay2.addComponent(slConstAsperAppPlan);
    lay2.addComponent(tfReason);
    lay2.addComponent(tfDynamicPlanApproval1);
    tfDynamicPlanApproval1.setVisible(false);
    tfDynamicPlanApproval2.setVisible(false);
    lay1.setSpacing(true);
    lay2.setSpacing(true);
    layoutPlanApproval1.addComponent(lay1);
    layoutPlanApproval1.addComponent(lay2);
    layoutPlanApproval1.setSpacing(true);
    layoutPlanApproval1.setMargin(true);
    layoutPlanApproval.addComponent(btnDynamicPlanApproval);
    layoutPlanApproval.setComponentAlignment(btnDynamicPlanApproval, Alignment.TOP_RIGHT);
    layoutPlanApproval.addComponent(layoutPlanApproval1);

    // for Build Specification
    panelBuildSpecfication.addComponent(btnAddBuildSpec);
    panelBuildSpecfication.setComponentAlignment(btnAddBuildSpec, Alignment.BOTTOM_RIGHT);
    panelBuildSpecfication.addComponent(new ComponentIterBuildingSpecfication(null, true, true, true));
    panelBuildSpecfication.setWidth("100%");
    // for plinth area
    layoutPlintharea.addComponent(btnAddPlinth);
    layoutPlintharea.setComponentAlignment(btnAddPlinth, Alignment.BOTTOM_RIGHT);
    layoutPlintharea.setMargin(true);
    layoutPlintharea.addComponent(new ComponentIterPlinthArea("Ground Floor", "", ""));
    layoutPlintharea.addComponent(new ComponentIterPlinthArea("Portico and Stair", "", ""));

    // for applicant estimate
    layoutApplicantEstimate.setSpacing(true);
    layoutApplicantEstimate1.setSpacing(true);
    layoutApplicantEstimate1.setColumns(2);
    layoutApplicantEstimate2.setSpacing(true);
    layoutApplicantEstimate2.setColumns(2);
    layoutApplicantEstimate3.setSpacing(true);
    layoutApplicantEstimate3.setColumns(2);
    layoutApplicantEstimate4.setSpacing(true);
    layoutApplicantEstimate4.setColumns(2);
    layoutApplicantEstimate1.addComponent(lblAppEstimate);
    layoutApplicantEstimate1.addComponent(tfAppEstimate);
    layoutApplicantEstimate1.addComponent(lblDtlsAppEstimate);
    layoutApplicantEstimate1.addComponent(tfDtlsAppEstimate);
    layoutApplicantEstimate1.addComponent(tfDetails1);
    layoutApplicantEstimate1.addComponent(tfDetailVal1);
    layoutApplicantEstimate1.addComponent(tfDetails2);
    layoutApplicantEstimate1.addComponent(tfDetailVal2);
    layoutApplicantEstimate1.addComponent(tfDetails3);
    layoutApplicantEstimate1.addComponent(tfDetailVal3);
    layoutApplicantEstimate2.addComponent(tfDynamicAppEstimate1);
    layoutApplicantEstimate2.addComponent(tfDynamicAppEstimate2);
    layoutApplicantEstimate2.addComponent(tfDynamicAppEstimate3);
    layoutApplicantEstimate2.addComponent(tfDynamicAppEstimate4);
    layoutApplicantEstimate3.addComponent(tfDynamicAppEstimate5);
    layoutApplicantEstimate3.addComponent(tfDynamicAppEstimate6);
    layoutApplicantEstimate3.addComponent(tfDynamicAppEstimate7);
    layoutApplicantEstimate3.addComponent(tfDynamicAppEstimate8);
    layoutApplicantEstimate4.addComponent(lblTotal);
    layoutApplicantEstimate4.addComponent(tfTotalval);

    layoutApplicantEstimate.addComponent(btnDynamicAppEstimate);
    layoutApplicantEstimate.setComponentAlignment(btnDynamicAppEstimate, Alignment.TOP_RIGHT);
    layoutApplicantEstimate.addComponent(layoutApplicantEstimate1);
    layoutApplicantEstimate.addComponent(layoutApplicantEstimate2);
    layoutApplicantEstimate.addComponent(layoutApplicantEstimate3);
    layoutApplicantEstimate.addComponent(layoutApplicantEstimate4);
    layoutApplicantEstimate2.setVisible(true);
    layoutApplicantEstimate3.setVisible(true);
    layoutApplicantEstimate.setMargin(true);
    tfDynamicAppEstimate2.setValue("0.00");
    tfDetailVal2.setValue("0.00");
    tfDetailVal1.setValue("0.00");
    tfDynamicAppEstimate4.setValue("0.00");
    tfDynamicAppEstimate6.setValue("0.00");
    tfDynamicAppEstimate8.setValue("0.00");
    tfDetailVal3.setValue("0.00");
    tfTotalval.setImmediate(true);
    tfTotalval.addBlurListener(new BlurListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void blur(BlurEvent event) {
            // TODO Auto-generated method stub
            BigDecimal appEstimate = 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");
            BigDecimal test6 = new BigDecimal("0.00");

            try {
                test = new BigDecimal(tfDetailVal1.getValue());

            } catch (Exception e) {
                test = new BigDecimal("0.00");
            }
            try {
                test1 = new BigDecimal(tfDetailVal2.getValue());
            } catch (Exception e) {
                test1 = new BigDecimal("0.00");
            }
            try {
                test2 = new BigDecimal(tfDetailVal3.getValue());
            } catch (Exception e) {
                test2 = new BigDecimal("0.00");
            }
            try {
                test3 = new BigDecimal(tfDynamicAppEstimate2.getValue());

            } catch (Exception e) {
                test3 = new BigDecimal("0.00");
            }
            try {
                test4 = new BigDecimal(tfDynamicAppEstimate4.getValue());
            } catch (Exception e) {
                test4 = new BigDecimal("0.00");
            }
            try {
                test5 = new BigDecimal(tfDynamicAppEstimate6.getValue());
            } catch (Exception e) {
                test4 = new BigDecimal("0.00");
            }
            try {
                test6 = new BigDecimal(tfDynamicAppEstimate8.getValue());
            } catch (Exception e) {
                test4 = new BigDecimal("0.00");
            }
            appEstimate = appEstimate.add(test).add(test1).add(test2).add(test3).add(test4).add(test5)
                    .add(test6);
            tfTotalval.setValue(appEstimate.toString());
            tfAppEstimate.setValue(appEstimate.toString());
        }
    });

    //for applicant reasonable
    layoutApplicantReasonable.setSpacing(true);
    layoutApplicantReasonable1.setSpacing(true);
    layoutApplicantReasonable2.setSpacing(true);
    layoutApplicantReasonable1.setColumns(2);
    layoutApplicantReasonable2.setColumns(2);
    layoutApplicantReasonable1.setVisible(false);
    layoutApplicantReasonable2.addComponent(lblAppReasonable);
    layoutApplicantReasonable2.addComponent(slAppReasonable);
    layoutApplicantReasonable1.addComponent(lblReasonEstimate);
    layoutApplicantReasonable1.addComponent(tfReasonEstimateVal);
    layoutApplicantReasonable1.addComponent(lblDtlsAppReasonable);
    layoutApplicantReasonable1.addComponent(tfDtlsAppReasonable);
    layoutApplicantReasonable1.addComponent(tfDetailsReason1);
    layoutApplicantReasonable1.addComponent(tfDetailReasonVal1);
    layoutApplicantReasonable1.addComponent(tfDetailsReason2);
    layoutApplicantReasonable1.addComponent(tfDetailReasonVal2);
    layoutApplicantReasonable1.addComponent(tfDetailsReason3);
    layoutApplicantReasonable1.addComponent(tfDetailReasonVal3);
    layoutApplicantReasonable1.addComponent(tfDynamicAppReason1);
    layoutApplicantReasonable1.addComponent(tfDynamicAppReason2);
    layoutApplicantReasonable1.addComponent(tfDynamicAppReason3);
    layoutApplicantReasonable1.addComponent(tfDynamicAppReason4);
    layoutApplicantReasonable1.addComponent(lblReasonTotal);
    layoutApplicantReasonable1.addComponent(tfReasonTotalval);
    tfDynamicAppReason1.setVisible(false);
    tfDynamicAppReason2.setVisible(false);
    tfDynamicAppReason3.setVisible(false);
    tfDynamicAppReason4.setVisible(false);

    layoutApplicantReasonable.addComponent(btnDynamicAppReason);
    layoutApplicantReasonable.setComponentAlignment(btnDynamicAppReason, Alignment.TOP_RIGHT);
    layoutApplicantReasonable.addComponent(layoutApplicantReasonable2);
    layoutApplicantReasonable.addComponent(layoutApplicantReasonable1);
    layoutApplicantReasonable.setMargin(true);
    tfDetailReasonVal1.setValue("0.00");
    tfDetailReasonVal2.setValue("0.00");
    tfDetailReasonVal3.setValue("0.00");
    tfReasonTotalval.setImmediate(true);
    tfReasonTotalval.addBlurListener(new BlurListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void blur(BlurEvent event) {
            // TODO Auto-generated method stubBigDecimal appEstimate =new BigDecimal(0.00);
            BigDecimal appReason = 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(tfDetailReasonVal1.getValue());

            } catch (Exception e) {
                test = new BigDecimal("0.00");
            }
            try {
                test1 = new BigDecimal(tfDetailReasonVal2.getValue());
            } catch (Exception e) {
                test1 = new BigDecimal("0.00");
            }
            try {
                test2 = new BigDecimal(tfDetailReasonVal3.getValue());
            } catch (Exception e) {
                test2 = new BigDecimal("0.00");
            }
            try {
                test3 = new BigDecimal(tfDynamicAppReason2.getValue());

            } catch (Exception e) {
                test3 = new BigDecimal("0.00");
            }
            try {
                test4 = new BigDecimal(tfDynamicAppReason2.getValue());
            } catch (Exception e) {
                test4 = new BigDecimal("0.00");
            }
            appReason = appReason.add(test).add(test1).add(test2).add(test3).add(test4);
            tfReasonTotalval.setValue(appReason.toString());
            tfReasonEstimateVal.setValue(appReason.toString());
        }
    });

    slAppReasonable.setImmediate(true);
    slAppReasonable.setNullSelectionAllowed(false);
    slAppReasonable.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {
            if (slAppReasonable.getValue() != null) {
                if (slAppReasonable.getValue().equals(Common.NO_DESC)) {
                    layoutApplicantReasonable1.setVisible(true);
                    btnDynamicAppReason.setVisible(true);
                } else {
                    layoutApplicantReasonable1.setVisible(false);
                    btnDynamicAppReason.setVisible(false);
                }
            }
        }
    });

    //Earth quake

    layoutEarthquake1.setSpacing(true);
    layoutEarthquake1.setColumns(4);
    layoutEarthquake1.addComponent(slEarthQuake);
    layoutEarthquake1.addComponent(tfDynamicEarthquake1);
    layoutEarthquake1.addComponent(tfDynamicEarthquake2);
    tfDynamicEarthquake1.setVisible(false);
    tfDynamicEarthquake2.setVisible(false);

    layoutEarthquake.addComponent(btnDynamicEarthQuake);
    layoutEarthquake.setComponentAlignment(btnDynamicEarthQuake, Alignment.TOP_RIGHT);
    layoutEarthquake.addComponent(layoutEarthquake1);
    layoutEarthquake.setMargin(true);
    // construction
    //layoutConstruction.setCaption("Construction");
    layoutConstruction1.setSpacing(true);
    layoutConstruction1.setColumns(4);
    layoutConstruction1.addComponent(tfStageofConst);
    layoutConstruction1.addComponent(tfSalablity);
    layoutConstruction1.addComponent(tfRentalValues);
    layoutConstruction1.addComponent(tfIncome);
    layoutConstruction1.addComponent(tfDynamicConstruction1);
    layoutConstruction1.addComponent(tfDynamicConstruction2);
    tfDynamicConstruction1.setVisible(false);
    tfDynamicConstruction2.setVisible(false);

    layoutConstruction.addComponent(btnDynamicConstruction);
    layoutConstruction.setComponentAlignment(btnDynamicConstruction, Alignment.TOP_RIGHT);
    layoutConstruction.addComponent(layoutConstruction1);
    layoutConstruction.setMargin(true);

    // cost of construction
    layoutCost.setColumns(2);
    layoutCostConstruction1.setColumns(2);
    layoutCostConstruction2.setColumns(2);
    layoutCostConstruction.setSpacing(true);
    layoutCost.setSpacing(true);
    layoutCostConstruction2.setSpacing(true);
    layoutCostConstruction1.setSpacing(true);
    layoutCostConstruction1.setSpacing(true);
    layoutCost.addComponent(lblCostConst);
    layoutCost.addComponent(tfCostConstruction);

    layoutCostConstruction1.addComponent(tfDynamicCostConst1);
    layoutCostConstruction1.addComponent(tfDynamicCostConst2);
    layoutCostConstruction1.addComponent(tfDynamicCostConst3);
    layoutCostConstruction1.addComponent(tfDynamicCostConst4);
    layoutCostConstruction1.addComponent(tfDynamicCostConst5);
    layoutCostConstruction1.addComponent(tfDynamicCostConst6);

    layoutCostConstruction2.addComponent(tfDynamicCostConst7);
    layoutCostConstruction2.addComponent(tfDynamicCostConst8);
    layoutCostConstruction2.addComponent(tfDynamicCostConst9);
    layoutCostConstruction2.addComponent(tfDynamicCostConst10);
    layoutCostConstruction1.setVisible(false);
    layoutCostConstruction2.setVisible(false);

    layoutCostConstruction.addComponent(btnDynamicCostConst);
    layoutCostConstruction.setComponentAlignment(btnDynamicCostConst, Alignment.TOP_RIGHT);
    layoutCostConstruction.addComponent(layoutCost);
    layoutCostConstruction.addComponent(layoutCostConstruction1);
    layoutCostConstruction.addComponent(layoutCostConstruction2);
    layoutCostConstruction.setMargin(true);

    // for Guideline area
    layoutGuideline.addComponent(btnAddGuideline);
    layoutGuideline.setComponentAlignment(btnAddGuideline, Alignment.TOP_RIGHT);
    layoutGuideline.setMargin(true);
    layoutGuideline.addComponent(new ComponentIterGuideline("Land", "", "", ""));
    layoutGuideline.addComponent(new ComponentIterGuideline("Construction", "", "", ""));

    // for guide line reference
    streetLayout.addComponent(slStreetSerNo);
    streetLayout.addComponent(tfStreetName);

    layoutGuidelineReference1.setColumns(4);
    layoutGuidelineReference1.setSpacing(true);
    layoutGuidelineReference1.addComponent(tfZone);
    layoutGuidelineReference1.addComponent(tfSRO);
    layoutGuidelineReference1.addComponent(tfVillage1);
    layoutGuidelineReference1.addComponent(tfRevnueDist);
    layoutGuidelineReference1.addComponent(tfTalukName);
    layoutGuidelineReference1.addComponent(streetLayout);
    layoutGuidelineReference1.addComponent(tfGuidelineValue);
    layoutGuidelineReference1.addComponent(tfGuidelineValueMatric);
    layoutGuidelineReference1.addComponent(slClassification);
    layoutGuidelineReference1.setMargin(true);

    layoutGuidelineReference.setSpacing(true);
    layoutGuidelineReference.addComponent(layoutGuidelineReference1);
    // add components in main panel
    accordion.setWidth("100%");
    layoutEvaluationDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutEvaluationDetails), "Evaluation Details");

    layoutOwnerDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutAssetOwner), "Owner Details/Asset Details");
    layoutAssetDetails.setStyleName("bluebar");

    layoutNormalLegal.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutNormalLegal), "Document Details");

    panelAdjoinProperties.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(panelAdjoinProperties), "Adjoining Properties");
    panelDimension.setStyleName("bluebar");
    accordion.addTab(panelDimension, "Dimension");

    layoutDescProperty.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutDescProperty), "Description of the property");
    layoutCharcterSite.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutCharcterSite), "Characteristics of the site");
    layoutValuationLand.setStyleName("bluebar");
    accordion.addTab(layoutValuationLand, "Valuation of Land");
    layoutPlanApproval.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutEstimateConstruction), "Estimate for Construction");
    layoutEstimateConstruction.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPlanApproval), "Details of Plan Approval");
    panelBuildSpecfication.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(panelBuildSpecfication), "Specification");
    layoutPlintharea.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPlintharea), "Plinth Area Details");
    layoutApplicantEstimate.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutApplicantEstimate), "Applicant Estimate");

    layoutApplicantReasonable.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutApplicantReasonable), "Applicant Reasonable");

    layoutGuideline.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutGuideline), "Guideline Details");

    layoutGuidelineReference.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutGuidelineReference), "Guideline Reference Details");
    layoutPropertyValue.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPropertyValue), "Property Value Details");
    layoutEarthquake.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutEarthquake), "Earth Quake Details");

    layoutCostConstruction.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutCostConstruction), "Cost of Construction");
    layoutConstruction.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutConstruction), "Stage of Construction");
    this.accordion.addListener(new SelectedTabChangeListener() {
        public void selectedTabChange(SelectedTabChangeEvent event) {
            if (event.getTabSheet().getSelectedTab().equals(panelDimension)) {
                Iterator<Component> myComps = panelDimension.getComponentIterator();
                BigDecimal siteArea = new BigDecimal(0.00);
                while (myComps.hasNext()) {
                    final Component component = myComps.next();
                    int i = 1;

                    if (component instanceof ComponentIterDimensionofPlot) {

                        ComponentIterDimensionofPlot mycomponent = (ComponentIterDimensionofPlot) component;
                        List<TPemCmPropDimension> getList = mycomponent.getDimensionPropertyList();

                        try {
                            List<String> mylist = mycomponent.getLeastValaue();
                            siteArea = siteArea.add(new BigDecimal(mylist.get(0).replaceAll("[^\\d.]", "")));
                            tfNorthandSouth.setValue(mylist.get(1));
                            tfAreaofLand.setValue(siteArea.toString());
                        } catch (Exception e) {

                            logger.info("Error-->" + e);
                        }
                    }
                }
                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) {

                }
            }

        }
    });
    layoutMainForm.addComponent(PanelGenerator.createPanel(accordion));

    mainPanel.addComponent(layoutMainForm);
    mainPanel.addComponent(layoutButton2);
    mainPanel.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);
    mainPanel.setVisible(false);

    layoutMainForm.setMargin(true);
    layoutMainForm.setSpacing(true);
    // for main panel
    layoutButton2.setSpacing(true);
    btnSave.setStyleName("savebt");
    btnCancel.setStyleName("cancelbt");
    //      saveExcel.addStyleName("downloadbt");
    btnSubmit.setStyleName("submitbt");
    btnSave.setVisible(false);
    btnSubmit.setVisible(false);
    btnCancel.setVisible(false);

    layoutButton2.addComponent(btnSave);
    layoutButton2.addComponent(btnSubmit);
    //      layoutButton2.addComponent(saveExcel);
    layoutButton2.addComponent(btnCancel);
    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);

    // Initaited the Label Function here by Hohul
    lblTableTitle = new Label();
    lblSaveNotification = new Label();
    lblSaveNotification.setContentMode(ContentMode.HTML);
    lblNotificationIcon = new Label();
    lblTableTitle.setValue("<B>&nbsp;&nbsp;Action:</B>");
    lblTableTitle.setContentMode(ContentMode.HTML);
    lblFormTittle = new Label();
    lblFormTittle.setContentMode(ContentMode.HTML);
    lblFormTittle.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;Home");
    lblFormTitle1 = new Label();
    lblFormTitle1.setContentMode(ContentMode.HTML);
    lblFormTitle1.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;");
    lblAddEdit = new Label();
    lblAddEdit.setContentMode(ContentMode.HTML);

    // Button Back declaration by Hohul
    btnBack = new Button("Home", this);
    btnBack.setStyleName("link");

    // Bread Scrumbs initiated here by Hohul

    hlBreadCrumbs = new HorizontalLayout();
    hlBreadCrumbs.addComponent(lblFormTitle1);
    hlBreadCrumbs.addComponent(btnBack);
    hlBreadCrumbs.setComponentAlignment(btnBack, Alignment.TOP_CENTER);
    hlBreadCrumbs.addComponent(lblAddEdit);
    hlBreadCrumbs.setComponentAlignment(lblAddEdit, Alignment.MIDDLE_CENTER);
    hlBreadCrumbs.setVisible(false);

    // for search panel
    // for search panel
    // Added by Hohul ----->  For Search Panel Layouts
    FormLayout flSearchEvalNumber = new FormLayout();
    flSearchEvalNumber.addComponent(tfSearchEvalNumber);

    FormLayout flSearchBankbranch = new FormLayout();
    flSearchBankbranch.addComponent(slSearchBankbranch);

    FormLayout flSearchCustomer = new FormLayout();
    flSearchCustomer.addComponent(tfSearchCustomer);

    HorizontalLayout hlSearchComponentLayout = new HorizontalLayout();
    hlSearchComponentLayout.addComponent(flSearchEvalNumber);
    hlSearchComponentLayout.addComponent(flSearchBankbranch);
    hlSearchComponentLayout.addComponent(flSearchCustomer);
    hlSearchComponentLayout.setSpacing(true);
    hlSearchComponentLayout.setMargin(true);

    //Initialization and properties for btnDownload      
    btnDownload = new Button("Download");
    //btnDownload.setDescription("Download");
    btnDownload.addStyleName("downloadbt");
    btnDownload.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            //  UI.getCurrent()..clearDashboardButtonBadge();
            event.getButton().removeStyleName("unread");
            if (notifications != null && notifications.getUI() != null)
                notifications.close();
            else {
                buildNotifications(event);
                UI.getCurrent().addWindow(notifications);
                notifications.focus();
                ((VerticalLayout) UI.getCurrent().getContent())
                        .addLayoutClickListener(new LayoutClickListener() {
                            @Override
                            public void layoutClick(LayoutClickEvent event) {
                                notifications.close();
                                ((VerticalLayout) UI.getCurrent().getContent()).removeLayoutClickListener(this);
                            }
                        });
            }

        }
    });

    hlFileDownloadLayout = new HorizontalLayout();
    hlFileDownloadLayout.setSpacing(true);
    hlFileDownloadLayout.addComponent(btnDownload);
    hlFileDownloadLayout.setComponentAlignment(btnDownload, Alignment.MIDDLE_CENTER);

    VerticalLayout vlSearchandResetButtonLAyout = new VerticalLayout();
    vlSearchandResetButtonLAyout.setSpacing(true);
    vlSearchandResetButtonLAyout.addComponent(btnReset);
    vlSearchandResetButtonLAyout.setWidth("100");
    vlSearchandResetButtonLAyout.addStyleName("topbarthree");
    vlSearchandResetButtonLAyout.setMargin(true);

    HorizontalLayout hlSearchComponentandButtonLayout = new HorizontalLayout();
    hlSearchComponentandButtonLayout.setSizeFull();
    hlSearchComponentandButtonLayout.setSpacing(true);
    hlSearchComponentandButtonLayout.addComponent(hlSearchComponentLayout);
    hlSearchComponentandButtonLayout.setComponentAlignment(hlSearchComponentLayout, Alignment.MIDDLE_LEFT);
    hlSearchComponentandButtonLayout.addComponent(vlSearchandResetButtonLAyout);
    hlSearchComponentandButtonLayout.setComponentAlignment(vlSearchandResetButtonLAyout,
            Alignment.MIDDLE_RIGHT);
    hlSearchComponentandButtonLayout.setExpandRatio(vlSearchandResetButtonLAyout, 1);
    final VerticalLayout vlSearchComponentandButtonLayout = new VerticalLayout();
    vlSearchComponentandButtonLayout.setSpacing(true);
    vlSearchComponentandButtonLayout.setSizeFull();
    vlSearchComponentandButtonLayout.addComponent(hlSearchComponentandButtonLayout);

    /*layoutSearch.addComponent(tfSearchEvalNumber);
    layoutSearch.addComponent(slSearchBankbranch);
    layoutSearch.addComponent(tfSearchCustomer);
    layoutSearch.addComponent(btnReset);
    layoutSearch.setComponentAlignment(btnReset, Alignment.BOTTOM_LEFT);
    btnSearch.addStyleName("default");*/
    btnReset.addStyleName("resetbt");
    tfSearchCustomer.setImmediate(true);
    tfSearchCustomer.addListener(new TextChangeListener() {
        private static final long serialVersionUID = 1L;
        SimpleStringFilter filter = null;

        public void textChange(TextChangeEvent event) {
            Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
            if (filter != null)
                f.removeContainerFilter(filter);

            filter = new SimpleStringFilter("custName", event.getText(), true, false);

            f.addContainerFilter(filter);
            total = f.size();
            tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
        }
    });
    tfSearchEvalNumber.setImmediate(true);
    tfSearchEvalNumber.addListener(new TextChangeListener() {
        private static final long serialVersionUID = 1L;
        SimpleStringFilter filter = null;

        public void textChange(TextChangeEvent event) {
            Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
            if (filter != null)
                f.removeContainerFilter(filter);

            filter = new SimpleStringFilter("evalNo", event.getText(), true, false);

            f.addContainerFilter(filter);
            total = f.size();
            tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
        }
    });
    slSearchBankbranch.setImmediate(true);
    slSearchBankbranch.addValueChangeListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;
        Filter filter = null;

        @Override
        public void valueChange(ValueChangeEvent event) {
            // TODO Auto-generated method stub

            try {
                String strBankBranch = slSearchBankbranch.getValue().toString();
                Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
                if (filter != null)
                    f.removeContainerFilter(filter);

                filter = new Compare.Equal("bankBranch", strBankBranch);
                f.addContainerFilter(filter);
                f.addContainerFilter(filter);
                total = f.size();
                tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
            } catch (Exception e) {
            }
        }

    });

    searchPanel.addComponent(PanelGenerator.createPanel(vlSearchComponentandButtonLayout));
    searchPanel.setMargin(true);

    // Add Layout table panel by Hohul

    HorizontalLayout flTableCaption = new HorizontalLayout();
    flTableCaption.addComponent(lblTableTitle);
    flTableCaption.setComponentAlignment(lblTableTitle, Alignment.MIDDLE_CENTER);
    flTableCaption.addStyleName("lightgray");
    flTableCaption.setHeight("25px");
    flTableCaption.setWidth("60px");
    lblNoofRecords = new Label(" ", ContentMode.HTML);
    lblNoofRecords.addStyleName("lblfooter");
    HorizontalLayout hlTableTittleLayout = new HorizontalLayout();
    hlTableTittleLayout.addComponent(flTableCaption);
    hlTableTittleLayout.addComponent(btnAdd);
    hlTableTittleLayout.addComponent(btnEdit);
    hlTableTittleLayout.addComponent(btnView);
    hlTableTittleLayout.setHeight("25px");
    hlTableTittleLayout.setSpacing(true);

    HorizontalLayout hlTableTitleandCaptionLayout = new HorizontalLayout();
    hlTableTitleandCaptionLayout.addStyleName("topbarthree");
    hlTableTitleandCaptionLayout.setWidth("100%");
    hlTableTitleandCaptionLayout.addComponent(hlTableTittleLayout);
    hlTableTitleandCaptionLayout.addComponent(hlFileDownloadLayout);
    hlTableTitleandCaptionLayout.setComponentAlignment(hlFileDownloadLayout, Alignment.MIDDLE_RIGHT);
    hlTableTitleandCaptionLayout.setHeight("28px");

    // for table panel
    btnAdd.addStyleName("add");
    btnEdit.addStyleName("editbt");
    btnView.addStyleName("view");
    btnView.setEnabled(false);

    hlAddEditLayout.addStyleName("topbarthree");
    hlAddEditLayout.setWidth("100%");
    hlAddEditLayout.addComponent(hlTableTitleandCaptionLayout);
    hlAddEditLayout.setHeight("28px");
    // Added Action Label to Table

    layoutTable.addComponent(hlAddEditLayout);
    layoutTable.setComponentAlignment(hlAddEditLayout, Alignment.TOP_LEFT);
    layoutTable.addComponent(tblEvalDetails);

    tablePanel.addComponent(layoutTable);
    tablePanel.setWidth("100%");
    tablePanel.setMargin(true);

    layoutPage.addComponent(mainPanel);
    layoutPage.addComponent(searchPanel);
    layoutPage.addComponent(tablePanel);

    // Added labels and titles to respective Location by Hohul

    HorizontalLayout hlNotificationLayout = new HorizontalLayout();
    hlNotificationLayout.addComponent(lblNotificationIcon);
    hlNotificationLayout.setComponentAlignment(lblNotificationIcon, Alignment.MIDDLE_LEFT);
    hlNotificationLayout.addComponent(lblSaveNotification);
    hlNotificationLayout.setComponentAlignment(lblSaveNotification, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(lblFormTittle);
    hlHeaderLayout.setComponentAlignment(lblFormTittle, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(hlBreadCrumbs);
    hlHeaderLayout.setComponentAlignment(hlBreadCrumbs, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(hlNotificationLayout);
    hlHeaderLayout.setComponentAlignment(hlNotificationLayout, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.MIDDLE_RIGHT);

    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);

    // load Component list values
    loadComponentListValues();

    //   setTableProperties();
    populateAndConfig(false);

}

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

@SuppressWarnings("deprecation")
void buildView(VerticalLayout layoutPage, HorizontalLayout hlHeaderLayout) {
    // for component width
    hlHeaderLayout.removeAllComponents();
    setComponentStyle();//from w  w  w .j  av a 2 s.co m

    tblEvalDetails = new Table();
    tblEvalDetails.setStyleName(Runo.TABLE_SMALL);
    tblEvalDetails.setPageLength(14);
    tblEvalDetails.setSizeFull();
    tblEvalDetails.setFooterVisible(true);
    tblEvalDetails.setSelectable(true);
    tblEvalDetails.setImmediate(true);
    tblEvalDetails.setColumnCollapsingAllowed(true);

    // for evaluation details
    tfEvaluationPurpose.setValue("Collateral Security to the Bank");
    slStreetSerNo.addItem("STREET NAME");
    slStreetSerNo.addItem("SURVEY NO");
    slStreetSerNo.setNullSelectionAllowed(false);

    tfEvaluationNumber.setRequired(true);
    tfBankBranch.setRequired(true);
    dfDateofValuation.setRequired(true);
    tfEvaluationPurpose.setRequired(true);
    layoutEvaluationDetails1.setColumns(4);

    layoutEvaluationDetails1.addComponent(tfEvaluationNumber);
    layoutEvaluationDetails1.addComponent(tfBankBranch);
    layoutEvaluationDetails1.addComponent(tfEvaluationPurpose);
    layoutEvaluationDetails1.addComponent(tfValuatedBy);
    layoutEvaluationDetails1.addComponent(dfDateofValuation);
    layoutEvaluationDetails1.addComponent(dfVerifiedDate);
    layoutEvaluationDetails1.addComponent(tfVerifiedBy);
    layoutEvaluationDetails1.addComponent(tfDynamicEvaluation1);
    layoutEvaluationDetails1.addComponent(tfDynamicEvaluation2);
    tfDynamicEvaluation1.setVisible(false);
    tfDynamicEvaluation2.setVisible(false);
    layoutEvaluationDetails1.setSpacing(true);
    layoutEvaluationDetails1.setMargin(true);

    layoutEvaluationDetails.addComponent(btnDynamicEvaluation1);
    layoutEvaluationDetails.setComponentAlignment(btnDynamicEvaluation1, Alignment.TOP_RIGHT);
    layoutEvaluationDetails.addComponent(layoutEvaluationDetails1);
    // for customer details
    tfDynamicCustomer1.setVisible(false);
    tfDynamicCustomer2.setVisible(false);
    layoutCustomerDetail1.setColumns(4);
    //layoutCustomerDetail.setCaption("Customer Details");
    layoutCustomerDetail1.addComponent(tfCustomerName);
    layoutCustomerDetail1.addComponent(slPropertyDesc);
    layoutCustomerDetail1.addComponent(tfDynamicCustomer1);
    layoutCustomerDetail1.addComponent(tfDynamicCustomer2);
    layoutCustomerDetail1.setSpacing(true);
    layoutCustomerDetail1.setMargin(true);

    layoutCustomerDetail.addComponent(btnDynamicCustomer);
    layoutCustomerDetail.setComponentAlignment(btnDynamicCustomer, Alignment.TOP_RIGHT);
    layoutCustomerDetail.addComponent(layoutCustomerDetail1);

    // for asset details
    VerticalLayout formAsset1 = new VerticalLayout();
    VerticalLayout formAsset2 = new VerticalLayout();
    VerticalLayout formAsset3 = new VerticalLayout();
    VerticalLayout formAsset4 = new VerticalLayout();
    formAsset1.setSpacing(true);
    formAsset2.setSpacing(true);
    formAsset4.setSpacing(true);

    formAsset1.addComponent(tfCustomerName);
    formAsset1.addComponent(tfLandMark);
    formAsset1.addComponent(slPropertyDesc);
    formAsset2.addComponent(tfCustomerAddr);
    formAsset3.addComponent(tfPropertyAddress);
    formAsset3.addComponent(chkSameAddress);
    formAsset4.addComponent(tfDynamicAsset1);
    formAsset4.addComponent(tfDynamicAsset2);
    tfDynamicAsset1.setVisible(false);
    tfDynamicAsset2.setVisible(false);

    chkSameAddress.setImmediate(true);
    chkSameAddress.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {

            if (chkSameAddress.getValue().equals(true)) {
                tfPropertyAddress.setValue(tfCustomerAddr.getValue());

            } else {
                tfPropertyAddress.setValue("");
            }
        }
    });

    layoutAssetDetails1.setSpacing(true);
    layoutAssetDetails1.setColumns(4);
    layoutAssetDetails1.addComponent(formAsset1);
    layoutAssetDetails1.addComponent(formAsset2);
    layoutAssetDetails1.addComponent(formAsset3);
    layoutAssetDetails1.addComponent(formAsset4);
    layoutAssetDetails1.setMargin(true);

    layoutAssetDetails.addComponent(btnDynamicAsset);
    layoutAssetDetails.setComponentAlignment(btnDynamicAsset, Alignment.TOP_RIGHT);
    layoutAssetDetails.addComponent(layoutAssetDetails1);

    lblHeading = new Label("Owner Details");
    layoutAssetOwner.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutAssetOwner.addComponent(PanelGenerator.createPanel(layoutOwnerDetails));
    lblHeading = new Label("Asset Details");
    layoutAssetOwner.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutAssetOwner.addComponent(PanelGenerator.createPanel(layoutAssetDetails));

    //for Owner Details
    layoutOwnerDetails.addComponent(btnAddOwner);
    layoutOwnerDetails.setComponentAlignment(btnAddOwner, Alignment.TOP_RIGHT);
    layoutOwnerDetails1.setColumns(4);
    layoutOwnerDetails1.addComponent(new ComponentIterOwnerDetails("", ""));
    layoutOwnerDetails.addComponent(layoutOwnerDetails1);
    layoutOwnerDetails1.setSpacing(true);
    layoutOwnerDetails1.setMargin(true);

    // for document details
    panelNormalDocumentDetails.addComponent(btnAddNorDoc);
    panelNormalDocumentDetails.setComponentAlignment(btnAddNorDoc, Alignment.TOP_RIGHT);
    panelNormalDocumentDetails.addComponent(new ComponentIteratorNormlDoc(null, null, "", ""));
    panelNormalDocumentDetails.setMargin(true);
    panelLegalDocumentDetails.addComponent(btnAddLegalDoc);
    panelLegalDocumentDetails.setComponentAlignment(btnAddLegalDoc, Alignment.TOP_RIGHT);
    panelLegalDocumentDetails.addComponent(new ComponentIteratorLegalDoc("", "", null));
    panelLegalDocumentDetails.setMargin(true);
    layoutNormalLegal.addComponent(PanelGenerator.createPanel(panelNormalDocumentDetails));
    lblHeading = new Label("Legal Documents");
    layoutNormalLegal.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutNormalLegal.addComponent(PanelGenerator.createPanel(panelLegalDocumentDetails));
    layoutNormalLegal.setMargin(true);

    // for adjoin properties
    //panelAdjoinProperties.setCaption("Adjoining Properties");
    panelAdjoinProperties.addComponent(btnAddAdjoinProperty);
    panelAdjoinProperties.setComponentAlignment(btnAddAdjoinProperty, Alignment.BOTTOM_RIGHT);
    panelAdjoinProperties.addComponent(new ComponentIteratorAdjoinProperty(null, true, true, true));

    // for dimensions
    //panelDimension.setCaption("Dimensions");
    panelDimension.addComponent(btnAddDimension);
    panelDimension.setComponentAlignment(btnAddDimension, Alignment.BOTTOM_RIGHT);
    panelDimension.addComponent(new ComponentIterDimensionofPlot(null, true, true, true));

    panelNormalDocumentDetails.setWidth("100%");
    panelLegalDocumentDetails.setWidth("100%");
    panelAdjoinProperties.setStyleName("width:100%;display:block;");

    //for description of the property
    layoutDescProperty.setMargin(true);
    layoutDescProperty1.setSpacing(true);
    layoutDescProperty1.setColumns(4);
    layoutDescProperty.addComponent(btnDynamicDescProp);
    layoutDescProperty.setComponentAlignment(btnDynamicDescProp, Alignment.TOP_RIGHT);
    layoutDescProperty1.addComponent(tfSiteNumber);
    layoutDescProperty1.addComponent(tfSFNumber);
    layoutDescProperty1.addComponent(tfNewSFNumber);
    layoutDescProperty1.addComponent(tfVillageLoc);
    layoutDescProperty1.addComponent(tfTaluk);
    layoutDescProperty1.addComponent(tfDistCorpPanc);
    layoutDescProperty1.addComponent(tfLocationSketch);
    layoutDescProperty1.addComponent(tfProTaxReceipt);
    layoutDescProperty1.addComponent(tfElecServiceConnNo);
    layoutDescProperty1.addComponent(tfElecConnecName);
    layoutDescProperty1.addComponent(slHighMiddPoor);
    layoutDescProperty1.addComponent(slUrbanSemiRural);
    layoutDescProperty1.addComponent(slResiIndustCommer);
    layoutDescProperty1.addComponent(slProOccupiedBy);
    layoutDescProperty1.addComponent(tfMonthlyRent);
    layoutDescProperty1.addComponent(tfCoverUnderStatCentral);
    layoutDescProperty1.addComponent(tfAnyConversionLand);
    layoutDescProperty1.addComponent(tfExtentSite);
    layoutDescProperty1.addComponent(tfYearAcquistion);
    layoutDescProperty1.addComponent(tfPurchaseValue);
    layoutDescProperty1.addComponent(tfPropLandmark);
    layoutDescProperty1.addComponent(tfPostalAddress);
    layoutDescProperty1.addComponent(tfDynamicDescProp1);
    layoutDescProperty1.addComponent(tfDynamicDescProp2);
    layoutDescProperty.addComponent(layoutDescProperty1);
    tfDynamicDescProp1.setVisible(false);
    tfDynamicDescProp2.setVisible(false);
    //for charcteristiccs of the site
    layoutCharcterSite1.setSpacing(true);
    layoutCharcterSite1.setColumns(4);
    layoutCharcterSite.setMargin(true);
    layoutCharcterSite.addComponent(btnDynamicCharacter);
    layoutCharcterSite.setComponentAlignment(btnDynamicCharacter, Alignment.TOP_RIGHT);
    layoutCharcterSite1.addComponent(slLocalClass);
    layoutCharcterSite1.addComponent(slSurroundDevelop);
    layoutCharcterSite1.addComponent(tfFlood);
    layoutCharcterSite1.addComponent(slFeasibility);
    layoutCharcterSite1.addComponent(slLandLevel);
    layoutCharcterSite1.addComponent(slLandShape);
    layoutCharcterSite1.addComponent(slTypeUse);
    layoutCharcterSite1.addComponent(tfUsageRestriction);
    layoutCharcterSite1.addComponent(slIsPlot);
    layoutCharcterSite1.addComponent(tfApprveNo);
    layoutCharcterSite1.addComponent(tfNoReason);
    layoutCharcterSite1.addComponent(tfSubdivide);
    layoutCharcterSite1.addComponent(slDrawApproval);
    layoutCharcterSite1.addComponent(slCornerInter);
    layoutCharcterSite1.addComponent(slRoadFacility);
    layoutCharcterSite1.addComponent(slTypeRoad);
    layoutCharcterSite1.addComponent(slRoadWidth);
    layoutCharcterSite1.addComponent(slLandLock);
    layoutCharcterSite1.addComponent(slWaterPotential);
    layoutCharcterSite1.addComponent(slUnderSewerage);
    layoutCharcterSite1.addComponent(slPowerSupply);
    layoutCharcterSite1.addComponent(tfAdvantageSite);
    layoutCharcterSite1.addComponent(tfDisadvantageSite);
    layoutCharcterSite1.addComponent(tfGeneralRemarks);
    layoutCharcterSite1.addComponent(tfDynamicCharacter1);
    layoutCharcterSite1.addComponent(tfDynamicCharacter2);
    layoutCharcterSite.addComponent(layoutCharcterSite1);
    tfDynamicCharacter1.setVisible(false);
    tfDynamicCharacter2.setVisible(false);

    // construction
    //layoutConstruction.setCaption("Construction");
    //layoutConstruction.setCaption("Construction");
    layoutConstruction1.setSpacing(true);
    layoutConstruction1.setColumns(4);
    layoutConstruction1.addComponent(tfStageofConst);
    layoutConstruction1.addComponent(tfSalablity);
    layoutConstruction1.addComponent(tfRentalValues);
    layoutConstruction1.addComponent(tfIncome);
    layoutConstruction1.addComponent(tfDynamicConstruction1);
    layoutConstruction1.addComponent(tfDynamicConstruction2);
    tfDynamicConstruction1.setVisible(false);
    tfDynamicConstruction2.setVisible(false);

    layoutConstruction.addComponent(btnDynamicConstruction);
    layoutConstruction.setComponentAlignment(btnDynamicConstruction, Alignment.TOP_RIGHT);
    layoutConstruction.addComponent(layoutConstruction1);
    layoutConstruction.setMargin(true);

    //for violation
    //layoutViolation.setCaption("Violation Details");
    layoutViolation1.setSpacing(true);
    layoutViolation1.setColumns(4);
    layoutViolation1.addComponent(tfAnyViolation);
    layoutViolation1.addComponent(tfDynamicViolation1);
    layoutViolation1.addComponent(tfDynamicViolation2);
    tfDynamicViolation1.setVisible(false);
    tfDynamicViolation2.setVisible(false);

    layoutViolation.addComponent(btnDynamicViolation);
    layoutViolation.setComponentAlignment(btnDynamicViolation, Alignment.TOP_RIGHT);
    layoutViolation.addComponent(layoutViolation1);
    layoutViolation.setMargin(true);

    // valuation of land
    layoutValuationLand.setSpacing(true);
    layoutValuationLand1.setSpacing(true);
    layoutValuationLand1.setColumns(4);
    layoutValuationLand1.addComponent(tfAreaofLand);
    layoutValuationLand1.addComponent(tfNorthandSouth);
    layoutValuationLand1.addComponent(tfMarketRate);
    layoutValuationLand1.addComponent(tfGuiderate);
    layoutValuationLand1.addComponent(tfAdopetdMarketRate);
    layoutValuationLand1.addComponent(tfFairMarketRate);
    layoutValuationLand1.addComponent(tfRealizabletRate);
    layoutValuationLand1.addComponent(tfDistressRate);
    layoutValuationLand1.addComponent(tfGuidelineRate);
    layoutValuationLand1.addComponent(tfDynamicValuation1);
    layoutValuationLand1.addComponent(tfDynamicValuation2);
    tfDynamicValuation1.setVisible(false);
    tfDynamicValuation2.setVisible(false);
    tfAdopetdMarketRate.setRequired(true);
    layoutValuationLand.addComponent(btnDynamicValuation);
    layoutValuationLand.setComponentAlignment(btnDynamicValuation, Alignment.TOP_RIGHT);
    layoutValuationLand.addComponent(layoutValuationLand1);
    layoutValuationLand.setMargin(true);
    //

    //   tfEvaluationNumber.addValidator(new IntegerValidator("Enter numbers only"));
    //      tfEvaluationNumber.addBlurListener(new SaarcValidate(tfEvaluationNumber));
    tfEvaluationNumber.setImmediate(true);

    tfEvaluationNumber.addBlurListener(new BlurListener() {

        private static final long serialVersionUID = 1L;

        public void blur(BlurEvent event) {
            // TODO Auto-generated method stub
            if (!tfEvaluationNumber.isReadOnly()) {
                tfEvaluationNumber.setComponentError(null);
                try {
                    tfEvaluationNumber.setComponentError(null);
                    String evalno = tfEvaluationNumber.getValue().toString();
                    count = beanEvaluation.getEvalNoCount(evalno);

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

                        if (count == 0) {

                            tfEvaluationNumber.setComponentError(null);

                        } else {

                            tfEvaluationNumber
                                    .setComponentError(new UserError("Evaluation number is already Exist"));

                        }
                    }
                } catch (Exception e) {

                }
            }

        }
    });
    tfLandMark.setImmediate(true);
    tfLandMark.addBlurListener(new BlurListener() {

        @Override
        public void blur(BlurEvent event) {
            // TODO Auto-generated method stub
            tfPropLandmark.setValue(tfLandMark.getValue());
        }
    });
    tfPropertyAddress.setImmediate(true);
    tfPropertyAddress.addBlurListener(new BlurListener() {

        @Override
        public void blur(BlurEvent event) {
            // TODO Auto-generated method stub
            tfPostalAddress.setValue(tfPropertyAddress.getValue());

        }
    });

    //for applicant estimate
    layoutElectrical.setSpacing(true);
    layoutElectrical1.setSpacing(true);
    layoutElectrical1.setColumns(4);
    layoutElectrical1.addComponent(tfTypeofwiring);
    layoutElectrical1.addComponent(tfClassFit);
    layoutElectrical1.addComponent(tfNOofLight);
    layoutElectrical1.addComponent(tfExhaustFan);
    layoutElectrical1.addComponent(tfSpareplug);
    layoutElectrical1.addComponent(tfDynamicElectrical1);
    layoutElectrical1.addComponent(tfDynamicElectrical2);
    tfDynamicElectrical1.setVisible(false);
    tfDynamicElectrical2.setVisible(false);
    layoutElectrical.addComponent(btnDynamicElectrical);
    layoutElectrical.setComponentAlignment(btnDynamicElectrical, Alignment.TOP_RIGHT);
    layoutElectrical.addComponent(layoutElectrical1);
    layoutElectrical.setMargin(true);

    //for applicant reasonable
    layoutPlumbing.setSpacing(true);
    layoutPlumbing1.setSpacing(true);
    layoutPlumbing1.setColumns(4);
    layoutPlumbing1.addComponent(tfNoofClosets);
    layoutPlumbing1.addComponent(tfNoofWashbin);
    layoutPlumbing1.addComponent(tfWatertaps);
    layoutPlumbing1.addComponent(tfAnyFixtures);
    layoutPlumbing1.addComponent(tfDynamicPlum1);
    layoutPlumbing1.addComponent(tfDynamicPlum2);

    layoutPlumbing.addComponent(btnDynamicPlumbing);
    layoutPlumbing.setComponentAlignment(btnDynamicPlumbing, Alignment.TOP_RIGHT);
    layoutPlumbing.addComponent(layoutPlumbing1);
    layoutPlumbing.setMargin(true);

    //property value
    layoutPropertyValue.setSpacing(true);
    layoutPropertyValue.setMargin(true);
    layoutPropertyValue1.setColumns(4);
    layoutPropertyValue1.setSpacing(true);
    layoutPropertyValue1.addComponent(tfRealizabletRate);
    layoutPropertyValue1.addComponent(tfDistressRate);
    layoutPropertyValue1.addComponent(tfGuidelineRate);
    layoutPropertyValue.addComponent(layoutPropertyValue1);

    // for details of plan approval
    layoutPlanApproval1.setColumns(4);
    formLand.addComponent(slLandandBuilding);
    formLand.addComponent(tfLandandBuilding);
    formBuilding.addComponent(slBuilding);
    formBuilding.addComponent(tfBuilding);

    layoutPlanApproval1.addComponent(formLand);
    layoutPlanApproval1.addComponent(formBuilding);
    layoutPlanApproval1.addComponent(tfPlanApprovedBy);
    layoutPlanApproval1.addComponent(dfLicenseFrom);
    layoutPlanApproval1.addComponent(slIsLicenceForced);
    layoutPlanApproval1.addComponent(slAllApprovalRecved);
    layoutPlanApproval1.addComponent(slConstAsperAppPlan);
    layoutPlanApproval1.addComponent(tfDynamicPlanApproval1);
    layoutPlanApproval1.addComponent(tfDynamicPlanApproval2);

    tfDynamicPlanApproval1.setVisible(false);
    tfDynamicPlanApproval2.setVisible(false);
    layoutPlanApproval1.setSpacing(true);
    layoutPlanApproval1.setMargin(true);
    layoutPlanApproval.addComponent(btnDynamicPlanApproval);
    layoutPlanApproval.setComponentAlignment(btnDynamicPlanApproval, Alignment.TOP_RIGHT);
    layoutPlanApproval.addComponent(layoutPlanApproval1);

    //details of the plan approval construction
    vlLand.addComponent(slLandBuildConst);
    vlLand.addComponent(tfLandBuildConst);
    vlBuilding.addComponent(slBuildConst);
    vlBuilding.addComponent(tfBuildConst);

    hlConstPlanApp1.addComponent(vlLand);
    hlConstPlanApp1.addComponent(vlBuilding);
    hlConstPlanApp1.addComponent(tfPlanApproveConst);
    hlConstPlanApp1.addComponent(slAllApprovalRecvedConst);
    hlConstPlanApp2.addComponent(slConstAsperAppPlanConst);
    hlConstPlanApp2.addComponent(tfDynamicConstPlanApp1);
    hlConstPlanApp2.addComponent(tfDynamicConstPlanApp2);

    tfDynamicConstPlanApp1.setVisible(false);
    tfDynamicConstPlanApp2.setVisible(false);
    hlConstPlanApp1.setSpacing(true);
    hlConstPlanApp1.setMargin(true);
    hlConstPlanApp2.setSpacing(true);
    hlConstPlanApp2.setMargin(true);
    vlConstPlanApp.addComponent(btnDynamicConstPlan);
    vlConstPlanApp.setComponentAlignment(btnDynamicConstPlan, Alignment.TOP_RIGHT);
    vlConstPlanApp.addComponent(hlConstPlanApp1);
    vlConstPlanApp.addComponent(hlConstPlanApp2);
    //valuation of Construction
    layoutConstValuation.setSpacing(true);
    layoutConstValuation1.setSpacing(true);
    layoutConstValuation1.addComponent(slTypeProperty);
    layoutConstValuation1.addComponent(slTypeStructure);
    layoutConstValuation1.addComponent(tfYearConstruction);
    layoutConstValuation1.addComponent(tfNoFloors);
    layoutConstValuation1.addComponent(tfConstQuality);
    layoutConstValuation1.addComponent(slAllapproval);
    layoutConstValuation1.addComponent(slIsConstruction);
    layoutConstValuation1.addComponent(tfReason);
    layoutConstValuation1.addComponent(tfDynamicConstval1);
    layoutConstValuation1.addComponent(tfDynamicConstval2);
    tfDynamicConstval1.setVisible(false);
    tfDynamicConstval2.setVisible(false);

    layoutConstValuation.addComponent(btnDynamicConstVal);
    layoutConstValuation.setComponentAlignment(btnDynamicConstVal, Alignment.TOP_RIGHT);
    layoutConstValuation.addComponent(layoutConstValuation1);
    layoutConstValuation.setMargin(true);

    //layoutLandConstValuation.addComponent(PanelGenerator.createPanel(layoutValuationLand));
    //layoutLandConstValuation.addComponent(PanelGenerator.createPanel(layoutConstValuation));
    //layoutLandConstValuation1.addComponent(layoutLandConstValuation);
    //layoutLandConstValuation1.setMargin(true);
    // for plinth area
    layoutPlintharea.addComponent(btnAddPlinth);
    layoutPlintharea.setComponentAlignment(btnAddPlinth, Alignment.TOP_RIGHT);
    layoutPlintharea.setMargin(true);
    layoutPlintharea.addComponent(new ComponentIterPlinthArea("Ground Floor", "", ""));
    layoutPlintharea.addComponent(new ComponentIterPlinthArea("Portico and Stair", "", ""));
    // for plinth area
    vlPlinthAreaNew.addComponent(btnAddPlinthNew);
    vlPlinthAreaNew.setComponentAlignment(btnAddPlinthNew, Alignment.TOP_RIGHT);
    vlPlinthAreaNew.setMargin(true);
    vlPlinthAreaNew.addComponent(new ComponentIterPlinthArea("Ground Floor", "", ""));
    vlPlinthAreaNew.addComponent(new ComponentIterPlinthArea("Portico and Stair", "", ""));

    //for Valuation Details
    layoutValuationDetails.addComponent(btnAddValDtls);
    layoutValuationDetails1.setColumns(8);
    layoutValuationDetails1.setSpacing(true);
    layoutValuationDetails.setComponentAlignment(btnAddValDtls, Alignment.TOP_RIGHT);
    layoutValuationDetails1.addComponent(lblParticular);
    layoutValuationDetails1.addComponent(lblPlinthArea);
    layoutValuationDetails1.addComponent(lblRoofHt);
    layoutValuationDetails1.addComponent(lblBuildAge);
    layoutValuationDetails1.addComponent(lblRate);
    layoutValuationDetails1.addComponent(lblReplace);
    layoutValuationDetails1.addComponent(lblDepreciation);
    layoutValuationDetails1.addComponent(lblNetvalue);
    layoutValuationDetails1.setComponentAlignment(lblParticular, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblPlinthArea, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblRoofHt, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblBuildAge, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblRate, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblReplace, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblDepreciation, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblNetvalue, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setWidth("650px");
    layoutValuationDetails.addComponent(layoutValuationDetails1);
    layoutValuationDetails.addComponent(layoutValuationDetails2);
    layoutValuationDetails.setWidth("100%");
    layoutValuationDetails.setMargin(true);
    ValuationDetailsList obj = new ValuationDetailsList();
    ValuationDetailsList obj1 = new ValuationDetailsList();
    obj.setFloorDtlsLabel("Ground Floor Building");
    obj1.setFloorDtlsLabel("First Floor Building");
    layoutValuationDetails2.addComponent(new ComponenetIterValuationDetails(obj));
    layoutValuationDetails2.addComponent(new ComponenetIterValuationDetails(obj1));

    //for Calculation-extra Items
    layoutExtraItems.setCaption("Extra Items");
    layoutExtraItems.setWidth("420px");
    layoutExtraItems.addComponent(btnDynamicExtra);
    layoutExtraItems.setComponentAlignment(btnDynamicExtra, Alignment.TOP_RIGHT);
    layoutExtraItems.addComponent(new ComponentIterExtraItems(null, ""));

    layoutAdditionItem.setCaption("Additional Items");
    layoutAdditionItem.setWidth("400px");
    layoutAdditionItem.addComponent(btnDynamicAdditional);
    layoutAdditionItem.setComponentAlignment(btnDynamicAdditional, Alignment.TOP_RIGHT);
    layoutAdditionItem.addComponent(new ComponentIterAdditionalItems(null, ""));

    layoutExtraAddItems1.setSpacing(true);
    layoutExtraAddItems1.setMargin(true);
    layoutExtraAddItems.setColumns(2);
    layoutExtraAddItems.addComponent(layoutExtraItems);
    layoutExtraAddItems.addComponent(layoutAdditionItem);
    layoutExtraAddItems1.addComponent(layoutExtraAddItems);

    //for Miscellaneous
    layoutMiscellaneous.setCaption("Miscellaneous");
    layoutMiscellaneous.setWidth("420px");
    layoutMiscellaneous.addComponent(btnDynamicMiscell);
    layoutMiscellaneous.setComponentAlignment(btnDynamicMiscell, Alignment.TOP_RIGHT);
    layoutMiscellaneous.addComponent(new ComponentIterMiscellaneous(null, ""));

    layoutServices.setCaption("Services");
    layoutServices.setWidth("400px");
    layoutServices.addComponent(btnDynamicServices);
    layoutServices.setComponentAlignment(btnDynamicServices, Alignment.TOP_RIGHT);
    layoutServices.addComponent(new ComponentIerServices(null, ""));

    layoutMiscellService1.setSpacing(true);
    layoutMiscellService1.setMargin(true);
    layoutMiscellService.setColumns(2);
    layoutMiscellService.addComponent(layoutMiscellaneous);
    layoutMiscellService.addComponent(layoutServices);
    layoutMiscellService1.addComponent(layoutMiscellService);
    // for Build Specification
    panelBuildSpecfication.addComponent(btnAddBuildSpec);
    panelBuildSpecfication.setComponentAlignment(btnAddBuildSpec, Alignment.BOTTOM_RIGHT);
    panelBuildSpecfication.addComponent(new ComponentIterBuildingSpecfication(null, true, true, true));
    panelBuildSpecfication.setWidth("100%");
    // for Build Specification
    panelBuildSpecficationNew.addComponent(btnAddBuildSpecNew);
    panelBuildSpecficationNew.setComponentAlignment(btnAddBuildSpecNew, Alignment.BOTTOM_RIGHT);
    panelBuildSpecficationNew.addComponent(new ComponentIterBuildingSpecfication(null, true, true, true));
    panelBuildSpecficationNew.setWidth("100%");

    // for applicant estimate
    layoutApplicantEstimate.setSpacing(true);
    layoutApplicantEstimate1.setSpacing(true);
    layoutApplicantEstimate1.setColumns(2);
    layoutApplicantEstimate2.setSpacing(true);
    layoutApplicantEstimate2.setColumns(2);
    layoutApplicantEstimate3.setSpacing(true);
    layoutApplicantEstimate3.setColumns(2);
    layoutApplicantEstimate4.setSpacing(true);
    layoutApplicantEstimate4.setColumns(2);
    layoutApplicantEstimate1.addComponent(lblAppEstimate);
    layoutApplicantEstimate1.addComponent(tfAppEstimate);
    layoutApplicantEstimate1.addComponent(lblDtlsAppEstimate);
    layoutApplicantEstimate1.addComponent(tfDtlsAppEstimate);
    layoutApplicantEstimate1.addComponent(tfDetails1);
    layoutApplicantEstimate1.addComponent(tfDetailVal1);
    layoutApplicantEstimate1.addComponent(tfDetails2);
    layoutApplicantEstimate1.addComponent(tfDetailVal2);
    layoutApplicantEstimate1.addComponent(tfDetails3);
    layoutApplicantEstimate1.addComponent(tfDetailVal3);
    layoutApplicantEstimate2.addComponent(tfDynamicAppEstimate1);
    layoutApplicantEstimate2.addComponent(tfDynamicAppEstimate2);
    layoutApplicantEstimate2.addComponent(tfDynamicAppEstimate3);
    layoutApplicantEstimate2.addComponent(tfDynamicAppEstimate4);
    layoutApplicantEstimate3.addComponent(tfDynamicAppEstimate5);
    layoutApplicantEstimate3.addComponent(tfDynamicAppEstimate6);
    layoutApplicantEstimate3.addComponent(tfDynamicAppEstimate7);
    layoutApplicantEstimate3.addComponent(tfDynamicAppEstimate8);
    layoutApplicantEstimate4.addComponent(lblTotal);
    layoutApplicantEstimate4.addComponent(tfTotalval);

    layoutApplicantEstimate.addComponent(btnDynamicAppEstimate);
    layoutApplicantEstimate.setComponentAlignment(btnDynamicAppEstimate, Alignment.TOP_RIGHT);
    layoutApplicantEstimate.addComponent(layoutApplicantEstimate1);
    layoutApplicantEstimate.addComponent(layoutApplicantEstimate2);
    layoutApplicantEstimate.addComponent(layoutApplicantEstimate3);
    layoutApplicantEstimate.addComponent(layoutApplicantEstimate4);
    layoutApplicantEstimate2.setVisible(true);
    layoutApplicantEstimate3.setVisible(true);
    layoutApplicantEstimate.setMargin(true);
    tfDynamicAppEstimate2.setValue("0.00");
    tfDetailVal2.setValue("0.00");
    tfDetailVal1.setValue("0.00");
    tfDynamicAppEstimate4.setValue("0.00");
    tfDynamicAppEstimate6.setValue("0.00");
    tfDynamicAppEstimate8.setValue("0.00");
    tfDetailVal3.setValue("0.00");
    tfTotalval.setImmediate(true);
    tfTotalval.addBlurListener(new BlurListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void blur(BlurEvent event) {
            // TODO Auto-generated method stub
            BigDecimal appEstimate = 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");
            BigDecimal test6 = new BigDecimal("0.00");

            try {
                test = new BigDecimal(tfDetailVal1.getValue());

            } catch (Exception e) {
                test = new BigDecimal("0.00");
            }
            try {
                test1 = new BigDecimal(tfDetailVal2.getValue());
            } catch (Exception e) {
                test1 = new BigDecimal("0.00");
            }
            try {
                test2 = new BigDecimal(tfDetailVal3.getValue());
            } catch (Exception e) {
                test2 = new BigDecimal("0.00");
            }
            try {
                test3 = new BigDecimal(tfDynamicAppEstimate2.getValue());

            } catch (Exception e) {
                test3 = new BigDecimal("0.00");
            }
            try {
                test4 = new BigDecimal(tfDynamicAppEstimate4.getValue());
            } catch (Exception e) {
                test4 = new BigDecimal("0.00");
            }
            try {
                test5 = new BigDecimal(tfDynamicAppEstimate6.getValue());
            } catch (Exception e) {
                test4 = new BigDecimal("0.00");
            }
            try {
                test6 = new BigDecimal(tfDynamicAppEstimate8.getValue());
            } catch (Exception e) {
                test4 = new BigDecimal("0.00");
            }
            appEstimate = appEstimate.add(test).add(test1).add(test2).add(test3).add(test4).add(test5)
                    .add(test6);
            tfTotalval.setValue(appEstimate.toString());
            tfAppEstimate.setValue(appEstimate.toString());
        }
    });

    //for applicant reasonable
    layoutApplicantReasonable.setSpacing(true);
    layoutApplicantReasonable1.setSpacing(true);
    layoutApplicantReasonable2.setSpacing(true);
    layoutApplicantReasonable1.setColumns(2);
    layoutApplicantReasonable2.setColumns(2);
    layoutApplicantReasonable1.setVisible(false);
    layoutApplicantReasonable2.addComponent(lblAppReasonable);
    layoutApplicantReasonable2.addComponent(slAppReasonable);
    layoutApplicantReasonable1.addComponent(lblReasonEstimate);
    layoutApplicantReasonable1.addComponent(tfReasonEstimateVal);
    layoutApplicantReasonable1.addComponent(lblDtlsAppReasonable);
    layoutApplicantReasonable1.addComponent(tfDtlsAppReasonable);
    layoutApplicantReasonable1.addComponent(tfDetailsReason1);
    layoutApplicantReasonable1.addComponent(tfDetailReasonVal1);
    layoutApplicantReasonable1.addComponent(tfDetailsReason2);
    layoutApplicantReasonable1.addComponent(tfDetailReasonVal2);
    layoutApplicantReasonable1.addComponent(tfDetailsReason3);
    layoutApplicantReasonable1.addComponent(tfDetailReasonVal3);
    layoutApplicantReasonable1.addComponent(tfDynamicAppReason1);
    layoutApplicantReasonable1.addComponent(tfDynamicAppReason2);
    layoutApplicantReasonable1.addComponent(tfDynamicAppReason3);
    layoutApplicantReasonable1.addComponent(tfDynamicAppReason4);
    layoutApplicantReasonable1.addComponent(lblReasonTotal);
    layoutApplicantReasonable1.addComponent(tfReasonTotalval);
    tfDynamicAppReason1.setVisible(false);
    tfDynamicAppReason2.setVisible(false);
    tfDynamicAppReason3.setVisible(false);
    tfDynamicAppReason4.setVisible(false);

    layoutApplicantReasonable.addComponent(btnDynamicAppReason);
    layoutApplicantReasonable.setComponentAlignment(btnDynamicAppReason, Alignment.TOP_RIGHT);
    layoutApplicantReasonable.addComponent(layoutApplicantReasonable2);
    layoutApplicantReasonable.addComponent(layoutApplicantReasonable1);
    layoutApplicantReasonable.setMargin(true);

    tfDetailReasonVal1.setValue("0.00");
    tfDetailReasonVal2.setValue("0.00");
    tfDetailReasonVal3.setValue("0.00");

    tfReasonTotalval.setImmediate(true);
    tfReasonTotalval.addBlurListener(new BlurListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void blur(BlurEvent event) {
            // TODO Auto-generated method stubBigDecimal appEstimate =new BigDecimal(0.00);
            BigDecimal appReason = 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(tfDetailReasonVal1.getValue());

            } catch (Exception e) {
                test = new BigDecimal("0.00");
            }
            try {
                test1 = new BigDecimal(tfDetailReasonVal2.getValue());
            } catch (Exception e) {
                test1 = new BigDecimal("0.00");
            }
            try {
                test2 = new BigDecimal(tfDetailReasonVal3.getValue());
            } catch (Exception e) {
                test2 = new BigDecimal("0.00");
            }
            try {
                test3 = new BigDecimal(tfDynamicAppReason2.getValue());

            } catch (Exception e) {
                test3 = new BigDecimal("0.00");
            }
            try {
                test4 = new BigDecimal(tfDynamicAppReason2.getValue());
            } catch (Exception e) {
                test4 = new BigDecimal("0.00");
            }
            appReason = appReason.add(test).add(test1).add(test2).add(test3).add(test4);
            tfReasonTotalval.setValue(appReason.toString());
            tfReasonEstimateVal.setValue(appReason.toString());
        }
    });

    slAppReasonable.setImmediate(true);
    slAppReasonable.setNullSelectionAllowed(false);
    slAppReasonable.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {
            if (slAppReasonable.getValue() != null) {

                if (slAppReasonable.getValue().equals(Common.NO_DESC)) {

                    System.out.println("serial application" + slAppReasonable.getValue());
                    layoutApplicantReasonable1.setVisible(true);
                    btnDynamicAppReason.setVisible(true);

                } else {
                    layoutApplicantReasonable1.setVisible(false);
                    btnDynamicAppReason.setVisible(false);
                }

            }
        }
    });

    //Earth quake

    layoutEarthquake1.setSpacing(true);
    layoutEarthquake1.setColumns(4);
    layoutEarthquake1.addComponent(slEarthQuake);
    layoutEarthquake1.addComponent(tfDynamicEarthquake1);
    layoutEarthquake1.addComponent(tfDynamicEarthquake2);
    tfDynamicEarthquake1.setVisible(false);
    tfDynamicEarthquake2.setVisible(false);

    layoutEarthquake.addComponent(btnDynamicEarthQuake);
    layoutEarthquake.setComponentAlignment(btnDynamicEarthQuake, Alignment.TOP_RIGHT);
    layoutEarthquake.addComponent(layoutEarthquake1);
    layoutEarthquake.setMargin(true);
    // cost of construction
    layoutCost.setColumns(2);
    layoutCostConstruction1.setColumns(2);
    layoutCostConstruction2.setColumns(2);
    layoutCostConstruction.setSpacing(true);
    layoutCost.setSpacing(true);
    layoutCostConstruction2.setSpacing(true);
    layoutCostConstruction1.setSpacing(true);
    layoutCostConstruction1.setSpacing(true);
    layoutCost.addComponent(lblCostConst);
    layoutCost.addComponent(tfCostConstruction);

    layoutCostConstruction1.addComponent(tfDynamicCostConst1);
    layoutCostConstruction1.addComponent(tfDynamicCostConst2);
    layoutCostConstruction1.addComponent(tfDynamicCostConst3);
    layoutCostConstruction1.addComponent(tfDynamicCostConst4);
    layoutCostConstruction1.addComponent(tfDynamicCostConst5);
    layoutCostConstruction1.addComponent(tfDynamicCostConst6);

    layoutCostConstruction2.addComponent(tfDynamicCostConst7);
    layoutCostConstruction2.addComponent(tfDynamicCostConst8);
    layoutCostConstruction2.addComponent(tfDynamicCostConst9);
    layoutCostConstruction2.addComponent(tfDynamicCostConst10);
    layoutCostConstruction1.setVisible(false);
    layoutCostConstruction2.setVisible(false);

    layoutCostConstruction.addComponent(btnDynamicCostConst);
    layoutCostConstruction.setComponentAlignment(btnDynamicCostConst, Alignment.TOP_RIGHT);
    layoutCostConstruction.addComponent(layoutCost);
    layoutCostConstruction.addComponent(layoutCostConstruction1);
    layoutCostConstruction.addComponent(layoutCostConstruction2);
    layoutCostConstruction.setMargin(true);

    //valuation of Building
    formConstValuation1.addComponent(slTypeBuilding);
    formConstValuation1.addComponent(slBuildStructure);
    formConstValuation1.addComponent(tfYearConstructionBuild);
    formConstValuation1.addComponent(slExterior);
    formConstValuation1.addComponent(slInterior);
    formConstValuation1.addComponent(tfLifeAge);
    formConstValuation1.addComponent(tfFutureLife);
    formConstValuation1.addComponent(tfDetailsPlan);
    formConstValuation1.addComponent(slDeviation);
    formConstValuation1.addComponent(tfDtlsDeviation);

    formConstValuation2.addComponent(btnAddRoofHt);
    formConstValuation2.addComponent(tfBuildNoFloors);

    layoutBuildtValuation.setSpacing(true);
    layoutBuildtValuation1.setSpacing(true);
    layoutBuildtValuation1.setColumns(2);
    layoutBuildtValuation1.addComponent(formConstValuation1);
    layoutBuildtValuation1.addComponent(new VerticalLayout() {
        {
            addComponent(formConstValuation2);
            addComponent(layoutRoofHeight);
        }

    });

    formConstValuation1.addComponent(tfDynamicBuildval1);
    formConstValuation1.addComponent(tfDynamicBuildval2);
    layoutBuildtValuation.addComponent(btnDynamicBuildVal);
    layoutBuildtValuation.setComponentAlignment(btnDynamicBuildVal, Alignment.TOP_RIGHT);
    layoutBuildtValuation.addComponent(layoutBuildtValuation1);
    layoutBuildtValuation.setMargin(true);

    // for Guideline area
    layoutGuideline.addComponent(btnAddGuideline);
    layoutGuideline.setComponentAlignment(btnAddGuideline, Alignment.TOP_RIGHT);
    layoutGuideline.setMargin(true);
    layoutGuideline.addComponent(new ComponentIterGuideline("Land", "", "", ""));
    layoutGuideline.addComponent(new ComponentIterGuideline("Building", "", "", ""));
    // for guide line reference
    streetLayout.addComponent(slStreetSerNo);
    streetLayout.addComponent(tfStreetName);

    layoutGuidelineReference1.setColumns(4);
    layoutGuidelineReference1.setSpacing(true);
    layoutGuidelineReference1.addComponent(tfZone);
    layoutGuidelineReference1.addComponent(tfSRO);
    layoutGuidelineReference1.addComponent(tfVillage);
    layoutGuidelineReference1.addComponent(tfRevnueDist);
    layoutGuidelineReference1.addComponent(tfTalukName);
    layoutGuidelineReference1.addComponent(streetLayout);
    layoutGuidelineReference1.addComponent(tfGuidelineValue);
    layoutGuidelineReference1.addComponent(tfGuidelineValueMatric);
    layoutGuidelineReference1.addComponent(slClassification);
    layoutGuidelineReference1.setMargin(true);

    layoutGuidelineReference.setSpacing(true);
    layoutGuidelineReference.addComponent(layoutGuidelineReference1);

    //add components in main panel
    accordion.setWidth("100%");

    layoutEvaluationDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutEvaluationDetails), "Evaluation Details");
    layoutOwnerDetails.setStyleName("bluebar");
    layoutAssetDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutAssetOwner), "Owner Details/Asset Details");

    layoutNormalLegal.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutNormalLegal), "Document Details");

    panelAdjoinProperties.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(panelAdjoinProperties), "Adjoining Properties");

    panelDimension.setStyleName("bluebar");
    accordion.addTab(panelDimension, "Dimension");
    layoutDescProperty.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutDescProperty), "Description of the property");
    layoutCharcterSite.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutCharcterSite), "Characteristics of the site");
    layoutValuationLand.setStyleName("bluebar");
    accordion.addTab(layoutValuationLand, "Valuation of Land");
    //for Building
    vlConstPlanApp.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(vlConstPlanApp), "Details of Existing Plan Approval");
    layoutBuildtValuation.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutBuildtValuation), "Details of Building");
    layoutPlintharea.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPlintharea), "Plinth Area Details");
    panelBuildSpecfication.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(panelBuildSpecfication),
            "Specification of the building(Existing)");
    layoutValuationDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutValuationDetails), "Details of Valuation");
    layoutExtraAddItems1.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutExtraAddItems1), "Extra/Additional Items");
    layoutMiscellService1.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutMiscellService1), "Miscellaneous/Services");
    layoutElectrical.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutElectrical), "Electrical Installation");

    layoutPlumbing.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPlumbing), "Plumbing Installation");
    //for construction
    layoutPlanApproval.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPlanApproval), "Details of Plan Approval");
    layoutConstValuation.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutConstValuation), "Details of Construction");
    layoutApplicantEstimate.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutApplicantEstimate), "Applicant Estimate");

    layoutApplicantReasonable.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutApplicantReasonable), "Applicant Reasonable");

    vlPlinthAreaNew.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(vlPlinthAreaNew), "Plinth Area Details for Construction");
    panelBuildSpecficationNew.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(panelBuildSpecficationNew), "Specification of the building");
    layoutMainForm.addComponent(PanelGenerator.createPanel(accordion));
    layoutConstruction.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutConstruction), "Construction Details");
    layoutEarthquake.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutEarthquake), "Earth Quake Details");

    layoutCostConstruction.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutCostConstruction), "Cost of Construction");

    layoutGuideline.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutGuideline), "Guideline Details");

    layoutGuidelineReference.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutGuidelineReference), "Guideline Reference Details");
    layoutPropertyValue.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPropertyValue), "Property Value Details");
    this.accordion.addListener(new SelectedTabChangeListener() {
        public void selectedTabChange(SelectedTabChangeEvent event) {
            if (event.getTabSheet().getSelectedTab().equals(panelDimension)) {
                Iterator<Component> myComps = panelDimension.getComponentIterator();
                BigDecimal siteArea = new BigDecimal(0.00);
                while (myComps.hasNext()) {
                    final Component component = myComps.next();
                    int i = 1;

                    if (component instanceof ComponentIterDimensionofPlot) {

                        ComponentIterDimensionofPlot mycomponent = (ComponentIterDimensionofPlot) component;
                        List<TPemCmPropDimension> getList = mycomponent.getDimensionPropertyList();

                        try {
                            List<String> mylist = mycomponent.getLeastValaue();
                            siteArea = siteArea.add(new BigDecimal(mylist.get(0).replaceAll("[^\\d.]", "")));
                            tfNorthandSouth.setValue(mylist.get(1));
                            tfAreaofLand.setValue(siteArea.toString());
                        } catch (Exception e) {

                            logger.info("Error-->" + e);
                        }
                    }
                }
                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) {

                }
            }

        }
    });
    layoutMainForm.setMargin(true);
    layoutMainForm.setSpacing(true);
    // for main panel
    layoutButton2.setSpacing(true);
    btnSave.setStyleName("savebt");
    btnCancel.setStyleName("cancelbt");
    btnSubmit.setStyleName("submitbt");

    btnSave.setVisible(false);
    btnSubmit.setVisible(false);
    btnCancel.setVisible(false);
    //   saveExcel.setVisible(false);
    layoutButton2.addComponent(btnSave);
    layoutButton2.addComponent(btnSubmit);
    //   layoutButton2.addComponent(saveExcel);
    layoutButton2.addComponent(btnCancel);
    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);

    /*String basepath = VaadinService.getCurrent()
          .getBaseDirectory().getAbsolutePath();
    Resource res = new FileResource(new File(basepath +
              "/WEB-INF/view/channel.doc"));
    FileDownloader fd = new FileDownloader(res);
    fd.extend(saveExcel);*/
    // Initaited the Label Function here by Hohul
    lblTableTitle = new Label();
    lblSaveNotification = new Label();
    lblSaveNotification.setContentMode(ContentMode.HTML);
    lblNotificationIcon = new Label();
    lblTableTitle.setValue("<B>&nbsp;&nbsp;Action:</B>");
    lblTableTitle.setContentMode(ContentMode.HTML);
    lblFormTittle = new Label();
    lblFormTittle.setContentMode(ContentMode.HTML);
    lblFormTittle.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;Home");
    lblFormTitle1 = new Label();
    lblFormTitle1.setContentMode(ContentMode.HTML);
    lblFormTitle1.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;");
    lblAddEdit = new Label();
    lblAddEdit.setContentMode(ContentMode.HTML);

    // Button Back declaration by Hohul
    btnBack = new Button("Home", this);
    btnBack.setStyleName("link");

    // Bread Scrumbs initiated here by Hohul

    hlBreadCrumbs = new HorizontalLayout();
    hlBreadCrumbs.addComponent(lblFormTitle1);
    hlBreadCrumbs.addComponent(btnBack);
    hlBreadCrumbs.setComponentAlignment(btnBack, Alignment.TOP_CENTER);
    hlBreadCrumbs.addComponent(lblAddEdit);
    hlBreadCrumbs.setComponentAlignment(lblAddEdit, Alignment.MIDDLE_CENTER);
    hlBreadCrumbs.setVisible(false);

    mainPanel.addComponent(layoutMainForm);
    mainPanel.setVisible(false);

    // for search panel
    // for search panel
    // Added by Hohul ----->  For Search Panel Layouts
    FormLayout flSearchEvalNumber = new FormLayout();
    flSearchEvalNumber.addComponent(tfSearchEvalNumber);

    FormLayout flSearchBankbranch = new FormLayout();
    flSearchBankbranch.addComponent(tfSearchBankbranch);

    FormLayout flSearchCustomer = new FormLayout();
    flSearchCustomer.addComponent(tfSearchCustomer);

    HorizontalLayout hlSearchComponentLayout = new HorizontalLayout();
    hlSearchComponentLayout.addComponent(flSearchEvalNumber);
    hlSearchComponentLayout.addComponent(flSearchBankbranch);
    hlSearchComponentLayout.addComponent(flSearchCustomer);
    hlSearchComponentLayout.setSpacing(true);
    hlSearchComponentLayout.setMargin(true);

    //Initialization and properties for btnDownload      
    btnDownload = new Button("Download");
    //btnDownload.setDescription("Download");
    btnDownload.addStyleName("downloadbt");
    btnDownload.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            //  UI.getCurrent()..clearDashboardButtonBadge();
            event.getButton().removeStyleName("unread");
            if (notifications != null && notifications.getUI() != null)
                notifications.close();
            else {
                buildNotifications(event);
                UI.getCurrent().addWindow(notifications);
                notifications.focus();
                ((VerticalLayout) UI.getCurrent().getContent())
                        .addLayoutClickListener(new LayoutClickListener() {
                            @Override
                            public void layoutClick(LayoutClickEvent event) {
                                notifications.close();
                                ((VerticalLayout) UI.getCurrent().getContent()).removeLayoutClickListener(this);
                            }
                        });
            }

        }
    });

    hlFileDownloadLayout = new HorizontalLayout();
    hlFileDownloadLayout.setSpacing(true);
    hlFileDownloadLayout.addComponent(btnDownload);
    hlFileDownloadLayout.setComponentAlignment(btnDownload, Alignment.MIDDLE_CENTER);

    VerticalLayout vlSearchandResetButtonLAyout = new VerticalLayout();
    vlSearchandResetButtonLAyout.setSpacing(true);
    vlSearchandResetButtonLAyout.addComponent(btnReset);
    vlSearchandResetButtonLAyout.setWidth("100");
    vlSearchandResetButtonLAyout.addStyleName("topbarthree");
    vlSearchandResetButtonLAyout.setMargin(true);

    HorizontalLayout hlSearchComponentandButtonLayout = new HorizontalLayout();
    hlSearchComponentandButtonLayout.setSizeFull();
    hlSearchComponentandButtonLayout.setSpacing(true);
    hlSearchComponentandButtonLayout.addComponent(hlSearchComponentLayout);
    hlSearchComponentandButtonLayout.setComponentAlignment(hlSearchComponentLayout, Alignment.MIDDLE_LEFT);
    hlSearchComponentandButtonLayout.addComponent(vlSearchandResetButtonLAyout);
    hlSearchComponentandButtonLayout.setComponentAlignment(vlSearchandResetButtonLAyout,
            Alignment.MIDDLE_RIGHT);
    hlSearchComponentandButtonLayout.setExpandRatio(vlSearchandResetButtonLAyout, 1);
    final VerticalLayout vlSearchComponentandButtonLayout = new VerticalLayout();
    vlSearchComponentandButtonLayout.setSpacing(true);
    vlSearchComponentandButtonLayout.setSizeFull();
    vlSearchComponentandButtonLayout.addComponent(hlSearchComponentandButtonLayout);

    /*layoutSearch.addComponent(tfSearchEvalNumber);
    layoutSearch.addComponent(tfSearchBankbranch);
    layoutSearch.addComponent(tfSearchCustomer);
    //layoutSearch.addComponent(btnSearch);
    layoutSearch.addComponent(btnReset);
    //layoutSearch.setComponentAlignment(btnSearch, Alignment.BOTTOM_LEFT);
    layoutSearch.setComponentAlignment(btnReset, Alignment.BOTTOM_LEFT);
    //btnSearch.addStyleName("default");
    */ btnReset.addStyleName("resetbt");
    tfSearchCustomer.setImmediate(true);
    tfSearchCustomer.addListener(new TextChangeListener() {
        private static final long serialVersionUID = 1L;
        SimpleStringFilter filter = null;

        public void textChange(TextChangeEvent event) {
            Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
            if (filter != null)
                f.removeContainerFilter(filter);

            filter = new SimpleStringFilter("custName", event.getText(), true, false);

            f.addContainerFilter(filter);
            total = f.size();
            tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
        }
    });
    tfSearchEvalNumber.setImmediate(true);
    tfSearchEvalNumber.addListener(new TextChangeListener() {
        private static final long serialVersionUID = 1L;
        SimpleStringFilter filter = null;

        public void textChange(TextChangeEvent event) {
            Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
            if (filter != null)
                f.removeContainerFilter(filter);

            filter = new SimpleStringFilter("evalNo", event.getText(), true, false);

            f.addContainerFilter(filter);
            total = f.size();
            tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
        }
    });

    tfSearchBankbranch.setImmediate(true);
    tfSearchBankbranch.addValueChangeListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;
        Filter filter = null;

        @Override
        public void valueChange(ValueChangeEvent event) {
            // TODO Auto-generated method stub

            try {
                String strBankBranch = tfSearchBankbranch.getValue().toString();
                Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
                if (filter != null)
                    f.removeContainerFilter(filter);

                filter = new Compare.Equal("bankBranch", strBankBranch);
                f.addContainerFilter(filter);
                f.addContainerFilter(filter);
                total = f.size();
                tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
            } catch (Exception e) {
            }
        }

    });
    searchPanel.addComponent(PanelGenerator.createPanel(vlSearchComponentandButtonLayout));
    searchPanel.setMargin(true);

    // Add Layout table panel by Hohul

    HorizontalLayout flTableCaption = new HorizontalLayout();
    flTableCaption.addComponent(lblTableTitle);
    flTableCaption.setComponentAlignment(lblTableTitle, Alignment.MIDDLE_CENTER);
    flTableCaption.addStyleName("lightgray");
    flTableCaption.setHeight("25px");
    flTableCaption.setWidth("60px");
    lblNoofRecords = new Label(" ", ContentMode.HTML);
    lblNoofRecords.addStyleName("lblfooter");
    HorizontalLayout hlTableTittleLayout = new HorizontalLayout();
    hlTableTittleLayout.addComponent(flTableCaption);
    hlTableTittleLayout.addComponent(btnAdd);
    hlTableTittleLayout.addComponent(btnEdit);
    hlTableTittleLayout.addComponent(btnView);
    hlTableTittleLayout.setHeight("25px");
    hlTableTittleLayout.setSpacing(true);

    HorizontalLayout hlTableTitleandCaptionLayout = new HorizontalLayout();
    hlTableTitleandCaptionLayout.addStyleName("topbarthree");
    hlTableTitleandCaptionLayout.setWidth("100%");
    hlTableTitleandCaptionLayout.addComponent(hlTableTittleLayout);
    hlTableTitleandCaptionLayout.addComponent(hlFileDownloadLayout);
    hlTableTitleandCaptionLayout.setComponentAlignment(hlFileDownloadLayout, Alignment.MIDDLE_RIGHT);
    hlTableTitleandCaptionLayout.setHeight("28px");

    // for table panel
    btnAdd.addStyleName("add");
    btnEdit.addStyleName("editbt");
    btnView.addStyleName("view");
    btnView.setEnabled(false);

    hlAddEditLayout.addStyleName("topbarthree");
    hlAddEditLayout.setWidth("100%");
    hlAddEditLayout.addComponent(hlTableTitleandCaptionLayout);
    hlAddEditLayout.setHeight("28px");

    // Added Action Label to Table

    layoutTable.addComponent(hlAddEditLayout);
    layoutTable.setComponentAlignment(hlAddEditLayout, Alignment.TOP_LEFT);
    layoutTable.addComponent(tblEvalDetails);

    tablePanel.addComponent(layoutTable);
    ;
    tablePanel.setWidth("100%");
    tablePanel.setMargin(true);

    layoutPage.addComponent(mainPanel);
    layoutPage.addComponent(searchPanel);
    layoutPage.addComponent(tablePanel);

    // Added labels and titles to respective Location by Hohul

    HorizontalLayout hlNotificationLayout = new HorizontalLayout();
    hlNotificationLayout.addComponent(lblNotificationIcon);
    hlNotificationLayout.setComponentAlignment(lblNotificationIcon, Alignment.MIDDLE_LEFT);
    hlNotificationLayout.addComponent(lblSaveNotification);
    hlNotificationLayout.setComponentAlignment(lblSaveNotification, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(lblFormTittle);
    hlHeaderLayout.setComponentAlignment(lblFormTittle, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(hlBreadCrumbs);
    hlHeaderLayout.setComponentAlignment(hlBreadCrumbs, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(hlNotificationLayout);
    hlHeaderLayout.setComponentAlignment(hlNotificationLayout, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.MIDDLE_RIGHT);

    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);

    // load Component list values
    loadComponentListValues();

    //setTableProperties();
    populateAndConfig(false);
}

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

@SuppressWarnings("deprecation")
void buildView(VerticalLayout layoutPage, HorizontalLayout hlHeaderLayout) {
    // for component width
    setComponentStyle();/*  w  w w . jav  a2 s.  c  o  m*/
    hlHeaderLayout.removeAllComponents();

    tblEvalDetails = new Table();
    tblEvalDetails.setStyleName(Runo.TABLE_SMALL);
    tblEvalDetails.setPageLength(14);
    tblEvalDetails.setSizeFull();
    tblEvalDetails.setFooterVisible(true);
    tblEvalDetails.setSelectable(true);
    tblEvalDetails.setImmediate(true);
    tblEvalDetails.setColumnCollapsingAllowed(true);
    // for evaluation details
    tfEvaluationPurpose.setValue("Collateral Security to the Bank");

    tfEvaluationNumber.setRequired(true);
    slBankBranch.setRequired(true);
    dfDateofValuation.setRequired(true);
    tfEvaluationPurpose.setRequired(true);
    layoutEvaluationDetails1.setColumns(4);

    layoutEvaluationDetails1.addComponent(tfEvaluationNumber);
    layoutEvaluationDetails1.addComponent(slBankBranch);
    layoutEvaluationDetails1.addComponent(tfEvaluationPurpose);
    layoutEvaluationDetails1.addComponent(tfValuatedBy);
    layoutEvaluationDetails1.addComponent(dfDateofValuation);
    layoutEvaluationDetails1.addComponent(dfVerifiedDate);
    layoutEvaluationDetails1.addComponent(tfVerifiedBy);
    layoutEvaluationDetails1.addComponent(tfDynamicEvaluation1);
    layoutEvaluationDetails1.addComponent(tfDynamicEvaluation2);
    tfDynamicEvaluation1.setVisible(false);
    tfDynamicEvaluation2.setVisible(false);
    layoutEvaluationDetails1.setSpacing(true);
    layoutEvaluationDetails1.setMargin(true);

    layoutEvaluationDetails.addComponent(btnDynamicEvaluation1);
    layoutEvaluationDetails.setComponentAlignment(btnDynamicEvaluation1, Alignment.TOP_RIGHT);
    layoutEvaluationDetails.addComponent(layoutEvaluationDetails1);

    // for asset details
    VerticalLayout formAsset1 = new VerticalLayout();
    VerticalLayout formAsset2 = new VerticalLayout();
    VerticalLayout formAsset3 = new VerticalLayout();
    VerticalLayout formAsset4 = new VerticalLayout();
    formAsset1.setSpacing(true);
    formAsset2.setSpacing(true);
    formAsset4.setSpacing(true);

    formAsset1.addComponent(tfCustomerName);
    formAsset1.addComponent(tfLandMark);
    formAsset1.addComponent(slPropertyDesc);
    formAsset2.addComponent(tfCustomerAddr);
    formAsset3.addComponent(tfPropertyAddress);
    formAsset3.addComponent(chkSameAddress);
    formAsset4.addComponent(tfDynamicAsset1);
    formAsset4.addComponent(tfDynamicAsset2);
    tfDynamicAsset1.setVisible(false);
    tfDynamicAsset2.setVisible(false);

    chkSameAddress.setImmediate(true);
    chkSameAddress.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {

            if (chkSameAddress.getValue().equals(true)) {
                tfPropertyAddress.setValue(tfCustomerAddr.getValue());

            } else {
                tfPropertyAddress.setValue("");
            }
        }
    });

    layoutAssetDetails1.setSpacing(true);
    layoutAssetDetails1.setColumns(4);
    layoutAssetDetails1.addComponent(formAsset1);
    layoutAssetDetails1.addComponent(formAsset2);
    layoutAssetDetails1.addComponent(formAsset3);
    layoutAssetDetails1.addComponent(formAsset4);
    layoutAssetDetails1.setMargin(true);

    layoutAssetDetails.addComponent(btnDynamicAsset);
    layoutAssetDetails.setComponentAlignment(btnDynamicAsset, Alignment.TOP_RIGHT);
    layoutAssetDetails.addComponent(layoutAssetDetails1);

    lblHeading = new Label("Owner Details");
    layoutAssetOwner.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutAssetOwner.addComponent(PanelGenerator.createPanel(layoutOwnerDetails));
    lblHeading = new Label("Asset Details");
    layoutAssetOwner.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutAssetOwner.addComponent(PanelGenerator.createPanel(layoutAssetDetails));

    // for Owner Details
    layoutOwnerDetails.addComponent(btnAddOwner);
    layoutOwnerDetails.setComponentAlignment(btnAddOwner, Alignment.TOP_RIGHT);
    layoutOwnerDetails1.setColumns(4);
    layoutOwnerDetails1.addComponent(new ComponentIterOwnerDetails("", ""));
    layoutOwnerDetails.addComponent(layoutOwnerDetails1);
    layoutOwnerDetails1.setSpacing(true);
    layoutOwnerDetails1.setMargin(true);

    // for document details
    panelNormalDocumentDetails.addComponent(btnAddNorDoc);
    panelNormalDocumentDetails.setComponentAlignment(btnAddNorDoc, Alignment.TOP_RIGHT);
    panelNormalDocumentDetails.addComponent(new ComponentIteratorNormlDoc(null, null, "", ""));
    panelNormalDocumentDetails.setMargin(true);
    panelLegalDocumentDetails.addComponent(btnAddLegalDoc);
    panelLegalDocumentDetails.setComponentAlignment(btnAddLegalDoc, Alignment.TOP_RIGHT);
    panelLegalDocumentDetails.addComponent(new ComponentIteratorLegalDoc("", "", null));
    panelLegalDocumentDetails.setMargin(true);
    layoutNormalLegal.addComponent(PanelGenerator.createPanel(panelNormalDocumentDetails));
    lblHeading = new Label("Legal Documents");
    layoutNormalLegal.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutNormalLegal.addComponent(PanelGenerator.createPanel(panelLegalDocumentDetails));
    layoutNormalLegal.setMargin(true);
    panelNormalDocumentDetails.setWidth("100%");
    panelLegalDocumentDetails.setWidth("100%");

    // for adjoin properties
    panelAdjoinProperties.addComponent(btnAddAdjoinProperty);
    panelAdjoinProperties.setComponentAlignment(btnAddAdjoinProperty, Alignment.BOTTOM_RIGHT);
    panelAdjoinProperties.addComponent(new ComponentIteratorAdjoinProperty(null, true, true, true));

    // for dimensions
    panelDimension.addComponent(btnAddDimension);
    panelDimension.setComponentAlignment(btnAddDimension, Alignment.BOTTOM_RIGHT);
    panelDimension.addComponent(new ComponentIterDimensionofPlot(null, true, true, true));

    // for description of the property
    layoutDescProperty.setMargin(true);
    layoutDescProperty1.setSpacing(true);
    layoutDescProperty1.setColumns(4);
    layoutDescProperty.addComponent(btnDynamicDescProp);
    layoutDescProperty.setComponentAlignment(btnDynamicDescProp, Alignment.TOP_RIGHT);
    layoutDescProperty1.addComponent(tfSiteNumber);
    layoutDescProperty1.addComponent(tfSFNumber);
    layoutDescProperty1.addComponent(tfNewSFNumber);
    layoutDescProperty1.addComponent(tfVillage);
    layoutDescProperty1.addComponent(tfTaluk);
    layoutDescProperty1.addComponent(tfDistCorpPanc);
    layoutDescProperty1.addComponent(tfLocationSketch);
    layoutDescProperty1.addComponent(tfProTaxReceipt);
    layoutDescProperty1.addComponent(tfElecServiceConnNo);
    layoutDescProperty1.addComponent(tfElecConnecName);
    layoutDescProperty1.addComponent(slHighMiddPoor);
    layoutDescProperty1.addComponent(slUrbanSemiRural);
    layoutDescProperty1.addComponent(slResiIndustCommer);
    layoutDescProperty1.addComponent(slProOccupiedBy);
    layoutDescProperty1.addComponent(tfMonthlyRent);
    layoutDescProperty1.addComponent(tfCoverUnderStatCentral);
    layoutDescProperty1.addComponent(tfAnyConversionLand);
    layoutDescProperty1.addComponent(tfExtentSite);
    layoutDescProperty1.addComponent(tfYearAcquistion);
    layoutDescProperty1.addComponent(tfPurchaseValue);
    layoutDescProperty1.addComponent(tfPropLandmark);
    layoutDescProperty1.addComponent(tfPostalAddress);
    layoutDescProperty1.addComponent(tfDynamicDescProp1);
    layoutDescProperty1.addComponent(tfDynamicDescProp2);
    layoutDescProperty.addComponent(layoutDescProperty1);
    tfDynamicDescProp1.setVisible(false);
    tfDynamicDescProp2.setVisible(false);
    // for charcteristiccs of the site
    layoutCharcterSite1.setSpacing(true);
    layoutCharcterSite1.setColumns(4);
    layoutCharcterSite.setMargin(true);
    layoutCharcterSite.addComponent(btnDynamicCharacter);
    layoutCharcterSite.setComponentAlignment(btnDynamicCharacter, Alignment.TOP_RIGHT);
    layoutCharcterSite1.addComponent(slLocalClass);
    layoutCharcterSite1.addComponent(slSurroundDevelop);
    layoutCharcterSite1.addComponent(tfFlood);
    layoutCharcterSite1.addComponent(slFeasibility);
    layoutCharcterSite1.addComponent(slLandLevel);
    layoutCharcterSite1.addComponent(slLandShape);
    layoutCharcterSite1.addComponent(slTypeUse);
    layoutCharcterSite1.addComponent(tfUsageRestriction);
    layoutCharcterSite1.addComponent(slIsPlot);
    layoutCharcterSite1.addComponent(tfApprveNo);
    layoutCharcterSite1.addComponent(tfNoReason);
    layoutCharcterSite1.addComponent(tfSubdivide);
    layoutCharcterSite1.addComponent(slDrawApproval);
    layoutCharcterSite1.addComponent(slCornerInter);
    layoutCharcterSite1.addComponent(slRoadFacility);
    layoutCharcterSite1.addComponent(slTypeRoad);
    layoutCharcterSite1.addComponent(slRoadWidth);
    layoutCharcterSite1.addComponent(slLandLock);
    layoutCharcterSite1.addComponent(slWaterPotential);
    layoutCharcterSite1.addComponent(slUnderSewerage);
    layoutCharcterSite1.addComponent(slPowerSupply);
    layoutCharcterSite1.addComponent(tfAdvantageSite);
    layoutCharcterSite1.addComponent(tfDisadvantageSite);
    layoutCharcterSite1.addComponent(tfGeneralRemarks);
    layoutCharcterSite1.addComponent(tfDynamicCharacter1);
    layoutCharcterSite1.addComponent(tfDynamicCharacter2);
    layoutCharcterSite.addComponent(layoutCharcterSite1);
    tfDynamicCharacter1.setVisible(false);
    tfDynamicCharacter2.setVisible(false);

    // details of apartment building
    layoutApartmentBuilding1.setColumns(4);
    layoutApartmentBuilding1.addComponent(slNatureofApartment);
    layoutApartmentBuilding1.addComponent(tfNameofApartment);
    layoutApartmentBuilding1.addComponent(tfApartmant);
    layoutApartmentBuilding1.addComponent(tfFlatNumber);
    layoutApartmentBuilding1.addComponent(tfFloor);
    layoutApartmentBuilding1.addComponent(tfSFNumberLoc);
    layoutApartmentBuilding1.addComponent(tfNewSFNumberLoc);
    layoutApartmentBuilding1.addComponent(tfVillageLoc);
    layoutApartmentBuilding1.addComponent(tfTalukLoc);
    layoutApartmentBuilding1.addComponent(tfDisrictLoc);
    layoutApartmentBuilding1.addComponent(slDescriptionofLocality);
    layoutApartmentBuilding1.addComponent(tfNoofFloors);
    layoutApartmentBuilding1.addComponent(slTypeofStructure);
    layoutApartmentBuilding1.addComponent(tfNumberofFlats);
    layoutAddress.addComponent(tfPostalAddressLoc);
    layoutAddress.addComponent(chkSamePostelAddress);
    layoutApartmentBuilding1.addComponent(layoutAddress);
    layoutApartmentBuilding1.addComponent(tfDynamicApartment1);
    layoutApartmentBuilding1.addComponent(tfDynamicApartment2);
    layoutApartmentBuilding1.setSpacing(true);
    tfDynamicApartment1.setVisible(false);
    tfDynamicApartment2.setVisible(false);
    layoutApartmentBuilding1.setMargin(true);
    chkSamePostelAddress.setImmediate(true);
    chkSamePostelAddress.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {

            if (chkSamePostelAddress.getValue().equals(true)) {
                tfPostalAddress.setValue(tfPropertyAddress.getValue());

            } else {
                tfPostalAddress.setValue("");
            }
        }
    });

    // flat under valuation
    layoutFlatValuation1.setColumns(4);
    layoutFlatValuation1.addComponent(tfFlatisSituated);
    layoutFlatValuation1.addComponent(tfDynamicFlatValuation1);
    layoutFlatValuation1.addComponent(tfDynamicFlatValuation2);
    tfDynamicFlatValuation1.setVisible(false);
    tfDynamicFlatValuation2.setVisible(false);
    layoutFlatValuation1.setSpacing(true);
    layoutFlatValuation1.setMargin(true);

    layoutFlatValuation.addComponent(btnDynamicFlatValuation);
    layoutFlatValuation.setComponentAlignment(btnDynamicFlatValuation, Alignment.TOP_RIGHT);
    layoutFlatValuation.addComponent(layoutFlatValuation1);

    // for details of plan approval
    layoutPlanApproval1.setColumns(2);
    FormLayout lay1 = new FormLayout();
    FormLayout lay2 = new FormLayout();
    lay1.addComponent(tfLandandBuilding);
    lay1.addComponent(tfPlanApprovedBy);
    lay1.addComponent(dfLicenseFrom);
    lay1.addComponent(slIsLicenceForced);
    lay2.addComponent(tfDynamicPlanApproval2);

    lay2.addComponent(slAllApprovalRecved);
    lay2.addComponent(slConstAsperAppPlan);
    lay2.addComponent(tfReason);
    lay2.addComponent(tfDynamicPlanApproval1);
    tfDynamicPlanApproval1.setVisible(false);
    tfDynamicPlanApproval2.setVisible(false);
    lay1.setSpacing(true);
    lay2.setSpacing(true);
    layoutPlanApproval1.addComponent(lay1);
    layoutPlanApproval1.addComponent(lay2);
    layoutPlanApproval1.setSpacing(true);
    layoutPlanApproval1.setMargin(true);
    layoutPlanApproval.addComponent(btnDynamicPlanApproval);
    layoutPlanApproval.setComponentAlignment(btnDynamicPlanApproval, Alignment.TOP_RIGHT);
    layoutPlanApproval.addComponent(layoutPlanApproval1);

    // for Build Specification
    panelBuildSpecfication.addComponent(btnAddBuildSpec);
    panelBuildSpecfication.setComponentAlignment(btnAddBuildSpec, Alignment.BOTTOM_RIGHT);
    panelBuildSpecfication.addComponent(new ComponentIterBuildingSpecfication(null, true, true, true));
    panelBuildSpecfication.setWidth("100%");

    // for
    layoutApartmentBuilding.addComponent(btnDynamicApartment);
    layoutApartmentBuilding.setComponentAlignment(btnDynamicApartment, Alignment.TOP_RIGHT);
    layoutApartmentBuilding.addComponent(layoutApartmentBuilding1);

    // valuation of land
    layoutValuationConst.setSpacing(true);
    layoutValuationConst1.setSpacing(true);
    layoutValuationConst1.addComponent(tfUndividedShare);
    layoutValuationConst1.addComponent(tfSuperBuiltupArea);
    layoutValuationConst1.addComponent(tfCostofApartment);
    layoutValuationConst1.addComponent(tfRateofApartment);
    layoutValuationConst1.addComponent(slIsRateReasonable);
    layoutValuationConst1.addComponent(tfStageOfConstruction);
    layoutValuationConst1.addComponent(tfCostOfConstAsAtSite);
    layoutValuationConst1.addComponent(tfCostOfConstAsPerAgree);

    layoutValuationConst1.addComponent(tfDynamicConstValuation1);
    layoutValuationConst1.addComponent(tfDynamicConstValuation2);
    tfDynamicConstValuation1.setVisible(false);
    tfDynamicConstValuation2.setVisible(false);

    layoutValuationConst.addComponent(btnDynamicConstValuation);
    layoutValuationConst.setComponentAlignment(btnDynamicConstValuation, Alignment.TOP_RIGHT);
    layoutValuationConst.addComponent(layoutValuationConst1);
    layoutValuationConst1.setMargin(true);

    // for plinth area
    layoutPlintharea.addComponent(btnAddPlinth);
    layoutPlintharea.setComponentAlignment(btnAddPlinth, Alignment.BOTTOM_RIGHT);
    layoutPlintharea.setMargin(true);
    layoutPlintharea.addComponent(new ComponentIterPlinthArea("Ground Floor", "", ""));
    layoutPlintharea.addComponent(new ComponentIterPlinthArea("Portico and Stair", "", ""));
    // for flat1
    layoutForFlats.setMargin(true);
    layoutForFlats.setSpacing(true);
    layoutForFlats1.setSpacing(true);
    layoutForFlats.addComponent(btnDynamicForFlat);
    layoutForFlats.setComponentAlignment(btnDynamicForFlat, Alignment.TOP_RIGHT);
    layoutForFlats1.addComponent(slUndivideShare);
    layoutForFlats1.addComponent(tfUDSproportion);
    layoutForFlats1.addComponent(tfUDSArea);
    layoutForFlats1.addComponent(tfFlatsApproved);
    layoutForFlats1.addComponent(tfFlatsWorkplan);
    layoutForFlats1.addComponent(slUnderPermissable);
    layoutForFlats1.addComponent(lblFloorIndex);
    layoutForFlats1.addComponent(tfIndexPlan);
    layoutForFlats1.addComponent(tfIndexSite);
    layoutForFlats1.addComponent(tfIndexCalculation);
    layoutForFlats1.addComponent(tfDynamicForFlat1);
    layoutForFlats1.addComponent(tfDynamicForFlat2);
    tfDynamicForFlat1.setVisible(false);
    tfDynamicForFlat2.setVisible(false);
    layoutForFlats.addComponent(layoutForFlats1);

    // add components in main panel
    accordion.setWidth("100%");
    layoutEvaluationDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutEvaluationDetails), "Evaluation Details");

    layoutOwnerDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutAssetOwner), "Owner Details/Asset Details");
    layoutAssetDetails.setStyleName("bluebar");

    layoutNormalLegal.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutNormalLegal), "Document Details");

    panelAdjoinProperties.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(panelAdjoinProperties), "Adjoining Properties");
    panelDimension.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(panelDimension), "Dimension");

    layoutDescProperty.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutDescProperty), "Description of the property");
    layoutCharcterSite.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutCharcterSite), "Characteristics of the site");
    layoutApartmentBuilding.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutApartmentBuilding),
            "Details of Apartment Building-Under Construction");
    layoutFlatValuation.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutFlatValuation), "Flat Under Valuation");
    layoutPlanApproval.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPlanApproval), "Details of Plan Approval");
    panelBuildSpecfication.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(panelBuildSpecfication), "Specification");
    layoutValuationConst.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutValuationConst), "Valuation of Land");
    layoutPlintharea.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPlintharea), "Plinth Area Details");

    layoutForFlats.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutForFlats), "For Flats");

    layoutMainForm.addComponent(PanelGenerator.createPanel(accordion));

    mainPanel.addComponent(layoutMainForm);
    mainPanel.addComponent(layoutButton2);
    mainPanel.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);
    mainPanel.setVisible(false);

    layoutMainForm.setMargin(true);
    layoutMainForm.setSpacing(true);
    // for main panel
    layoutButton2.setSpacing(true);
    btnSave.setStyleName("savebt");
    btnCancel.setStyleName("cancelbt");
    btnSubmit.setStyleName("submitbt");
    //      saveExcel.addStyleName("downloadbt");
    btnSave.setVisible(false);
    btnSubmit.setVisible(false);
    btnCancel.setVisible(false);
    //saveExcel.setVisible(false);
    layoutButton2.addComponent(btnSave);
    layoutButton2.addComponent(btnSubmit);
    //layoutButton2.addComponent(saveExcel);
    layoutButton2.addComponent(btnCancel);
    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);

    // Initaited the Label Function here by Hohul
    lblTableTitle = new Label();
    lblSaveNotification = new Label();
    lblSaveNotification.setContentMode(ContentMode.HTML);
    lblNotificationIcon = new Label();
    lblTableTitle.setValue("<B>&nbsp;&nbsp;Action:</B>");
    lblTableTitle.setContentMode(ContentMode.HTML);
    lblFormTittle = new Label();
    lblFormTittle.setContentMode(ContentMode.HTML);
    lblFormTittle.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;Home");
    lblFormTitle1 = new Label();
    lblFormTitle1.setContentMode(ContentMode.HTML);
    lblFormTitle1.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;");
    lblAddEdit = new Label();
    lblAddEdit.setContentMode(ContentMode.HTML);

    // Button Back declaration by Hohul
    btnBack = new Button("Home", this);
    btnBack.setStyleName("link");

    // Bread Scrumbs initiated here by Hohul

    hlBreadCrumbs = new HorizontalLayout();
    hlBreadCrumbs.addComponent(lblFormTitle1);
    hlBreadCrumbs.addComponent(btnBack);
    hlBreadCrumbs.setComponentAlignment(btnBack, Alignment.TOP_CENTER);
    hlBreadCrumbs.addComponent(lblAddEdit);
    hlBreadCrumbs.setComponentAlignment(lblAddEdit, Alignment.MIDDLE_CENTER);
    hlBreadCrumbs.setVisible(false);

    /*String basepath = VaadinService.getCurrent().getBaseDirectory()
    .getAbsolutePath();
    Resource res = new FileResource(new File(basepath
    + "/WEB-INF/view/channel.doc"));
    FileDownloader fd = new FileDownloader(res);
    fd.extend(saveExcel);*/

    // for search panel
    // for search panel
    // Added by Hohul ----->  For Search Panel Layouts
    FormLayout flSearchEvalNumber = new FormLayout();
    flSearchEvalNumber.addComponent(tfSearchEvalNumber);

    FormLayout flSearchBankbranch = new FormLayout();
    flSearchBankbranch.addComponent(slSearchBankbranch);

    FormLayout flSearchCustomer = new FormLayout();
    flSearchCustomer.addComponent(tfSearchCustomer);

    HorizontalLayout hlSearchComponentLayout = new HorizontalLayout();
    hlSearchComponentLayout.addComponent(flSearchEvalNumber);
    hlSearchComponentLayout.addComponent(flSearchBankbranch);
    hlSearchComponentLayout.addComponent(flSearchCustomer);
    hlSearchComponentLayout.setSpacing(true);
    hlSearchComponentLayout.setMargin(true);

    //Initialization and properties for btnDownload      
    btnDownload = new Button("Download");
    //btnDownload.setDescription("Download");
    btnDownload.addStyleName("downloadbt");
    btnDownload.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            //  UI.getCurrent()..clearDashboardButtonBadge();
            event.getButton().removeStyleName("unread");
            if (notifications != null && notifications.getUI() != null)
                notifications.close();
            else {
                buildNotifications(event);
                UI.getCurrent().addWindow(notifications);
                notifications.focus();
                ((VerticalLayout) UI.getCurrent().getContent())
                        .addLayoutClickListener(new LayoutClickListener() {
                            @Override
                            public void layoutClick(LayoutClickEvent event) {
                                notifications.close();
                                ((VerticalLayout) UI.getCurrent().getContent()).removeLayoutClickListener(this);
                            }
                        });
            }

        }
    });

    hlFileDownloadLayout = new HorizontalLayout();
    hlFileDownloadLayout.setSpacing(true);
    hlFileDownloadLayout.addComponent(btnDownload);
    hlFileDownloadLayout.setComponentAlignment(btnDownload, Alignment.MIDDLE_CENTER);

    VerticalLayout vlSearchandResetButtonLAyout = new VerticalLayout();
    vlSearchandResetButtonLAyout.setSpacing(true);
    vlSearchandResetButtonLAyout.addComponent(btnReset);
    vlSearchandResetButtonLAyout.setWidth("100");
    vlSearchandResetButtonLAyout.addStyleName("topbarthree");
    vlSearchandResetButtonLAyout.setMargin(true);

    HorizontalLayout hlSearchComponentandButtonLayout = new HorizontalLayout();
    hlSearchComponentandButtonLayout.setSizeFull();
    hlSearchComponentandButtonLayout.setSpacing(true);
    hlSearchComponentandButtonLayout.addComponent(hlSearchComponentLayout);
    hlSearchComponentandButtonLayout.setComponentAlignment(hlSearchComponentLayout, Alignment.MIDDLE_LEFT);
    hlSearchComponentandButtonLayout.addComponent(vlSearchandResetButtonLAyout);
    hlSearchComponentandButtonLayout.setComponentAlignment(vlSearchandResetButtonLAyout,
            Alignment.MIDDLE_RIGHT);
    hlSearchComponentandButtonLayout.setExpandRatio(vlSearchandResetButtonLAyout, 1);
    final VerticalLayout vlSearchComponentandButtonLayout = new VerticalLayout();
    vlSearchComponentandButtonLayout.setSpacing(true);
    vlSearchComponentandButtonLayout.setSizeFull();
    vlSearchComponentandButtonLayout.addComponent(hlSearchComponentandButtonLayout);

    /*layoutSearch.addComponent(tfSearchEvalNumber);
    layoutSearch.addComponent(slSearchBankbranch);
    layoutSearch.addComponent(tfSearchCustomer);
    layoutSearch.addComponent(btnReset);
    layoutSearch.setComponentAlignment(btnReset, Alignment.BOTTOM_LEFT);
    btnSearch.addStyleName("default");*/
    btnReset.addStyleName("resetbt");

    tfSearchEvalNumber.setImmediate(true);
    tfSearchEvalNumber.addListener(new TextChangeListener() {
        private static final long serialVersionUID = 1L;
        SimpleStringFilter filter = null;

        @Override
        public void textChange(TextChangeEvent event) {
            // TODO Auto-generated method stub
            Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
            if (filter != null)
                f.removeContainerFilter(filter);
            filter = new SimpleStringFilter("evalNo", event.getText(), true, false);
            f.addContainerFilter(filter);
            total = f.size();
            tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
        }

    });
    tfSearchCustomer.setImmediate(true);
    tfSearchCustomer.addListener(new TextChangeListener() {
        private static final long serialVersionUID = 1L;
        SimpleStringFilter filter = null;

        public void textChange(TextChangeEvent event) {
            Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
            if (filter != null)
                f.removeContainerFilter(filter);

            filter = new SimpleStringFilter("custName", event.getText(), true, false);

            f.addContainerFilter(filter);
            total = f.size();
            tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
        }
    });
    slSearchBankbranch.setImmediate(true);
    slSearchBankbranch.addValueChangeListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;
        Filter filter = null;

        @Override
        public void valueChange(ValueChangeEvent event) {
            // TODO Auto-generated method stub

            try {
                String strBankBranch = slSearchBankbranch.getValue().toString();
                Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
                if (filter != null)
                    f.removeContainerFilter(filter);

                filter = new Compare.Equal("bankBranch", strBankBranch);
                f.addContainerFilter(filter);
                f.addContainerFilter(filter);
                total = f.size();
                tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
            } catch (Exception e) {
                e.printStackTrace();
                e.printStackTrace();
            }
        }

    });
    searchPanel.addComponent(PanelGenerator.createPanel(vlSearchComponentandButtonLayout));
    searchPanel.setMargin(true);
    // Add Layout table panel by Hohul

    HorizontalLayout flTableCaption = new HorizontalLayout();
    flTableCaption.addComponent(lblTableTitle);
    flTableCaption.setComponentAlignment(lblTableTitle, Alignment.MIDDLE_CENTER);
    flTableCaption.addStyleName("lightgray");
    flTableCaption.setHeight("25px");
    flTableCaption.setWidth("60px");
    lblNoofRecords = new Label(" ", ContentMode.HTML);
    lblNoofRecords.addStyleName("lblfooter");
    HorizontalLayout hlTableTittleLayout = new HorizontalLayout();
    hlTableTittleLayout.addComponent(flTableCaption);
    hlTableTittleLayout.addComponent(btnAdd);
    hlTableTittleLayout.addComponent(btnEdit);
    hlTableTittleLayout.addComponent(btnView);
    hlTableTittleLayout.setHeight("25px");
    hlTableTittleLayout.setSpacing(true);

    HorizontalLayout hlTableTitleandCaptionLayout = new HorizontalLayout();
    hlTableTitleandCaptionLayout.addStyleName("topbarthree");
    hlTableTitleandCaptionLayout.setWidth("100%");
    hlTableTitleandCaptionLayout.addComponent(hlTableTittleLayout);
    hlTableTitleandCaptionLayout.addComponent(hlFileDownloadLayout);
    hlTableTitleandCaptionLayout.setComponentAlignment(hlFileDownloadLayout, Alignment.MIDDLE_RIGHT);
    hlTableTitleandCaptionLayout.setHeight("28px");

    // for table panel
    btnAdd.addStyleName("add");
    btnEdit.addStyleName("editbt");
    btnView.addStyleName("view");
    btnView.setEnabled(false);

    hlAddEditLayout.addStyleName("topbarthree");
    hlAddEditLayout.setWidth("100%");
    hlAddEditLayout.addComponent(hlTableTitleandCaptionLayout);
    hlAddEditLayout.setHeight("28px");

    // Added Action Label to Table

    layoutTable.addComponent(hlAddEditLayout);
    layoutTable.setComponentAlignment(hlAddEditLayout, Alignment.TOP_LEFT);
    layoutTable.addComponent(tblEvalDetails);

    tablePanel.addComponent(layoutTable);
    ;
    tablePanel.setWidth("100%");
    tablePanel.setMargin(true);

    layoutPage.addComponent(mainPanel);
    layoutPage.addComponent(searchPanel);
    layoutPage.addComponent(tablePanel);

    // Added labels and titles to respective Location by Hohul

    HorizontalLayout hlNotificationLayout = new HorizontalLayout();
    hlNotificationLayout.addComponent(lblNotificationIcon);
    hlNotificationLayout.setComponentAlignment(lblNotificationIcon, Alignment.MIDDLE_LEFT);
    hlNotificationLayout.addComponent(lblSaveNotification);
    hlNotificationLayout.setComponentAlignment(lblSaveNotification, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(lblFormTittle);
    hlHeaderLayout.setComponentAlignment(lblFormTittle, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(hlBreadCrumbs);
    hlHeaderLayout.setComponentAlignment(hlBreadCrumbs, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(hlNotificationLayout);
    hlHeaderLayout.setComponentAlignment(hlNotificationLayout, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.MIDDLE_RIGHT);

    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);

    // load Component list values
    loadComponentListValues();

    //setTableProperties();
    populateAndConfig(false);

}

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

@SuppressWarnings("deprecation")
void buildView(VerticalLayout layoutPage, HorizontalLayout hlHeaderLayout) {
    // for component width
    hlHeaderLayout.removeAllComponents();
    setComponentStyle();// ww w  .jav a 2  s .  c  o  m

    tblEvalDetails = new Table();
    tblEvalDetails.setStyleName(Runo.TABLE_SMALL);
    tblEvalDetails.setPageLength(14);
    tblEvalDetails.setSizeFull();
    tblEvalDetails.setFooterVisible(true);
    tblEvalDetails.setSelectable(true);
    tblEvalDetails.setImmediate(true);
    tblEvalDetails.setColumnCollapsingAllowed(true);

    // for evaluation details
    tfEvaluationPurpose.setValue("Collateral Security to the Bank");
    tfEvaluationNumber.setRequired(true);
    slBankBranch.setRequired(true);
    dfDateofValuation.setRequired(true);
    tfEvaluationPurpose.setRequired(true);
    layoutEvaluationDetails1.setColumns(4);

    layoutEvaluationDetails1.addComponent(tfEvaluationNumber);
    layoutEvaluationDetails1.addComponent(slBankBranch);
    layoutEvaluationDetails1.addComponent(tfEvaluationPurpose);
    layoutEvaluationDetails1.addComponent(tfValuatedBy);
    layoutEvaluationDetails1.addComponent(dfDateofValuation);
    layoutEvaluationDetails1.addComponent(dfVerifiedDate);
    layoutEvaluationDetails1.addComponent(tfVerifiedBy);
    layoutEvaluationDetails1.addComponent(tfDynamicEvaluation1);
    layoutEvaluationDetails1.addComponent(tfDynamicEvaluation2);
    tfDynamicEvaluation1.setVisible(false);
    tfDynamicEvaluation2.setVisible(false);
    layoutEvaluationDetails1.setSpacing(true);
    layoutEvaluationDetails1.setMargin(true);

    layoutEvaluationDetails.addComponent(btnDynamicEvaluation1);
    layoutEvaluationDetails.setComponentAlignment(btnDynamicEvaluation1, Alignment.TOP_RIGHT);
    layoutEvaluationDetails.addComponent(layoutEvaluationDetails1);
    // for Owner Details
    layoutOwnerDetails.addComponent(btnAddOwner);
    layoutOwnerDetails.setComponentAlignment(btnAddOwner, Alignment.TOP_RIGHT);
    layoutOwnerDetails1.setColumns(4);
    layoutOwnerDetails1.addComponent(new ComponentIterOwnerDetails("", ""));
    layoutOwnerDetails.addComponent(layoutOwnerDetails1);
    layoutOwnerDetails1.setSpacing(true);
    layoutOwnerDetails1.setMargin(true);
    // for asset details
    VerticalLayout formAsset1 = new VerticalLayout();
    VerticalLayout formAsset2 = new VerticalLayout();
    VerticalLayout formAsset3 = new VerticalLayout();
    VerticalLayout formAsset4 = new VerticalLayout();
    formAsset1.setSpacing(true);
    formAsset2.setSpacing(true);
    formAsset4.setSpacing(true);
    formAsset1.addComponent(tfCustomerName);
    formAsset1.addComponent(tfLandMark);
    formAsset1.addComponent(slPropertyDesc);
    formAsset2.addComponent(tfCustomerAddr);
    formAsset3.addComponent(tfPropertyAddress);
    formAsset3.addComponent(chkSameAddress);
    formAsset4.addComponent(tfDynamicAsset1);
    formAsset4.addComponent(tfDynamicAsset2);
    tfDynamicAsset1.setVisible(false);
    tfDynamicAsset2.setVisible(false);
    chkSameAddress.setImmediate(true);
    chkSameAddress.addValueChangeListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {

            if (chkSameAddress.getValue().equals(true)) {
                tfPropertyAddress.setValue(tfCustomerAddr.getValue());

            } else {
                tfPropertyAddress.setValue("");
            }
        }
    });
    layoutAssetDetails1.setSpacing(true);
    layoutAssetDetails1.setColumns(4);
    layoutAssetDetails1.addComponent(formAsset1);
    layoutAssetDetails1.addComponent(formAsset2);
    layoutAssetDetails1.addComponent(formAsset3);
    layoutAssetDetails1.addComponent(formAsset4);
    layoutAssetDetails1.setMargin(true);
    layoutAssetDetails.addComponent(btnDynamicAsset);
    layoutAssetDetails.setComponentAlignment(btnDynamicAsset, Alignment.TOP_RIGHT);
    layoutAssetDetails.addComponent(layoutAssetDetails1);

    lblHeading = new Label("Owner Details");
    layoutAssetOwner.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutAssetOwner.addComponent(PanelGenerator.createPanel(layoutOwnerDetails));

    lblHeading = new Label("Asset Details");
    layoutAssetOwner.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutAssetOwner.addComponent(PanelGenerator.createPanel(layoutAssetDetails));
    // for document details
    panelNormalDocumentDetails.addComponent(btnAddNorDoc);
    panelNormalDocumentDetails.setComponentAlignment(btnAddNorDoc, Alignment.TOP_RIGHT);
    panelNormalDocumentDetails.addComponent(new ComponentIteratorNormlDoc(null, null, "", ""));
    panelNormalDocumentDetails.setMargin(true);
    panelLegalDocumentDetails.addComponent(btnAddLegalDoc);
    panelLegalDocumentDetails.setComponentAlignment(btnAddLegalDoc, Alignment.TOP_RIGHT);
    panelLegalDocumentDetails.addComponent(new ComponentIteratorLegalDoc("", "", null));
    panelLegalDocumentDetails.setMargin(true);
    layoutNormalLegal.addComponent(PanelGenerator.createPanel(panelNormalDocumentDetails));
    lblHeading = new Label("Legal Documents");
    layoutNormalLegal.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutNormalLegal.addComponent(PanelGenerator.createPanel(panelLegalDocumentDetails));
    layoutNormalLegal.setMargin(true);
    panelNormalDocumentDetails.setWidth("100%");
    panelLegalDocumentDetails.setWidth("100%");

    // for adjoin properties
    panelAdjoinProperties.addComponent(btnAddAdjoinProperty);
    panelAdjoinProperties.setComponentAlignment(btnAddAdjoinProperty, Alignment.BOTTOM_RIGHT);
    panelAdjoinProperties.addComponent(new ComponentIteratorAdjoinProperty(null, true, true, true));

    // for dimensions
    panelDimension.addComponent(btnAddDimension);
    panelDimension.setComponentAlignment(btnAddDimension, Alignment.BOTTOM_RIGHT);
    panelDimension.addComponent(new ComponentIterDimensionofPlot(null, true, true, true));

    // for description of the property
    layoutDescProperty.setMargin(true);
    layoutDescProperty1.setSpacing(true);
    layoutDescProperty1.setColumns(4);
    layoutDescProperty.addComponent(btnDynamicDescProp);
    layoutDescProperty.setComponentAlignment(btnDynamicDescProp, Alignment.TOP_RIGHT);
    layoutDescProperty1.addComponent(tfSiteNumber);
    layoutDescProperty1.addComponent(tfSFNumber);
    layoutDescProperty1.addComponent(tfNewSFNumber);
    layoutDescProperty1.addComponent(tfVillage);
    layoutDescProperty1.addComponent(tfTaluk);
    layoutDescProperty1.addComponent(tfDistCorpPanc);
    layoutDescProperty1.addComponent(tfLocationSketch);
    layoutDescProperty1.addComponent(tfProTaxReceipt);
    layoutDescProperty1.addComponent(tfElecServiceConnNo);
    layoutDescProperty1.addComponent(tfElecConnecName);
    layoutDescProperty1.addComponent(slHighMiddPoor);
    layoutDescProperty1.addComponent(slUrbanSemiRural);
    layoutDescProperty1.addComponent(slResiIndustCommer);
    layoutDescProperty1.addComponent(slProOccupiedBy);
    layoutDescProperty1.addComponent(tfMonthlyRent);
    layoutDescProperty1.addComponent(tfCoverUnderStatCentral);
    layoutDescProperty1.addComponent(tfAnyConversionLand);
    layoutDescProperty1.addComponent(tfExtentSite);
    layoutDescProperty1.addComponent(tfYearAcquistion);
    layoutDescProperty1.addComponent(tfPurchaseValue);
    layoutDescProperty1.addComponent(tfPropLandmark);
    layoutDescProperty1.addComponent(tfPostalAddress);
    layoutDescProperty1.addComponent(tfDynamicDescProp1);
    layoutDescProperty1.addComponent(tfDynamicDescProp2);
    layoutDescProperty.addComponent(layoutDescProperty1);
    tfDynamicDescProp1.setVisible(false);
    tfDynamicDescProp2.setVisible(false);
    // for charcteristiccs of the site
    layoutCharcterSite1.setSpacing(true);
    layoutCharcterSite1.setColumns(4);
    layoutCharcterSite1.setMargin(true);
    layoutCharcterSite.setMargin(true);
    layoutCharcterSite.setSpacing(true);
    layoutCharcterSite.addComponent(btnDynamicCharacter);
    layoutCharcterSite.setComponentAlignment(btnDynamicCharacter, Alignment.TOP_RIGHT);
    layoutCharcterSite1.addComponent(slLocalClass);
    layoutCharcterSite1.addComponent(slSurroundDevelop);
    layoutCharcterSite1.addComponent(tfFlood);
    layoutCharcterSite1.addComponent(slFeasibility);
    layoutCharcterSite1.addComponent(slLandLevel);
    layoutCharcterSite1.addComponent(slLandShape);
    layoutCharcterSite1.addComponent(slTypeUse);
    layoutCharcterSite1.addComponent(tfUsageRestriction);
    layoutCharcterSite1.addComponent(slIsPlot);
    layoutCharcterSite1.addComponent(tfApprveNo);
    layoutCharcterSite1.addComponent(tfNoReason);
    layoutCharcterSite1.addComponent(tfSubdivide);
    layoutCharcterSite1.addComponent(slDrawApproval);
    layoutCharcterSite1.addComponent(slCornerInter);
    layoutCharcterSite1.addComponent(slRoadFacility);
    layoutCharcterSite1.addComponent(slTypeRoad);
    layoutCharcterSite1.addComponent(slRoadWidth);
    layoutCharcterSite1.addComponent(slLandLock);
    layoutCharcterSite1.addComponent(slWaterPotential);
    layoutCharcterSite1.addComponent(slUnderSewerage);
    layoutCharcterSite1.addComponent(slPowerSupply);
    layoutCharcterSite1.addComponent(tfAdvantageSite);
    layoutCharcterSite1.addComponent(tfDisadvantageSite);
    layoutCharcterSite1.addComponent(tfGeneralRemarks);
    layoutCharcterSite1.addComponent(tfDynamicCharacter1);
    layoutCharcterSite1.addComponent(tfDynamicCharacter2);
    layoutCharcterSite.addComponent(layoutCharcterSite1);
    tfDynamicCharacter1.setVisible(false);
    tfDynamicCharacter2.setVisible(false);

    // for details of plan approval
    layoutPlanApproval1.setColumns(2);
    FormLayout lay1 = new FormLayout();
    FormLayout lay2 = new FormLayout();
    lay1.addComponent(tfLandandBuilding);
    lay1.addComponent(tfPlanApprovedBy);
    lay2.addComponent(tfDynamicPlanApproval1);
    lay2.addComponent(tfDynamicPlanApproval2);
    tfDynamicPlanApproval1.setVisible(false);
    tfDynamicPlanApproval2.setVisible(false);
    lay1.setSpacing(true);
    lay2.setSpacing(true);
    layoutPlanApproval1.addComponent(lay1);
    layoutPlanApproval1.addComponent(lay2);
    layoutPlanApproval1.setSpacing(true);
    layoutPlanApproval1.setMargin(true);
    layoutPlanApproval.addComponent(btnDynamicPlanApproval);
    layoutPlanApproval.setComponentAlignment(btnDynamicPlanApproval, Alignment.TOP_RIGHT);
    layoutPlanApproval.addComponent(layoutPlanApproval1);

    // valuation of land
    layoutValuationLand.setSpacing(true);
    layoutValuationLand1.setSpacing(true);
    layoutValuationLand1.setColumns(4);
    layoutValuationLand1.addComponent(tfAreaofLand);
    layoutValuationLand1.addComponent(tfNorthandSouth);
    layoutValuationLand1.addComponent(tfMarketRate);
    layoutValuationLand1.addComponent(tfGuiderate);
    layoutValuationLand1.addComponent(tfAdopetdMarketRate);
    layoutValuationLand1.addComponent(tfFairMarketRate);
    layoutValuationLand1.addComponent(tfDynamicValuation1);
    layoutValuationLand1.addComponent(tfDynamicValuation2);
    tfDynamicValuation1.setVisible(false);
    tfDynamicValuation2.setVisible(false);
    layoutValuationLand.addComponent(btnDynamicValuation);
    layoutValuationLand.setComponentAlignment(btnDynamicValuation, Alignment.TOP_RIGHT);
    layoutValuationLand.addComponent(layoutValuationLand1);
    layoutValuationLand.setMargin(true);
    tfLandMark.setImmediate(true);
    tfAdopetdMarketRate.setRequired(true);
    tfLandMark.addBlurListener(new BlurListener() {

        @Override
        public void blur(BlurEvent event) {
            // TODO Auto-generated method stub
            tfPropLandmark.setValue(tfLandMark.getValue());
        }
    });
    tfPropertyAddress.setImmediate(true);
    tfPropertyAddress.addBlurListener(new BlurListener() {

        @Override
        public void blur(BlurEvent event) {
            // TODO Auto-generated method stub
            tfPostalAddress.setValue(tfPropertyAddress.getValue());

        }
    });
    /*   tfEvaluationNumber.addValidator(new IntegerValidator("Enter numbers only"));
       tfEvaluationNumber.addBlurListener(new SaarcValidate(tfEvaluationNumber));*/
    tfEvaluationNumber.setImmediate(true);

    tfEvaluationNumber.addBlurListener(new BlurListener() {

        private static final long serialVersionUID = 1L;

        public void blur(BlurEvent event) {
            // TODO Auto-generated method stub
            if (!tfEvaluationNumber.isReadOnly()) {
                tfEvaluationNumber.setComponentError(null);
                try {
                    tfEvaluationNumber.setComponentError(null);
                    String evalno = tfEvaluationNumber.getValue().toString();
                    count = beanEvaluation.getEvalNoCount(evalno);

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

                        if (count == 0) {

                            tfEvaluationNumber.setComponentError(null);

                        } else {

                            tfEvaluationNumber
                                    .setComponentError(new UserError("Evaluation number is already Exist"));

                        }
                    }
                } catch (Exception e) {

                }
            }

        }
    });

    // property value
    layoutPropertyValue.setSpacing(true);
    layoutPropertyValue.setMargin(true);
    layoutPropertyValue1.setColumns(4);
    layoutPropertyValue1.setSpacing(true);
    layoutPropertyValue1.addComponent(tfRealziableRate);
    layoutPropertyValue1.addComponent(tfDistressRate);
    layoutPropertyValue1.addComponent(tfGuidelineRate);
    layoutPropertyValue.addComponent(layoutPropertyValue1);
    //for property image
    hlImage.setSpacing(true);
    btnImgDownload.setStyleName("downloadbt");
    btnImg1Download.setStyleName("downloadbt");

    //layoutDescProperty.setComponentAlignment(btnImg1Download, Alignment.MIDDLE_CENTER);

    hlImage.addComponent(hlImageLayout1);
    hlImage.addComponent(hlImageLayout2);
    hlImageLayout1.setMargin(true);
    hlImageLayout2.setMargin(true);
    hlImageLayout1.setSpacing(true);
    hlImageLayout2.setSpacing(true);
    vlImageLayout.addComponent(hlImage);

    // for Guideline area
    layoutGuideline.addComponent(btnAddGuideline);
    layoutGuideline.setComponentAlignment(btnAddGuideline, Alignment.TOP_RIGHT);
    layoutGuideline.setMargin(true);
    layoutGuideline.addComponent(new ComponentIterGuideline("Land", "", "", ""));
    // add components in main panel
    accordion.setWidth("100%");
    layoutEvaluationDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutEvaluationDetails), "Evaluation Details");
    layoutOwnerDetails.setStyleName("bluebar");

    accordion.addTab(PanelGenerator.createPanel(layoutAssetOwner), "Owner Details/Asset Details");
    layoutAssetDetails.setStyleName("bluebar");

    layoutNormalLegal.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutNormalLegal), "Document Details");

    panelAdjoinProperties.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(panelAdjoinProperties), "Adjoining Properties");
    panelDimension.setStyleName("bluebar");
    accordion.addTab(panelDimension, "Dimension");

    layoutDescProperty.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutDescProperty), "Description of the property");
    layoutCharcterSite.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutCharcterSite), "Characteristics of the site");
    layoutValuationLand.setStyleName("bluebar");
    accordion.addTab(layoutValuationLand, "Valuation of Land");
    layoutPlanApproval.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPlanApproval), "Details of Plan Approval");
    layoutGuideline.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutGuideline), "Guideline Details");
    layoutPropertyValue.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPropertyValue), "Property Value Details");
    vlImageLayout.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(vlImageLayout), "Property Image Details");
    this.accordion.addListener(new SelectedTabChangeListener() {
        public void selectedTabChange(SelectedTabChangeEvent event) {
            if (event.getTabSheet().getSelectedTab().equals(panelDimension)) {
                Iterator<Component> myComps = panelDimension.getComponentIterator();
                BigDecimal siteArea = new BigDecimal(0.00);
                while (myComps.hasNext()) {
                    final Component component = myComps.next();
                    int i = 1;

                    if (component instanceof ComponentIterDimensionofPlot) {

                        ComponentIterDimensionofPlot mycomponent = (ComponentIterDimensionofPlot) component;
                        List<TPemCmPropDimension> getList = mycomponent.getDimensionPropertyList();

                        try {
                            List<String> mylist = mycomponent.getLeastValaue();
                            siteArea = siteArea.add(new BigDecimal(mylist.get(0).replaceAll("[^\\d.]", "")));
                            tfNorthandSouth.setValue(mylist.get(1));
                            tfAreaofLand.setValue(siteArea.toString());
                        } catch (Exception e) {

                            logger.info("Error-->" + e);
                        }
                    }
                }
                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) {

                }
            }

        }
    });
    layoutMainForm.addComponent(PanelGenerator.createPanel(accordion));

    mainPanel.addComponent(layoutMainForm);
    //mainPanel.addComponent(layoutButton2);
    //mainPanel.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);
    mainPanel.setVisible(false);

    layoutMainForm.setMargin(true);
    layoutMainForm.setSpacing(true);
    // for main panel
    layoutButton2.setSpacing(true);
    btnSave.setStyleName("savebt");
    btnCancel.setStyleName("cancelbt");
    btnSubmit.setStyleName("submitbt");
    //   saveExcel.addStyleName("downloadbt");

    btnSave.setVisible(false);
    btnSubmit.setVisible(false);
    btnCancel.setVisible(false);
    //saveExcel.setVisible(false);
    layoutButton2.addComponent(btnSave);
    layoutButton2.addComponent(btnSubmit);
    //   layoutButton2.addComponent(saveExcel);
    layoutButton2.addComponent(btnCancel);
    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);
    // Initaited the Label Function here by Hohul
    lblTableTitle = new Label();
    lblSaveNotification = new Label();
    lblSaveNotification.setContentMode(ContentMode.HTML);
    lblNotificationIcon = new Label();
    lblTableTitle.setValue("<B>&nbsp;&nbsp;Action:</B>");
    lblTableTitle.setContentMode(ContentMode.HTML);
    lblFormTittle = new Label();
    lblFormTittle.setContentMode(ContentMode.HTML);
    lblFormTittle.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;Home");
    lblFormTitle1 = new Label();
    lblFormTitle1.setContentMode(ContentMode.HTML);
    lblFormTitle1.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;");
    lblAddEdit = new Label();
    lblAddEdit.setContentMode(ContentMode.HTML);

    // Button Back declaration by Hohul
    btnBack = new Button("Home", this);
    btnBack.setStyleName("link");

    // Bread Scrumbs initiated here by Hohul

    hlBreadCrumbs = new HorizontalLayout();
    hlBreadCrumbs.addComponent(lblFormTitle1);
    hlBreadCrumbs.addComponent(btnBack);
    hlBreadCrumbs.setComponentAlignment(btnBack, Alignment.TOP_CENTER);
    hlBreadCrumbs.addComponent(lblAddEdit);
    hlBreadCrumbs.setComponentAlignment(lblAddEdit, Alignment.MIDDLE_CENTER);
    hlBreadCrumbs.setVisible(false);

    tfSearchEvalNumber.setImmediate(true);
    tfSearchEvalNumber.addTextChangeListener(new TextChangeListener() {
        private static final long serialVersionUID = 1L;
        SimpleStringFilter filter = null;

        public void textChange(TextChangeEvent event) {
            Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
            if (filter != null)
                f.removeContainerFilter(filter);

            filter = new SimpleStringFilter("evalNo", event.getText(), true, false);

            f.addContainerFilter(filter);
            total = f.size();
            tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
        }
    });
    slSearchBankbranch.setImmediate(true);
    slSearchBankbranch.addValueChangeListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;
        Filter filter = null;

        @Override
        public void valueChange(ValueChangeEvent event) {
            // TODO Auto-generated method stub

            try {
                String strBankBranch = slSearchBankbranch.getValue().toString();
                Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
                if (filter != null)
                    f.removeContainerFilter(filter);

                filter = new Compare.Equal("bankBranch", strBankBranch);
                f.addContainerFilter(filter);
                f.addContainerFilter(filter);
                total = f.size();
                tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
            } catch (Exception e) {
            }
        }

    });

    // for search panel
    // for search panel
    // Added by Hohul ----->  For Search Panel Layouts
    FormLayout flSearchEvalNumber = new FormLayout();
    flSearchEvalNumber.addComponent(tfSearchEvalNumber);

    FormLayout flSearchBankbranch = new FormLayout();
    flSearchBankbranch.addComponent(slSearchBankbranch);

    FormLayout flSearchCustomer = new FormLayout();
    flSearchCustomer.addComponent(tfSearchCustomer);

    HorizontalLayout hlSearchComponentLayout = new HorizontalLayout();
    hlSearchComponentLayout.addComponent(flSearchEvalNumber);
    hlSearchComponentLayout.addComponent(flSearchBankbranch);
    hlSearchComponentLayout.addComponent(flSearchCustomer);
    hlSearchComponentLayout.setSpacing(true);
    hlSearchComponentLayout.setMargin(true);

    //Initialization and properties for btnDownload      
    btnDownload = new Button("Download");
    //btnDownload.setDescription("Download");
    btnDownload.addStyleName("downloadbt");
    btnDownload.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            //  UI.getCurrent()..clearDashboardButtonBadge();
            event.getButton().removeStyleName("unread");
            if (notifications != null && notifications.getUI() != null)
                notifications.close();
            else {
                buildNotifications(event);
                UI.getCurrent().addWindow(notifications);
                notifications.focus();
                ((VerticalLayout) UI.getCurrent().getContent())
                        .addLayoutClickListener(new LayoutClickListener() {
                            @Override
                            public void layoutClick(LayoutClickEvent event) {
                                notifications.close();
                                ((VerticalLayout) UI.getCurrent().getContent()).removeLayoutClickListener(this);
                            }
                        });
            }

        }
    });

    hlFileDownloadLayout = new HorizontalLayout();
    hlFileDownloadLayout.setSpacing(true);
    hlFileDownloadLayout.addComponent(btnDownload);
    hlFileDownloadLayout.setComponentAlignment(btnDownload, Alignment.MIDDLE_CENTER);

    VerticalLayout vlSearchandResetButtonLAyout = new VerticalLayout();
    vlSearchandResetButtonLAyout.setSpacing(true);
    vlSearchandResetButtonLAyout.addComponent(btnReset);
    vlSearchandResetButtonLAyout.setWidth("100");
    vlSearchandResetButtonLAyout.addStyleName("topbarthree");
    vlSearchandResetButtonLAyout.setMargin(true);

    HorizontalLayout hlSearchComponentandButtonLayout = new HorizontalLayout();
    hlSearchComponentandButtonLayout.setSizeFull();
    hlSearchComponentandButtonLayout.setSpacing(true);
    hlSearchComponentandButtonLayout.addComponent(hlSearchComponentLayout);
    hlSearchComponentandButtonLayout.setComponentAlignment(hlSearchComponentLayout, Alignment.MIDDLE_LEFT);
    hlSearchComponentandButtonLayout.addComponent(vlSearchandResetButtonLAyout);
    hlSearchComponentandButtonLayout.setComponentAlignment(vlSearchandResetButtonLAyout,
            Alignment.MIDDLE_RIGHT);
    hlSearchComponentandButtonLayout.setExpandRatio(vlSearchandResetButtonLAyout, 1);
    final VerticalLayout vlSearchComponentandButtonLayout = new VerticalLayout();
    vlSearchComponentandButtonLayout.setSpacing(true);
    vlSearchComponentandButtonLayout.setSizeFull();
    vlSearchComponentandButtonLayout.addComponent(hlSearchComponentandButtonLayout);

    /*layoutSearch.addComponent(tfSearchEvalNumber);
    layoutSearch.addComponent(slSearchBankbranch);
    // layoutSearch.addComponent(dfSearchEvalDate);
    layoutSearch.addComponent(tfSearchCustomer);
    //layoutSearch.addComponent(btnSearch);
    layoutSearch.addComponent(btnReset);
    //layoutSearch.setComponentAlignment(btnSearch, Alignment.BOTTOM_LEFT);
    layoutSearch.setComponentAlignment(btnReset, Alignment.BOTTOM_LEFT);
    btnSearch.addStyleName("default");*/
    btnReset.addStyleName("resetbt");
    //tfSearchCustomer.setImmediate(true);
    tfSearchCustomer.addTextChangeListener(new TextChangeListener() {
        SimpleStringFilter filter = null;

        public void textChange(TextChangeEvent event) {
            Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
            if (filter != null)
                f.removeContainerFilter(filter);

            filter = new SimpleStringFilter("custName", event.getText(), true, false);

            f.addContainerFilter(filter);
            total = f.size();
            tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
        }
    });

    searchPanel.addComponent(PanelGenerator.createPanel(vlSearchComponentandButtonLayout));
    searchPanel.setMargin(true);
    // Add Layout table panel by Hohul

    HorizontalLayout flTableCaption = new HorizontalLayout();
    flTableCaption.addComponent(lblTableTitle);
    flTableCaption.setComponentAlignment(lblTableTitle, Alignment.MIDDLE_CENTER);
    flTableCaption.addStyleName("lightgray");
    flTableCaption.setHeight("25px");
    flTableCaption.setWidth("60px");
    lblNoofRecords = new Label(" ", ContentMode.HTML);
    lblNoofRecords.addStyleName("lblfooter");
    HorizontalLayout hlTableTittleLayout = new HorizontalLayout();
    hlTableTittleLayout.addComponent(flTableCaption);
    hlTableTittleLayout.addComponent(btnAdd);
    hlTableTittleLayout.addComponent(btnEdit);
    hlTableTittleLayout.addComponent(btnView);
    hlTableTittleLayout.setHeight("25px");
    hlTableTittleLayout.setSpacing(true);

    HorizontalLayout hlTableTitleandCaptionLayout = new HorizontalLayout();
    hlTableTitleandCaptionLayout.addStyleName("topbarthree");
    hlTableTitleandCaptionLayout.setWidth("100%");
    hlTableTitleandCaptionLayout.addComponent(hlTableTittleLayout);
    hlTableTitleandCaptionLayout.addComponent(hlFileDownloadLayout);
    hlTableTitleandCaptionLayout.setComponentAlignment(hlFileDownloadLayout, Alignment.MIDDLE_RIGHT);
    hlTableTitleandCaptionLayout.setHeight("28px");
    // for table panel
    btnAdd.addStyleName("add");
    btnEdit.addStyleName("editbt");
    btnView.addStyleName("view");
    btnView.setEnabled(false);

    hlAddEditLayout = new HorizontalLayout();
    hlAddEditLayout.addStyleName("topbarthree");
    hlAddEditLayout.setWidth("100%");
    hlAddEditLayout.addComponent(hlTableTitleandCaptionLayout);
    hlAddEditLayout.setHeight("28px");
    // Added Action Label to Table

    layoutTable.addComponent(hlAddEditLayout);
    layoutTable.setComponentAlignment(hlAddEditLayout, Alignment.TOP_LEFT);
    layoutTable.addComponent(tblEvalDetails);

    tablePanel.addComponent(layoutTable);
    ;
    tablePanel.setWidth("100%");
    tablePanel.setMargin(true);

    layoutPage.addComponent(mainPanel);
    layoutPage.addComponent(searchPanel);
    layoutPage.addComponent(tablePanel);

    // Added labels and titles to respective Location by Hohul

    HorizontalLayout hlNotificationLayout = new HorizontalLayout();
    hlNotificationLayout.addComponent(lblNotificationIcon);
    hlNotificationLayout.setComponentAlignment(lblNotificationIcon, Alignment.MIDDLE_LEFT);
    hlNotificationLayout.addComponent(lblSaveNotification);
    hlNotificationLayout.setComponentAlignment(lblSaveNotification, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(lblFormTittle);
    hlHeaderLayout.setComponentAlignment(lblFormTittle, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(hlBreadCrumbs);
    hlHeaderLayout.setComponentAlignment(hlBreadCrumbs, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(hlNotificationLayout);
    hlHeaderLayout.setComponentAlignment(hlNotificationLayout, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.MIDDLE_RIGHT);

    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);

    // load Component list values
    loadComponentListValues();

    //setTableProperties();
    populateAndConfig(false);

}

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

License:Open Source License

@SuppressWarnings("deprecation")
void buildView(VerticalLayout layoutPage, HorizontalLayout hlHeaderLayout) {
    // for component width
    hlHeaderLayout.removeAllComponents();
    setComponentStyle();//from w ww.  j  a v  a 2s  .  c  o  m

    tblEvalDetails = new Table();
    tblEvalDetails.setStyleName(Runo.TABLE_SMALL);
    tblEvalDetails.setPageLength(12);
    tblEvalDetails.setSizeFull();
    tblEvalDetails.setFooterVisible(true);
    tblEvalDetails.setSelectable(true);
    tblEvalDetails.setImmediate(true);
    tblEvalDetails.setColumnCollapsingAllowed(true);

    // for evaluation details
    tfEvaluationPurpose.setValue("Collateral Security to the Bank");
    slStreetSerNo.addItem("STREET NAME");
    slStreetSerNo.addItem("SURVEY NO");
    slStreetSerNo.setNullSelectionAllowed(false);

    tfEvaluationNumber.setRequired(true);
    tfBankBranch.setRequired(true);
    dfDateofValuation.setRequired(true);
    tfEvaluationPurpose.setRequired(true);
    layoutEvaluationDetails1.setColumns(4);

    layoutEvaluationDetails1.addComponent(tfEvaluationNumber);
    layoutEvaluationDetails1.addComponent(tfBankBranch);
    layoutEvaluationDetails1.addComponent(tfEvaluationPurpose);
    layoutEvaluationDetails1.addComponent(tfValuatedBy);
    layoutEvaluationDetails1.addComponent(dfDateofValuation);
    layoutEvaluationDetails1.addComponent(dfVerifiedDate);
    layoutEvaluationDetails1.addComponent(tfVerifiedBy);
    layoutEvaluationDetails1.addComponent(tfDynamicEvaluation1);
    layoutEvaluationDetails1.addComponent(tfDynamicEvaluation2);
    tfDynamicEvaluation1.setVisible(false);
    tfDynamicEvaluation2.setVisible(false);
    layoutEvaluationDetails1.setSpacing(true);
    layoutEvaluationDetails1.setMargin(true);

    layoutEvaluationDetails.addComponent(btnDynamicEvaluation1);
    layoutEvaluationDetails.setComponentAlignment(btnDynamicEvaluation1, Alignment.TOP_RIGHT);
    layoutEvaluationDetails.addComponent(layoutEvaluationDetails1);
    // for customer details
    tfDynamicCustomer1.setVisible(false);
    tfDynamicCustomer2.setVisible(false);
    layoutCustomerDetail1.setColumns(4);
    //layoutCustomerDetail.setCaption("Customer Details");
    layoutCustomerDetail1.addComponent(tfCustomerName);
    layoutCustomerDetail1.addComponent(slPropertyDesc);
    layoutCustomerDetail1.addComponent(tfDynamicCustomer1);
    layoutCustomerDetail1.addComponent(tfDynamicCustomer2);
    layoutCustomerDetail1.setSpacing(true);
    layoutCustomerDetail1.setMargin(true);

    layoutCustomerDetail.addComponent(btnDynamicCustomer);
    layoutCustomerDetail.setComponentAlignment(btnDynamicCustomer, Alignment.TOP_RIGHT);
    layoutCustomerDetail.addComponent(layoutCustomerDetail1);
    // for asset details
    VerticalLayout formAsset1 = new VerticalLayout();
    VerticalLayout formAsset2 = new VerticalLayout();
    VerticalLayout formAsset3 = new VerticalLayout();
    VerticalLayout formAsset4 = new VerticalLayout();
    formAsset1.setSpacing(true);
    formAsset2.setSpacing(true);
    formAsset4.setSpacing(true);

    formAsset1.addComponent(tfCustomerName);
    formAsset1.addComponent(tfLandMark);
    formAsset1.addComponent(slPropertyDesc);
    formAsset2.addComponent(tfCustomerAddr);
    formAsset3.addComponent(tfPropertyAddress);
    formAsset3.addComponent(chkSameAddress);
    formAsset4.addComponent(tfDynamicAsset1);
    formAsset4.addComponent(tfDynamicAsset2);
    tfDynamicAsset1.setVisible(false);
    tfDynamicAsset2.setVisible(false);

    chkSameAddress.setImmediate(true);
    chkSameAddress.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {

            if (chkSameAddress.getValue().equals(true)) {
                tfPropertyAddress.setValue(tfCustomerAddr.getValue());

            } else {
                tfPropertyAddress.setValue("");
            }
        }
    });

    layoutAssetDetails1.setSpacing(true);
    layoutAssetDetails1.setColumns(4);
    layoutAssetDetails1.addComponent(formAsset1);
    layoutAssetDetails1.addComponent(formAsset2);
    layoutAssetDetails1.addComponent(formAsset3);
    layoutAssetDetails1.addComponent(formAsset4);
    layoutAssetDetails1.setMargin(true);

    layoutAssetDetails.addComponent(btnDynamicAsset);
    layoutAssetDetails.setComponentAlignment(btnDynamicAsset, Alignment.TOP_RIGHT);
    layoutAssetDetails.addComponent(layoutAssetDetails1);

    lblHeading = new Label("Owner Details");
    layoutAssetOwner.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutAssetOwner.addComponent(PanelGenerator.createPanel(layoutOwnerDetails));
    lblHeading = new Label("Asset Details");
    layoutAssetOwner.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutAssetOwner.addComponent(PanelGenerator.createPanel(layoutAssetDetails));

    //for Owner Details
    layoutOwnerDetails.addComponent(btnAddOwner);
    layoutOwnerDetails.setComponentAlignment(btnAddOwner, Alignment.TOP_RIGHT);
    layoutOwnerDetails1.setColumns(4);
    layoutOwnerDetails1.addComponent(new ComponentIterOwnerDetails("", ""));
    layoutOwnerDetails.addComponent(layoutOwnerDetails1);
    layoutOwnerDetails1.setSpacing(true);
    layoutOwnerDetails1.setMargin(true);

    // for document details
    panelNormalDocumentDetails.addComponent(btnAddNorDoc);
    panelNormalDocumentDetails.setComponentAlignment(btnAddNorDoc, Alignment.TOP_RIGHT);
    panelNormalDocumentDetails.addComponent(new ComponentIteratorNormlDoc(null, null, "", ""));
    panelNormalDocumentDetails.setMargin(true);
    panelLegalDocumentDetails.addComponent(btnAddLegalDoc);
    panelLegalDocumentDetails.setComponentAlignment(btnAddLegalDoc, Alignment.TOP_RIGHT);
    panelLegalDocumentDetails.addComponent(new ComponentIteratorLegalDoc("", "", null));
    panelLegalDocumentDetails.setMargin(true);
    layoutNormalLegal.addComponent(PanelGenerator.createPanel(panelNormalDocumentDetails));
    lblHeading = new Label("Legal Documents");
    layoutNormalLegal.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutNormalLegal.addComponent(PanelGenerator.createPanel(panelLegalDocumentDetails));
    layoutNormalLegal.setMargin(true);
    // for adjoin properties
    //panelAdjoinProperties.setCaption("Adjoining Properties");
    panelAdjoinProperties.addComponent(btnAddAdjoinProperty);
    panelAdjoinProperties.setComponentAlignment(btnAddAdjoinProperty, Alignment.BOTTOM_RIGHT);
    panelAdjoinProperties.addComponent(new ComponentIteratorAdjoinProperty(null, true, true, true));

    // for dimensions
    //panelDimension.setCaption("Dimensions");
    panelDimension.addComponent(btnAddDimension);
    panelDimension.setComponentAlignment(btnAddDimension, Alignment.BOTTOM_RIGHT);
    panelDimension.addComponent(new ComponentIterDimensionofPlot(null, true, true, true));

    panelNormalDocumentDetails.setWidth("100%");
    panelLegalDocumentDetails.setWidth("100%");
    panelAdjoinProperties.setStyleName("width:100%;display:block;");

    // for
    layoutmachingBoundary1.setSpacing(true);
    tfDynamicmatching1.setVisible(true);
    tfDynamicmatching2.setVisible(true);
    layoutmachingBoundary2.addComponent(btnDynamicmatching);
    layoutmachingBoundary2.setComponentAlignment(btnDynamicmatching, Alignment.TOP_RIGHT);
    layoutmachingBoundary1.setSpacing(true);
    layoutmachingBoundary1.addComponent(slMatchingBoundary);
    layoutmachingBoundary1.addComponent(slPlotDemarcated);
    layoutmachingBoundary1.addComponent(slApproveLandUse);
    layoutmachingBoundary1.addComponent(slTypeofProperty);
    layoutmachingBoundary1.addComponent(tfDynamicmatching1);
    layoutmachingBoundary1.addComponent(tfDynamicmatching2);
    layoutmachingBoundary1.setSpacing(true);
    layoutmachingBoundary1.setMargin(true);

    // tenure/occupancy details
    layoutTenureOccupay.setSpacing(true);
    layoutTenureOccupay1.setSpacing(true);
    layoutTenureOccupay2.addComponent(btnDynamicTenure);
    layoutTenureOccupay2.setComponentAlignment(btnDynamicTenure, Alignment.TOP_RIGHT);
    layoutTenureOccupay.setColumns(2);
    layoutTenureOccupay1.addComponent(tfStatusofTenure);
    layoutTenureOccupay1.addComponent(slOwnedorRent);
    layoutTenureOccupay1.addComponent(tfNoOfYears);
    layoutTenureOccupay1.addComponent(tfRelationship);
    layoutTenureOccupay1.addComponent(tfDynamicTenure1);
    layoutTenureOccupay1.addComponent(tfDynamicTenure2);
    layoutmachingBoundary2.addComponent(layoutmachingBoundary1);
    layoutTenureOccupay2.addComponent(layoutTenureOccupay1);
    layoutTenureOccupay.addComponent(PanelGenerator.createPanel(layoutmachingBoundary2));
    layoutTenureOccupay.addComponent(PanelGenerator.createPanel(layoutTenureOccupay2));
    tfDynamicTenure1.setVisible(false);
    tfDynamicTenure2.setVisible(false);
    layoutmachingBoundary1.setMargin(true);
    layoutTenureOccupay1.setMargin(true);
    layoutmachingBoundary.addComponent(layoutTenureOccupay);
    layoutTenureOccupay1.setMargin(true);
    layoutmachingBoundary.setMargin(true);

    // for no of rooms
    layoutNoofRooms2.addComponent(btnDynamicRooms);
    layoutNoofRooms2.setComponentAlignment(btnDynamicRooms, Alignment.TOP_RIGHT);
    layoutNoofRooms2.setMargin(true);
    layoutNoofRooms1.addComponent(tfNoofRooms);
    layoutNoofRooms1.addComponent(tfLivingDining);
    layoutNoofRooms1.addComponent(tfBedRooms);
    layoutNoofRooms1.addComponent(tfKitchen);
    layoutNoofRooms1.addComponent(tfToilets);
    layoutNoofRooms1.addComponent(tfDynamicRooms1);
    layoutNoofRooms1.addComponent(tfDynamicRooms2);
    tfDynamicRooms1.setVisible(false);
    tfDynamicRooms2.setVisible(false);
    layoutNoofRooms1.setSpacing(true);
    layoutNoofRooms2.addComponent(layoutNoofRooms1);
    // no of floors
    layoutNoofFloors.setColumns(2);
    layoutNoofFloors2.setMargin(true);
    layoutNoofFloors2.addComponent(btnDynamicFloor);
    layoutNoofFloors2.setComponentAlignment(btnDynamicFloor, Alignment.TOP_RIGHT);
    layoutNoofFloors1.addComponent(tfTotNoofFloors);
    layoutNoofFloors1.addComponent(tfPropertyLocated);
    layoutNoofFloors1.addComponent(tfApproxAgeofBuilding);
    layoutNoofFloors1.addComponent(tfResidualAgeofBuilding);
    layoutNoofFloors1.addComponent(slTypeofStructure);
    layoutNoofFloors1.addComponent(tfDynamicFloors1);
    layoutNoofFloors1.addComponent(tfDynamicFloors2);
    tfDynamicFloors1.setVisible(false);
    tfDynamicFloors2.setVisible(false);
    layoutNoofFloors1.setSpacing(true);
    layoutNoofFloors2.addComponent(layoutNoofFloors1);
    layoutNoofFloors.setSpacing(true);
    layoutNoofFloors.addComponent(PanelGenerator.createPanel(layoutNoofFloors2));
    layoutNoofFloors.addComponent(PanelGenerator.createPanel(layoutNoofRooms2));

    layoutNoofRooms.addComponent(layoutNoofFloors);
    layoutNoofRooms.setMargin(true);

    // construction
    //layoutConstruction.setCaption("Construction");
    layoutConstruction1.setSpacing(true);
    layoutConstruction1.setColumns(4);
    layoutConstruction1.addComponent(tfStageofConst);
    layoutConstruction1.addComponent(tfDynamicConstruction1);
    layoutConstruction1.addComponent(tfDynamicConstruction2);
    tfDynamicConstruction1.setVisible(false);
    tfDynamicConstruction2.setVisible(false);

    layoutConstruction.addComponent(btnDynamicConstruction);
    layoutConstruction.setComponentAlignment(btnDynamicConstruction, Alignment.TOP_RIGHT);
    layoutConstruction.addComponent(layoutConstruction1);
    layoutConstruction.setMargin(true);

    //for violation
    //layoutViolation.setCaption("Violation Details");
    layoutViolation1.setSpacing(true);
    layoutViolation1.setColumns(4);
    layoutViolation1.addComponent(tfAnyViolation);
    layoutViolation1.addComponent(tfDynamicViolation1);
    layoutViolation1.addComponent(tfDynamicViolation2);
    tfDynamicViolation1.setVisible(false);
    tfDynamicViolation2.setVisible(false);

    layoutViolation.addComponent(btnDynamicViolation);
    layoutViolation.setComponentAlignment(btnDynamicViolation, Alignment.TOP_RIGHT);
    layoutViolation.addComponent(layoutViolation1);
    layoutViolation.setMargin(true);

    layoutConstViolation.addComponent(PanelGenerator.createPanel(layoutConstruction));
    layoutConstViolation.addComponent(PanelGenerator.createPanel(layoutViolation));
    layoutConstViolation.setSpacing(true);
    layoutConstViolation.setMargin(true);
    // area details of the property
    //layoutAreaDetails.setCaption("Area Details of the Property");
    layoutAreaDetails1.setSpacing(true);
    layoutAreaDetails1.setColumns(4);
    layoutAreaDetails1.addComponent(tfSiteArea);
    layoutAreaDetails1.addComponent(tfPlinthArea);
    layoutAreaDetails1.addComponent(tfCarpetArea);
    layoutAreaDetails1.addComponent(tfSalableArea);
    layoutAreaDetails1.addComponent(tfRemarks);
    layoutAreaDetails1.addComponent(tfDynamicAreaDetail1);
    layoutAreaDetails1.addComponent(tfDynamicAreaDetail2);
    tfDynamicAreaDetail1.setVisible(false);
    tfDynamicAreaDetail2.setVisible(false);

    layoutAreaDetails.addComponent(btnDynamicAreaDetail);
    layoutAreaDetails.setComponentAlignment(btnDynamicAreaDetail, Alignment.TOP_RIGHT);
    layoutAreaDetails.addComponent(layoutAreaDetails1);
    layoutAreaDetails.setMargin(true);

    // valuation of land
    //layoutValuationLand.setCaption("Valuation of Land");
    layoutValuationLand.setSpacing(true);
    layoutValuationLand1.setSpacing(true);
    layoutValuationLand1.setColumns(4);
    layoutValuationLand1.addComponent(tfAreaofLand);
    layoutValuationLand1.addComponent(tfNorthandSouth);
    layoutValuationLand1.addComponent(tfMarketRate);
    layoutValuationLand1.addComponent(tfAdopetdMarketRate);
    layoutValuationLand1.addComponent(tfFairMarketRate);
    layoutValuationLand1.addComponent(tfDynamicValuation1);
    layoutValuationLand1.addComponent(tfDynamicValuation2);
    tfDynamicValuation1.setVisible(false);
    tfDynamicValuation2.setVisible(false);
    tfAdopetdMarketRate.setRequired(true);
    layoutValuationLand.addComponent(btnDynamicValuation);
    layoutValuationLand.setComponentAlignment(btnDynamicValuation, Alignment.TOP_RIGHT);
    layoutValuationLand.addComponent(layoutValuationLand1);
    layoutValuationLand.setMargin(true);

    //property value
    layoutPropertyValue.setSpacing(true);
    layoutPropertyValue.setMargin(true);
    layoutPropertyValue1.setColumns(4);
    layoutPropertyValue1.setSpacing(true);
    layoutPropertyValue1.addComponent(tfRealziableRate);
    layoutPropertyValue1.addComponent(tfDistressRate);
    layoutPropertyValue1.addComponent(tfGuidelineRate);
    layoutPropertyValue.addComponent(layoutPropertyValue1);

    // for details of plan approval
    layoutPlanApproval1.setColumns(4);
    formLand.addComponent(slLandandBuilding);
    formLand.addComponent(tfLandandBuilding);
    formBuilding.addComponent(slBuilding);
    formBuilding.addComponent(tfBuilding);

    layoutPlanApproval1.addComponent(formLand);
    layoutPlanApproval1.addComponent(formBuilding);
    layoutPlanApproval1.addComponent(tfPlanApprovedBy);
    layoutPlanApproval1.addComponent(dfLicenseFrom);
    layoutPlanApproval1.addComponent(slIsLicenceForced);
    layoutPlanApproval1.addComponent(slAllApprovalRecved);
    layoutPlanApproval1.addComponent(slConstAsperAppPlan);
    layoutPlanApproval1.addComponent(tfDynamicPlanApproval1);
    layoutPlanApproval1.addComponent(tfDynamicPlanApproval2);

    tfDynamicPlanApproval1.setVisible(false);
    tfDynamicPlanApproval2.setVisible(false);
    layoutPlanApproval1.setSpacing(true);
    layoutPlanApproval1.setMargin(true);
    layoutPlanApproval.addComponent(btnDynamicPlanApproval);
    layoutPlanApproval.setComponentAlignment(btnDynamicPlanApproval, Alignment.TOP_RIGHT);
    layoutPlanApproval.addComponent(layoutPlanApproval1);
    //valuation of Construction
    formConstValuation1.addComponent(slTypeProperty);
    formConstValuation1.addComponent(slTypeStructure);
    formConstValuation1.addComponent(tfYearConstruction);
    formConstValuation1.addComponent(slExterior);
    formConstValuation1.addComponent(slInterior);
    formConstValuation1.addComponent(tfLifeAge);
    formConstValuation1.addComponent(tfFutureLife);
    formConstValuation1.addComponent(tfDetailsPlan);
    formConstValuation1.addComponent(slDeviation);
    formConstValuation1.addComponent(tfDtlsDeviation);

    formConstValuation2.addComponent(btnAddRoofHt);
    formConstValuation2.addComponent(tfNoFloors);
    //formConstValuation2.addComponent(layoutRoofHeight);

    layoutConstValuation.setSpacing(true);
    layoutConstValuation1.setSpacing(true);
    layoutConstValuation1.setColumns(2);
    layoutConstValuation1.addComponent(formConstValuation1);
    layoutConstValuation1.addComponent(new VerticalLayout() {
        {
            addComponent(formConstValuation2);
            addComponent(layoutRoofHeight);
        }

    });

    formConstValuation1.addComponent(tfDynamicConstval1);
    formConstValuation1.addComponent(tfDynamicConstval2);
    layoutConstValuation.addComponent(btnDynamicConstVal);
    layoutConstValuation.setComponentAlignment(btnDynamicConstVal, Alignment.TOP_RIGHT);
    layoutConstValuation.addComponent(layoutConstValuation1);
    layoutConstValuation.setMargin(true);

    // for plinth area
    layoutPlintharea.addComponent(btnAddPlinth);
    layoutPlintharea.setComponentAlignment(btnAddPlinth, Alignment.TOP_RIGHT);
    layoutPlintharea.setMargin(true);
    layoutPlintharea.addComponent(new ComponentIterPlinthArea("Ground Floor", "", ""));
    layoutPlintharea.addComponent(new ComponentIterPlinthArea("Portico and Stair", "", ""));
    //for Valuation Details
    layoutValuationDetails.addComponent(btnAddValDtls);
    layoutValuationDetails1.setColumns(8);
    layoutValuationDetails1.setSpacing(true);
    layoutValuationDetails.setComponentAlignment(btnAddValDtls, Alignment.TOP_RIGHT);
    layoutValuationDetails1.addComponent(lblParticular);
    layoutValuationDetails1.addComponent(lblPlinthArea);
    layoutValuationDetails1.addComponent(lblRoofHt);
    layoutValuationDetails1.addComponent(lblBuildAge);
    layoutValuationDetails1.addComponent(lblRate);
    layoutValuationDetails1.addComponent(lblReplace);
    layoutValuationDetails1.addComponent(lblDepreciation);
    layoutValuationDetails1.addComponent(lblNetvalue);
    layoutValuationDetails1.setComponentAlignment(lblParticular, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblPlinthArea, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblRoofHt, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblBuildAge, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblRate, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblReplace, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblDepreciation, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblNetvalue, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setWidth("650px");
    layoutValuationDetails.addComponent(layoutValuationDetails1);
    layoutValuationDetails.addComponent(layoutValuationDetails2);
    layoutValuationDetails.setWidth("100%");
    layoutValuationDetails.setMargin(true);
    ValuationDetailsList obj = new ValuationDetailsList();
    ValuationDetailsList obj1 = new ValuationDetailsList();
    obj.setFloorDtlsLabel("Ground Floor Building");
    obj1.setFloorDtlsLabel("First Floor Building");
    layoutValuationDetails2.addComponent(new ComponenetIterValuationDetails(obj));
    layoutValuationDetails2.addComponent(new ComponenetIterValuationDetails(obj1));

    // for Build Specification
    panelBuildSpecfication.addComponent(btnAddBuildSpec);
    panelBuildSpecfication.setComponentAlignment(btnAddBuildSpec, Alignment.TOP_RIGHT);
    panelBuildSpecfication.addComponent(new ComponentIterBuildingSpecfication(null, true, true, true));
    panelBuildSpecfication.setWidth("100%");
    //for Calculation-extra Items
    layoutExtraItems.setCaption("Extra Items");
    layoutExtraItems.setWidth("420px");
    layoutExtraItems.addComponent(btnDynamicExtra);
    layoutExtraItems.setComponentAlignment(btnDynamicExtra, Alignment.TOP_RIGHT);
    layoutExtraItems.addComponent(new ComponentIterExtraItems(null, ""));

    layoutAdditionItem.addComponent(btnDynamicAdditional);
    layoutAdditionItem.setComponentAlignment(btnDynamicAdditional, Alignment.TOP_RIGHT);
    layoutAdditionItem.addComponent(new ComponentIterAdditionalItems(null, ""));

    layoutAdditionItem.setCaption("Additional Items");
    layoutAdditionItem.setWidth("400px");
    layoutExtraAddItems1.setSpacing(true);
    layoutExtraAddItems1.setMargin(true);
    layoutExtraAddItems.setColumns(2);
    layoutExtraAddItems.addComponent(layoutExtraItems);
    layoutExtraAddItems.addComponent(layoutAdditionItem);
    layoutExtraAddItems1.addComponent(layoutExtraAddItems);

    //for Miscellaneous
    layoutMiscellaneous.setCaption("Miscellaneous");
    layoutMiscellaneous.setWidth("420px");
    layoutMiscellaneous.addComponent(btnDynamicMiscell);
    layoutMiscellaneous.setComponentAlignment(btnDynamicMiscell, Alignment.TOP_RIGHT);
    layoutMiscellaneous.addComponent(new ComponentIterMiscellaneous(null, ""));

    layoutServices.setCaption("Services");
    layoutServices.setWidth("400px");
    layoutServices.addComponent(btnDynamicServices);
    layoutServices.setComponentAlignment(btnDynamicServices, Alignment.TOP_RIGHT);
    layoutServices.addComponent(new ComponentIerServices(null, ""));

    layoutMiscellService1.setSpacing(true);
    layoutMiscellService1.setMargin(true);
    layoutMiscellService.setColumns(2);
    layoutMiscellService.addComponent(layoutMiscellaneous);
    layoutMiscellService.addComponent(layoutServices);
    layoutMiscellService1.addComponent(layoutMiscellService);
    // for Guideline area
    layoutGuideline.addComponent(btnAddGuideline);
    layoutGuideline.setComponentAlignment(btnAddGuideline, Alignment.TOP_RIGHT);
    layoutGuideline.setMargin(true);
    layoutGuideline.addComponent(new ComponentIterGuideline("Land", "", "", ""));
    layoutGuideline.addComponent(new ComponentIterGuideline("Building", "", "", ""));

    // for guide line reference
    streetLayout.addComponent(slStreetSerNo);
    streetLayout.addComponent(tfStreetName);

    layoutGuidelineReference1.setColumns(4);
    layoutGuidelineReference1.setSpacing(true);
    layoutGuidelineReference1.addComponent(tfZone);
    layoutGuidelineReference1.addComponent(tfSRO);
    layoutGuidelineReference1.addComponent(tfVillage);
    layoutGuidelineReference1.addComponent(tfRevnueDist);
    layoutGuidelineReference1.addComponent(tfTalukName);
    layoutGuidelineReference1.addComponent(streetLayout);
    layoutGuidelineReference1.addComponent(tfGuidelineValue);
    layoutGuidelineReference1.addComponent(tfGuidelineValueMatric);
    layoutGuidelineReference1.addComponent(slClassification);
    layoutGuidelineReference1.setMargin(true);

    layoutGuidelineReference.setSpacing(true);
    layoutGuidelineReference.addComponent(layoutGuidelineReference1);

    //add components in main panel

    layoutMainForm.addComponent(PanelGenerator.createPanel(accordion));
    layoutEvaluationDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutEvaluationDetails), "Evaluation Details");
    layoutOwnerDetails.setStyleName("bluebar");
    layoutAssetDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutAssetOwner), "Owner Details/Asset Details");

    layoutNormalLegal.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutNormalLegal), "Document Details");
    panelAdjoinProperties.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(panelAdjoinProperties), "Adjoining Properties");

    panelDimension.setStyleName("bluebar");
    accordion.addTab(panelDimension, "Dimension");

    layoutmachingBoundary.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutmachingBoundary),
            "Matching of Boundaries And Tenure/Occupancy Details");

    layoutNoofRooms.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutNoofRooms), "No. of Rooms/No. of Floors");
    layoutAreaDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutAreaDetails), "Area Details of the Property");
    layoutValuationLand.setStyleName("bluebar");
    accordion.addTab(layoutValuationLand, "Valuation of Land");
    layoutConstValuation.setStyleName("bluebar");
    layoutPlanApproval.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPlanApproval), "Details of Plan Approval");
    accordion.addTab(PanelGenerator.createPanel(layoutConstValuation), "Valuation of Building");
    panelBuildSpecfication.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(panelBuildSpecfication), "Specification of the building");

    layoutValuationDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutValuationDetails), "Details of Valuation");

    layoutExtraAddItems1.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutExtraAddItems1), "Extra/Additional Items");

    layoutMiscellService1.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutMiscellService1), "Miscellaneous/Services");

    layoutGuideline.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutGuideline), "Guideline Details");

    layoutGuidelineReference.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutGuidelineReference), "Guideline Reference Details");
    layoutPlintharea.setStyleName("bluebar");
    layoutPropertyValue.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPropertyValue), "Property Value Details");
    layoutPlintharea.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPlintharea), "Plinth Area Details");
    layoutConstruction.setStyleName("bluebar");
    layoutViolation.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutConstViolation), "Construction/Violation Details");
    this.accordion.addListener(new SelectedTabChangeListener() {
        public void selectedTabChange(SelectedTabChangeEvent event) {
            if (event.getTabSheet().getSelectedTab().equals(panelDimension)) {
                Iterator<Component> myComps = panelDimension.getComponentIterator();
                BigDecimal siteArea = new BigDecimal(0.00);
                while (myComps.hasNext()) {
                    final Component component = myComps.next();
                    int i = 1;

                    if (component instanceof ComponentIterDimensionofPlot) {

                        ComponentIterDimensionofPlot mycomponent = (ComponentIterDimensionofPlot) component;
                        List<TPemCmPropDimension> getList = mycomponent.getDimensionPropertyList();

                        try {
                            List<String> mylist = mycomponent.getLeastValaue();
                            siteArea = siteArea.add(new BigDecimal(mylist.get(0).replaceAll("[^\\d.]", "")));
                            tfNorthandSouth.setValue(mylist.get(1));
                            tfSiteArea.setValue(siteArea.toString());
                        } catch (Exception e) {

                            logger.info("Error-->" + e);
                        }
                    }
                }
                BigDecimal site = new BigDecimal(0.00);
                BigDecimal fair = new BigDecimal(1.00);
                BigDecimal salbale = new BigDecimal(435.60);
                try {
                    site = new BigDecimal(tfSiteArea.getValue().replaceAll("[^\\d.]", ""));
                } catch (Exception e) {
                    site = new BigDecimal("0.00");

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

                }
            }

        }
    });
    layoutMainForm.setMargin(true);
    layoutMainForm.setSpacing(true);
    // for main panel
    layoutButton2.setSpacing(true);
    btnSave.setStyleName("savebt");
    btnCancel.setStyleName("cancelbt");
    //saveExcel.addStyleName("downloadbt");
    btnSubmit.setStyleName("submitbt");
    layoutButton2.addComponent(btnSave);
    layoutButton2.addComponent(btnSubmit);
    //layoutButton2.addComponent(saveExcel);
    layoutButton2.addComponent(btnCancel);

    btnSave.setVisible(false);
    btnCancel.setVisible(false);
    btnSubmit.setVisible(false);
    //saveExcel.setVisible(false);

    // Initaited the Label Function here by Hohul
    lblTableTitle = new Label();
    lblSaveNotification = new Label();
    lblSaveNotification.setContentMode(ContentMode.HTML);
    lblNotificationIcon = new Label();
    lblTableTitle.setValue("<B>&nbsp;&nbsp;Action:</B>");
    lblTableTitle.setContentMode(ContentMode.HTML);
    lblFormTittle = new Label();
    lblFormTittle.setContentMode(ContentMode.HTML);
    lblFormTittle.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;Home");
    lblFormTitle1 = new Label();
    lblFormTitle1.setContentMode(ContentMode.HTML);
    lblFormTitle1.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;");
    lblAddEdit = new Label();
    lblAddEdit.setContentMode(ContentMode.HTML);

    // Button Back declaration by Hohul
    btnBack = new Button("Home", this);
    btnBack.setStyleName("link");

    // Bread Scrumbs initiated here by Hohul

    hlBreadCrumbs = new HorizontalLayout();
    hlBreadCrumbs.addComponent(lblFormTitle1);
    hlBreadCrumbs.addComponent(btnBack);
    hlBreadCrumbs.setComponentAlignment(btnBack, Alignment.TOP_CENTER);
    hlBreadCrumbs.addComponent(lblAddEdit);
    hlBreadCrumbs.setComponentAlignment(lblAddEdit, Alignment.MIDDLE_CENTER);
    hlBreadCrumbs.setVisible(false);

    /*tfEvaluationNumber.addValidator(new IntegerValidator("Enter numbers only"));
    tfEvaluationNumber.addBlurListener(new SaarcValidate(tfEvaluationNumber));*/
    tfEvaluationNumber.setImmediate(true);

    tfEvaluationNumber.addBlurListener(new BlurListener() {

        private static final long serialVersionUID = 1L;

        public void blur(BlurEvent event) {
            // TODO Auto-generated method stub
            if (!tfEvaluationNumber.isReadOnly()) {
                tfEvaluationNumber.setComponentError(null);
                try {
                    tfEvaluationNumber.setComponentError(null);
                    String evalno = tfEvaluationNumber.getValue().toString();
                    count = beanEvaluation.getEvalNoCount(evalno);

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

                        if (count == 0) {

                            tfEvaluationNumber.setComponentError(null);

                        } else {

                            tfEvaluationNumber
                                    .setComponentError(new UserError("Evaluation number is already Exist"));

                        }
                    }
                } catch (Exception e) {

                }
            }

        }
    });

    /*String basepath = VaadinService.getCurrent()
          .getBaseDirectory().getAbsolutePath();
    Resource res = new FileResource(new File(basepath +
              "/WEB-INF/view/channel.doc"));
    FileDownloader fd = new FileDownloader(res);
    fd.extend(saveExcel);
    */
    mainPanel.addComponent(layoutMainForm);
    //mainPanel.addComponent(layoutButton2);
    //mainPanel.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);
    mainPanel.setVisible(false);

    // for search panel
    // Added by Hohul ----->  For Search Panel Layouts
    FormLayout flSearchEvalNumber = new FormLayout();
    flSearchEvalNumber.addComponent(tfSearchEvalNumber);

    FormLayout flSearchBankbranch = new FormLayout();
    flSearchBankbranch.addComponent(tfSearchBankbranch);

    FormLayout flSearchCustomer = new FormLayout();
    flSearchCustomer.addComponent(tfSearchCustomer);

    HorizontalLayout hlSearchComponentLayout = new HorizontalLayout();
    hlSearchComponentLayout.addComponent(flSearchEvalNumber);
    hlSearchComponentLayout.addComponent(flSearchBankbranch);
    hlSearchComponentLayout.addComponent(flSearchCustomer);
    hlSearchComponentLayout.setSpacing(true);
    hlSearchComponentLayout.setMargin(true);

    //Initialization and properties for btnDownload      
    btnDownload = new Button("Download");
    //btnDownload.setDescription("Download");
    btnDownload.addStyleName("downloadbt");
    btnDownload.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            //  UI.getCurrent()..clearDashboardButtonBadge();
            event.getButton().removeStyleName("unread");
            if (notifications != null && notifications.getUI() != null)
                notifications.close();
            else {
                buildNotifications(event);
                UI.getCurrent().addWindow(notifications);
                notifications.focus();
                ((VerticalLayout) UI.getCurrent().getContent())
                        .addLayoutClickListener(new LayoutClickListener() {
                            @Override
                            public void layoutClick(LayoutClickEvent event) {
                                notifications.close();
                                ((VerticalLayout) UI.getCurrent().getContent()).removeLayoutClickListener(this);
                            }
                        });
            }

        }
    });
    hlFileDownloadLayout = new HorizontalLayout();
    hlFileDownloadLayout.setSpacing(true);
    hlFileDownloadLayout.addComponent(btnDownload);
    hlFileDownloadLayout.setComponentAlignment(btnDownload, Alignment.MIDDLE_CENTER);

    VerticalLayout vlSearchandResetButtonLAyout = new VerticalLayout();
    vlSearchandResetButtonLAyout.setSpacing(true);
    vlSearchandResetButtonLAyout.addComponent(btnReset);
    vlSearchandResetButtonLAyout.setWidth("100");
    vlSearchandResetButtonLAyout.addStyleName("topbarthree");
    vlSearchandResetButtonLAyout.setMargin(true);

    HorizontalLayout hlSearchComponentandButtonLayout = new HorizontalLayout();
    hlSearchComponentandButtonLayout.setSizeFull();
    hlSearchComponentandButtonLayout.setSpacing(true);
    hlSearchComponentandButtonLayout.addComponent(hlSearchComponentLayout);
    hlSearchComponentandButtonLayout.setComponentAlignment(hlSearchComponentLayout, Alignment.MIDDLE_LEFT);
    hlSearchComponentandButtonLayout.addComponent(vlSearchandResetButtonLAyout);
    hlSearchComponentandButtonLayout.setComponentAlignment(vlSearchandResetButtonLAyout,
            Alignment.MIDDLE_RIGHT);
    hlSearchComponentandButtonLayout.setExpandRatio(vlSearchandResetButtonLAyout, 1);
    final VerticalLayout vlSearchComponentandButtonLayout = new VerticalLayout();
    vlSearchComponentandButtonLayout.setSpacing(true);
    vlSearchComponentandButtonLayout.setSizeFull();
    vlSearchComponentandButtonLayout.addComponent(hlSearchComponentandButtonLayout);

    /*   layoutSearch.addComponent(tfSearchEvalNumber);
       layoutSearch.addComponent(tfSearchBankbranch);
       layoutSearch.addComponent(tfSearchCustomer);
       //layoutSearch.addComponent(btnSearch);
       layoutSearch.addComponent(btnReset);
       //layoutSearch.setComponentAlignment(btnSearch, Alignment.BOTTOM_LEFT);
       layoutSearch.setComponentAlignment(btnReset, Alignment.BOTTOM_LEFT);*/
    //btnSearch.addStyleName("default");
    btnReset.addStyleName("resetbt");
    tfSearchCustomer.setImmediate(true);
    tfSearchCustomer.addListener(new TextChangeListener() {
        private static final long serialVersionUID = 1L;
        SimpleStringFilter filter = null;

        public void textChange(TextChangeEvent event) {
            Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
            if (filter != null)
                f.removeContainerFilter(filter);

            filter = new SimpleStringFilter("custName", event.getText(), true, false);

            f.addContainerFilter(filter);
            total = f.size();
            tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
        }
    });
    tfSearchEvalNumber.setImmediate(true);
    tfSearchEvalNumber.addListener(new TextChangeListener() {
        private static final long serialVersionUID = 1L;
        SimpleStringFilter filter = null;

        public void textChange(TextChangeEvent event) {
            Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
            if (filter != null)
                f.removeContainerFilter(filter);

            filter = new SimpleStringFilter("evalNo", event.getText(), true, false);

            f.addContainerFilter(filter);
            total = f.size();
            tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
        }
    });
    tfSearchBankbranch.setImmediate(true);
    tfSearchBankbranch.addValueChangeListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;
        Filter filter = null;

        @Override
        public void valueChange(ValueChangeEvent event) {
            // TODO Auto-generated method stub

            try {
                String strBankBranch = tfSearchBankbranch.getValue().toString();
                Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
                if (filter != null)
                    f.removeContainerFilter(filter);

                filter = new Compare.Equal("bankBranch", strBankBranch);
                f.addContainerFilter(filter);
                f.addContainerFilter(filter);
                total = f.size();
                tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
            } catch (Exception e) {
            }
        }

    });

    /*layoutSearch.setSpacing(true);
    layoutSearch.setMargin(true);*/
    /*lblHeading=new Label("Search");
    lblHeading.setStyleName("h4");
    searchPanel.addComponent(lblHeading);*/
    //searchPanel.addComponent(PanelGenerator.createPanel(layoutSearch));

    searchPanel.addComponent(PanelGenerator.createPanel(vlSearchComponentandButtonLayout));
    searchPanel.setMargin(true);

    // Search panel functions ends here by hohul

    // Add Layout table panel by Hohul

    HorizontalLayout flTableCaption = new HorizontalLayout();
    flTableCaption.addComponent(lblTableTitle);
    flTableCaption.setComponentAlignment(lblTableTitle, Alignment.MIDDLE_CENTER);
    flTableCaption.addStyleName("lightgray");
    flTableCaption.setHeight("25px");
    flTableCaption.setWidth("60px");
    lblNoofRecords = new Label(" ", ContentMode.HTML);
    lblNoofRecords.addStyleName("lblfooter");
    HorizontalLayout hlTableTittleLayout = new HorizontalLayout();
    hlTableTittleLayout.addComponent(flTableCaption);
    hlTableTittleLayout.addComponent(btnAdd);
    hlTableTittleLayout.addComponent(btnEdit);
    hlTableTittleLayout.addComponent(btnView);
    hlTableTittleLayout.setHeight("25px");
    hlTableTittleLayout.setSpacing(true);

    HorizontalLayout hlTableTitleandCaptionLayout = new HorizontalLayout();
    hlTableTitleandCaptionLayout.addStyleName("topbarthree");
    hlTableTitleandCaptionLayout.setWidth("100%");
    hlTableTitleandCaptionLayout.addComponent(hlTableTittleLayout);
    hlTableTitleandCaptionLayout.addComponent(hlFileDownloadLayout);
    hlTableTitleandCaptionLayout.setComponentAlignment(hlFileDownloadLayout, Alignment.MIDDLE_RIGHT);
    hlTableTitleandCaptionLayout.setHeight("28px");

    // for table panel
    btnAdd.addStyleName("add");
    btnEdit.addStyleName("editbt");
    btnView.addStyleName("view");
    btnView.setEnabled(false);

    hlAddEditLayout.addStyleName("topbarthree");
    hlAddEditLayout.setWidth("100%");
    hlAddEditLayout.addComponent(hlTableTitleandCaptionLayout);
    hlAddEditLayout.setHeight("28px");

    // Added Action Label to Table

    layoutTable.addComponent(hlAddEditLayout);
    layoutTable.setComponentAlignment(hlAddEditLayout, Alignment.TOP_LEFT);
    layoutTable.addComponent(tblEvalDetails);

    tablePanel.addComponent(layoutTable);
    tablePanel.setWidth("100%");
    tablePanel.setMargin(true);

    layoutPage.addComponent(mainPanel);
    layoutPage.addComponent(searchPanel);
    layoutPage.addComponent(tablePanel);

    // Added labels and titles to respective Location by Hohul

    HorizontalLayout hlNotificationLayout = new HorizontalLayout();
    hlNotificationLayout.addComponent(lblNotificationIcon);
    hlNotificationLayout.setComponentAlignment(lblNotificationIcon, Alignment.MIDDLE_LEFT);
    hlNotificationLayout.addComponent(lblSaveNotification);
    hlNotificationLayout.setComponentAlignment(lblSaveNotification, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(lblFormTittle);
    hlHeaderLayout.setComponentAlignment(lblFormTittle, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(hlBreadCrumbs);
    hlHeaderLayout.setComponentAlignment(hlBreadCrumbs, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(hlNotificationLayout);
    hlHeaderLayout.setComponentAlignment(hlNotificationLayout, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.MIDDLE_RIGHT);

    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);

    // load Component list values
    loadComponentListValues();

    //setTableProperties();
    populateAndConfig(false);
}

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

License:Open Source License

@SuppressWarnings("deprecation")
void buildView(VerticalLayout layoutPage, HorizontalLayout hlHeaderLayout) {
    // for component width
    hlHeaderLayout.removeAllComponents();
    setComponentStyle();/*from w  w  w  .  jav  a 2  s .co m*/

    tblEvalDetails = new Table();
    tblEvalDetails.setStyleName(Runo.TABLE_SMALL);
    tblEvalDetails.setPageLength(14);
    tblEvalDetails.setSizeFull();
    tblEvalDetails.setFooterVisible(true);
    tblEvalDetails.setSelectable(true);
    tblEvalDetails.setImmediate(true);
    tblEvalDetails.setColumnCollapsingAllowed(true);
    // for evaluation details
    tfEvaluationPurpose.setValue("Collateral Security to the Bank");
    slStreetSerNo.addItem("STREET NAME");
    slStreetSerNo.addItem("SURVEY NO");
    slStreetSerNo.setNullSelectionAllowed(false);
    tfEvaluationNumber.setRequired(true);
    tfBankBranch.setRequired(true);
    dfDateofValuation.setRequired(true);
    tfEvaluationPurpose.setRequired(true);
    layoutEvaluationDetails1.setColumns(4);

    layoutEvaluationDetails1.addComponent(tfEvaluationNumber);
    layoutEvaluationDetails1.addComponent(tfBankBranch);
    layoutEvaluationDetails1.addComponent(tfEvaluationPurpose);
    layoutEvaluationDetails1.addComponent(tfValuatedBy);
    layoutEvaluationDetails1.addComponent(dfDateofValuation);
    layoutEvaluationDetails1.addComponent(dfVerifiedDate);
    layoutEvaluationDetails1.addComponent(tfVerifiedBy);
    layoutEvaluationDetails1.addComponent(tfDynamicEvaluation1);
    layoutEvaluationDetails1.addComponent(tfDynamicEvaluation2);
    tfDynamicEvaluation1.setVisible(false);
    tfDynamicEvaluation2.setVisible(false);
    layoutEvaluationDetails1.setSpacing(true);
    layoutEvaluationDetails1.setMargin(true);

    layoutEvaluationDetails.addComponent(btnDynamicEvaluation1);
    layoutEvaluationDetails.setComponentAlignment(btnDynamicEvaluation1, Alignment.TOP_RIGHT);
    layoutEvaluationDetails.addComponent(layoutEvaluationDetails1);
    // for customer details
    tfDynamicCustomer1.setVisible(false);
    tfDynamicCustomer2.setVisible(false);
    layoutCustomerDetail1.setColumns(4);
    layoutCustomerDetail1.addComponent(tfCustomerName);
    layoutCustomerDetail1.addComponent(slPropertyDesc);
    layoutCustomerDetail1.addComponent(tfDynamicCustomer1);
    layoutCustomerDetail1.addComponent(tfDynamicCustomer2);
    layoutCustomerDetail1.setSpacing(true);
    layoutCustomerDetail1.setMargin(true);
    tfCustomerName.setRequired(true);
    layoutCustomerDetail.addComponent(btnDynamicCustomer);
    layoutCustomerDetail.setComponentAlignment(btnDynamicCustomer, Alignment.TOP_RIGHT);
    layoutCustomerDetail.addComponent(layoutCustomerDetail1);

    // for asset details
    VerticalLayout formAsset1 = new VerticalLayout();
    VerticalLayout formAsset2 = new VerticalLayout();
    VerticalLayout formAsset3 = new VerticalLayout();
    VerticalLayout formAsset4 = new VerticalLayout();
    formAsset1.setSpacing(true);
    formAsset2.setSpacing(true);
    formAsset4.setSpacing(true);

    formAsset1.addComponent(tfCustomerName);
    formAsset1.addComponent(tfLandMark);
    formAsset1.addComponent(slPropertyDesc);
    formAsset2.addComponent(tfCustomerAddr);
    formAsset3.addComponent(tfPropertyAddress);
    formAsset3.addComponent(chkSameAddress);
    formAsset4.addComponent(tfDynamicAsset1);
    formAsset4.addComponent(tfDynamicAsset2);
    tfDynamicAsset1.setVisible(false);
    tfDynamicAsset2.setVisible(false);

    chkSameAddress.setImmediate(true);
    chkSameAddress.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {

            if (chkSameAddress.getValue().equals(true)) {
                tfPropertyAddress.setValue(tfCustomerAddr.getValue());

            } else {
                tfPropertyAddress.setValue("");
            }
        }
    });

    layoutAssetDetails1.setSpacing(true);
    layoutAssetDetails1.setColumns(4);
    layoutAssetDetails1.addComponent(formAsset1);
    layoutAssetDetails1.addComponent(formAsset2);
    layoutAssetDetails1.addComponent(formAsset3);
    layoutAssetDetails1.addComponent(formAsset4);
    layoutAssetDetails1.setMargin(true);

    layoutAssetDetails.addComponent(btnDynamicAsset);
    layoutAssetDetails.setComponentAlignment(btnDynamicAsset, Alignment.TOP_RIGHT);
    layoutAssetDetails.addComponent(layoutAssetDetails1);

    lblHeading = new Label("Owner Details");
    layoutAssetOwner.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutAssetOwner.addComponent(PanelGenerator.createPanel(layoutOwnerDetails));
    lblHeading = new Label("Asset Details");
    layoutAssetOwner.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutAssetOwner.addComponent(PanelGenerator.createPanel(layoutAssetDetails));

    // for Owner Details
    layoutOwnerDetails.addComponent(btnAddOwner);
    layoutOwnerDetails.setComponentAlignment(btnAddOwner, Alignment.TOP_RIGHT);
    layoutOwnerDetails1.setColumns(4);
    layoutOwnerDetails1.addComponent(new ComponentIterOwnerDetails("", ""));
    layoutOwnerDetails.addComponent(layoutOwnerDetails1);
    layoutOwnerDetails1.setSpacing(true);
    layoutOwnerDetails1.setMargin(true);

    // for document details
    panelNormalDocumentDetails.addComponent(btnAddNorDoc);
    panelNormalDocumentDetails.setComponentAlignment(btnAddNorDoc, Alignment.TOP_RIGHT);
    panelNormalDocumentDetails.addComponent(new ComponentIteratorNormlDoc(null, null, "", ""));
    panelNormalDocumentDetails.setMargin(true);
    panelLegalDocumentDetails.addComponent(btnAddLegalDoc);
    panelLegalDocumentDetails.setComponentAlignment(btnAddLegalDoc, Alignment.TOP_RIGHT);
    panelLegalDocumentDetails.addComponent(new ComponentIteratorLegalDoc("", "", null));
    panelLegalDocumentDetails.setMargin(true);
    layoutNormalLegal.addComponent(PanelGenerator.createPanel(panelNormalDocumentDetails));
    lblHeading = new Label("Legal Documents");
    layoutNormalLegal.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutNormalLegal.addComponent(PanelGenerator.createPanel(panelLegalDocumentDetails));
    layoutNormalLegal.setMargin(true);

    // for adjoin properties
    // panelAdjoinProperties.setCaption("Adjoining Properties");
    panelAdjoinProperties.addComponent(btnAddAdjoinProperty);
    panelAdjoinProperties.setComponentAlignment(btnAddAdjoinProperty, Alignment.BOTTOM_RIGHT);
    panelAdjoinProperties.addComponent(new ComponentIteratorAdjoinProperty(null, true, true, true));

    // for dimensions
    // panelDimension.setCaption("Dimensions");
    panelDimension.addComponent(btnAddDimension);
    panelDimension.setComponentAlignment(btnAddDimension, Alignment.BOTTOM_RIGHT);
    panelDimension.addComponent(new ComponentIterDimensionofPlot(null, true, true, true));

    panelNormalDocumentDetails.setWidth("100%");
    panelLegalDocumentDetails.setWidth("100%");
    panelAdjoinProperties.setStyleName("width:100%;display:block;");

    // for
    layoutmachingBoundary1.setSpacing(true);
    tfDynamicmatching1.setVisible(true);
    tfDynamicmatching2.setVisible(true);
    layoutmachingBoundary2.addComponent(btnDynamicmatching);
    layoutmachingBoundary2.setComponentAlignment(btnDynamicmatching, Alignment.TOP_RIGHT);
    layoutmachingBoundary1.setSpacing(true);
    layoutmachingBoundary1.addComponent(slMatchingBoundary);
    layoutmachingBoundary1.addComponent(slPlotDemarcated);
    layoutmachingBoundary1.addComponent(slApproveLandUse);
    layoutmachingBoundary1.addComponent(slTypeofProperty);
    layoutmachingBoundary1.addComponent(tfDynamicmatching1);
    layoutmachingBoundary1.addComponent(tfDynamicmatching2);
    layoutmachingBoundary1.setSpacing(true);
    layoutmachingBoundary1.setMargin(true);

    // tenure/occupancy details
    layoutTenureOccupay.setSpacing(true);
    layoutTenureOccupay1.setSpacing(true);
    layoutTenureOccupay2.addComponent(btnDynamicTenure);
    layoutTenureOccupay2.setComponentAlignment(btnDynamicTenure, Alignment.TOP_RIGHT);
    layoutTenureOccupay.setColumns(2);
    layoutTenureOccupay1.addComponent(tfStatusofTenure);
    layoutTenureOccupay1.addComponent(slOwnedorRent);
    layoutTenureOccupay1.addComponent(tfNoOfYears);
    layoutTenureOccupay1.addComponent(tfRelationship);
    layoutTenureOccupay1.addComponent(tfDynamicTenure1);
    layoutTenureOccupay1.addComponent(tfDynamicTenure2);
    layoutmachingBoundary2.addComponent(layoutmachingBoundary1);
    layoutTenureOccupay2.addComponent(layoutTenureOccupay1);
    layoutTenureOccupay.addComponent(PanelGenerator.createPanel(layoutmachingBoundary2));
    layoutTenureOccupay.addComponent(PanelGenerator.createPanel(layoutTenureOccupay2));
    tfDynamicTenure1.setVisible(false);
    tfDynamicTenure2.setVisible(false);
    layoutmachingBoundary1.setMargin(true);
    layoutTenureOccupay1.setMargin(true);
    layoutmachingBoundary.addComponent(layoutTenureOccupay);
    layoutTenureOccupay1.setMargin(true);
    layoutmachingBoundary.setMargin(true);

    // for no of rooms
    layoutNoofRooms2.addComponent(btnDynamicRooms);
    layoutNoofRooms2.setComponentAlignment(btnDynamicRooms, Alignment.TOP_RIGHT);
    layoutNoofRooms2.setMargin(true);
    layoutNoofRooms1.addComponent(tfNoofRooms);
    layoutNoofRooms1.addComponent(tfLivingDining);
    layoutNoofRooms1.addComponent(tfBedRooms);
    layoutNoofRooms1.addComponent(tfKitchen);
    layoutNoofRooms1.addComponent(tfToilets);
    layoutNoofRooms1.addComponent(tfDynamicRooms1);
    layoutNoofRooms1.addComponent(tfDynamicRooms2);
    tfDynamicRooms1.setVisible(false);
    tfDynamicRooms2.setVisible(false);
    layoutNoofRooms1.setSpacing(true);
    layoutNoofRooms2.addComponent(layoutNoofRooms1);
    // no of floors
    layoutNoofFloors.setColumns(2);
    layoutNoofFloors2.setMargin(true);
    layoutNoofFloors2.addComponent(btnDynamicFloor);
    layoutNoofFloors2.setComponentAlignment(btnDynamicFloor, Alignment.TOP_RIGHT);
    layoutNoofFloors1.addComponent(tfTotNoofFloors);
    layoutNoofFloors1.addComponent(tfPropertyLocated);
    layoutNoofFloors1.addComponent(tfApproxAgeofBuilding);
    layoutNoofFloors1.addComponent(tfResidualAgeofBuilding);
    layoutNoofFloors1.addComponent(slTypeofStructures);
    layoutNoofFloors1.addComponent(tfDynamicFloors1);
    layoutNoofFloors1.addComponent(tfDynamicFloors2);
    tfDynamicFloors1.setVisible(false);
    tfDynamicFloors2.setVisible(false);
    layoutNoofFloors1.setSpacing(true);
    layoutNoofFloors2.addComponent(layoutNoofFloors1);
    layoutNoofFloors.setSpacing(true);
    layoutNoofFloors.addComponent(PanelGenerator.createPanel(layoutNoofFloors2));
    layoutNoofFloors.addComponent(PanelGenerator.createPanel(layoutNoofRooms2));

    layoutNoofRooms.addComponent(layoutNoofFloors);
    layoutNoofRooms.setMargin(true);
    // construction
    // layoutConstruction.setCaption("Construction");
    layoutConstruction1.setSpacing(true);
    layoutConstruction1.setColumns(4);
    layoutConstruction1.addComponent(tfStageofConst);
    layoutConstruction1.addComponent(tfDynamicConstruction1);
    layoutConstruction1.addComponent(tfDynamicConstruction2);
    tfDynamicConstruction1.setVisible(false);
    tfDynamicConstruction2.setVisible(false);

    layoutConstruction.addComponent(btnDynamicConstruction);
    layoutConstruction.setComponentAlignment(btnDynamicConstruction, Alignment.TOP_RIGHT);
    layoutConstruction.addComponent(layoutConstruction1);
    layoutConstruction.setMargin(true);

    // for violation
    // layoutViolation.setCaption("Violation Details");
    layoutViolation1.setSpacing(true);
    layoutViolation1.setColumns(4);
    layoutViolation1.addComponent(tfAnyViolation);
    layoutViolation1.addComponent(tfDynamicViolation1);
    layoutViolation1.addComponent(tfDynamicViolation2);
    tfDynamicViolation1.setVisible(false);
    tfDynamicViolation2.setVisible(false);

    layoutViolation.addComponent(btnDynamicViolation);
    layoutViolation.setComponentAlignment(btnDynamicViolation, Alignment.TOP_RIGHT);
    layoutViolation.addComponent(layoutViolation1);
    layoutViolation.setMargin(true);

    layoutConstViolation.addComponent(PanelGenerator.createPanel(layoutConstruction));
    layoutConstViolation.addComponent(PanelGenerator.createPanel(layoutViolation));
    layoutConstViolation.setSpacing(true);
    layoutConstViolation.setMargin(true);
    // area details of the property
    // layoutAreaDetails.setCaption("Area Details of the Property");
    layoutAreaDetails1.setSpacing(true);
    layoutAreaDetails1.setColumns(4);
    layoutAreaDetails1.addComponent(tfSiteArea);
    layoutAreaDetails1.addComponent(tfPlinthArea);
    layoutAreaDetails1.addComponent(tfCarpetArea);
    layoutAreaDetails1.addComponent(tfSalableArea);
    layoutAreaDetails1.addComponent(tfRemarks);
    layoutAreaDetails1.addComponent(tfDynamicAreaDetail1);
    layoutAreaDetails1.addComponent(tfDynamicAreaDetail2);
    tfDynamicAreaDetail1.setVisible(false);
    tfDynamicAreaDetail2.setVisible(false);

    layoutAreaDetails.addComponent(btnDynamicAreaDetail);
    layoutAreaDetails.setComponentAlignment(btnDynamicAreaDetail, Alignment.TOP_RIGHT);
    layoutAreaDetails.addComponent(layoutAreaDetails1);
    layoutAreaDetails.setMargin(true);

    // valuation of land
    layoutValuationLand.setSpacing(true);
    layoutValuationLand1.setSpacing(true);
    layoutValuationLand1.addComponent(tfAreaofLand);
    layoutValuationLand1.addComponent(tfNorthandSouth);
    layoutValuationLand1.addComponent(tfMarketRate);
    layoutValuationLand1.addComponent(tfAdopetdMarketRate);
    layoutValuationLand1.addComponent(tfFairMarketRate);
    layoutValuationLand1.addComponent(tfRealizabletRate);
    layoutValuationLand1.addComponent(tfDistressRate);
    layoutValuationLand1.addComponent(tfGuidelineRate);
    layoutValuationLand1.addComponent(tfDynamicValuation1);
    layoutValuationLand1.addComponent(tfDynamicValuation2);
    tfDynamicValuation1.setVisible(false);
    tfDynamicValuation2.setVisible(false);
    tfAdopetdMarketRate.setRequired(true);
    layoutValuationLand.addComponent(btnDynamicValuation);
    layoutValuationLand.setComponentAlignment(btnDynamicValuation, Alignment.TOP_RIGHT);
    layoutValuationLand.addComponent(layoutValuationLand1);
    layoutValuationLand.setMargin(true);

    // property value
    layoutPropertyValue.setSpacing(true);
    layoutPropertyValue.setMargin(true);
    layoutPropertyValue1.setColumns(4);
    layoutPropertyValue1.setSpacing(true);
    layoutPropertyValue1.addComponent(tfRealizabletRate);
    layoutPropertyValue1.addComponent(tfDistressRate);
    layoutPropertyValue1.addComponent(tfGuidelineRate);
    layoutPropertyValue.addComponent(layoutPropertyValue1);

    // for details of plan approval
    layoutPlanApproval1.setColumns(4);
    formLand.addComponent(slLandandBuilding);
    formLand.addComponent(tfLandandBuilding);
    formBuilding.addComponent(slBuilding);
    formBuilding.addComponent(tfBuilding);

    layoutPlanApproval1.addComponent(formLand);
    layoutPlanApproval1.addComponent(formBuilding);
    layoutPlanApproval1.addComponent(tfPlanApprovedBy);
    layoutPlanApproval1.addComponent(dfLicenseFrom);
    layoutPlanApproval1.addComponent(slIsLicenceForced);
    layoutPlanApproval1.addComponent(slAllApprovalRecved);
    layoutPlanApproval1.addComponent(slConstAsperAppPlan);
    layoutPlanApproval1.addComponent(tfDynamicPlanApproval1);
    layoutPlanApproval1.addComponent(tfDynamicPlanApproval2);

    tfDynamicPlanApproval1.setVisible(false);
    tfDynamicPlanApproval2.setVisible(false);
    layoutPlanApproval1.setSpacing(true);
    layoutPlanApproval1.setMargin(true);
    layoutPlanApproval.addComponent(btnDynamicPlanApproval);
    layoutPlanApproval.setComponentAlignment(btnDynamicPlanApproval, Alignment.TOP_RIGHT);
    layoutPlanApproval.addComponent(layoutPlanApproval1);

    // valuation of Construction
    layoutConstValuation.setSpacing(true);
    layoutConstValuation1.setSpacing(true);
    layoutConstValuation1.addComponent(slTypeProperty);
    layoutConstValuation1.addComponent(slTypeStructure);
    layoutConstValuation1.addComponent(tfYearConstruction);
    layoutConstValuation1.addComponent(tfNoFloors);
    layoutConstValuation1.addComponent(tfConstQuality);
    layoutConstValuation1.addComponent(slAllapproval);
    layoutConstValuation1.addComponent(slIsConstruction);
    layoutConstValuation1.addComponent(tfReason);
    layoutConstValuation1.addComponent(tfDynamicConstval1);
    layoutConstValuation1.addComponent(tfDynamicConstval2);
    tfDynamicConstval1.setVisible(false);
    tfDynamicConstval2.setVisible(false);

    layoutConstValuation.addComponent(btnDynamicConstVal);
    layoutConstValuation.setComponentAlignment(btnDynamicConstVal, Alignment.TOP_RIGHT);
    layoutConstValuation.addComponent(layoutConstValuation1);
    layoutConstValuation.setMargin(true);
    layoutLandConstValuation.setSpacing(true);
    layoutLandConstValuation.setColumns(2);
    layoutLandConstValuation.addComponent(PanelGenerator.createPanel(layoutValuationLand));
    layoutLandConstValuation.addComponent(PanelGenerator.createPanel(layoutConstValuation));
    layoutLandConstValuation1.addComponent(layoutLandConstValuation);
    layoutLandConstValuation1.setMargin(true);
    // for plinth area
    layoutPlintharea.addComponent(btnAddPlinth);
    layoutPlintharea.setComponentAlignment(btnAddPlinth, Alignment.BOTTOM_RIGHT);
    layoutPlintharea.setMargin(true);
    layoutPlintharea.addComponent(new ComponentIterPlinthArea("Ground Floor", "", ""));
    layoutPlintharea.addComponent(new ComponentIterPlinthArea("Portico and Stair", "", ""));

    // for Build Specification
    panelBuildSpecfication.addComponent(btnAddBuildSpec);
    panelBuildSpecfication.setComponentAlignment(btnAddBuildSpec, Alignment.BOTTOM_RIGHT);
    panelBuildSpecfication.addComponent(new ComponentIterBuildingSpecfication(null, true, true, true));
    panelBuildSpecfication.setWidth("100%");

    // for applicant estimate
    layoutApplicantEstimate.setSpacing(true);
    layoutApplicantEstimate1.setSpacing(true);
    layoutApplicantEstimate1.setColumns(2);
    layoutApplicantEstimate2.setSpacing(true);
    layoutApplicantEstimate2.setColumns(2);
    layoutApplicantEstimate3.setSpacing(true);
    layoutApplicantEstimate3.setColumns(2);
    layoutApplicantEstimate4.setSpacing(true);
    layoutApplicantEstimate4.setColumns(2);
    layoutApplicantEstimate1.addComponent(lblAppEstimate);
    layoutApplicantEstimate1.addComponent(tfAppEstimate);
    layoutApplicantEstimate1.addComponent(lblDtlsAppEstimate);
    layoutApplicantEstimate1.addComponent(tfDtlsAppEstimate);
    layoutApplicantEstimate1.addComponent(tfDetails1);
    layoutApplicantEstimate1.addComponent(tfDetailVal1);
    layoutApplicantEstimate1.addComponent(tfDetails2);
    layoutApplicantEstimate1.addComponent(tfDetailVal2);
    layoutApplicantEstimate1.addComponent(tfDetails3);
    layoutApplicantEstimate1.addComponent(tfDetailVal3);
    layoutApplicantEstimate2.addComponent(tfDynamicAppEstimate1);
    layoutApplicantEstimate2.addComponent(tfDynamicAppEstimate2);
    layoutApplicantEstimate2.addComponent(tfDynamicAppEstimate3);
    layoutApplicantEstimate2.addComponent(tfDynamicAppEstimate4);
    layoutApplicantEstimate3.addComponent(tfDynamicAppEstimate5);
    layoutApplicantEstimate3.addComponent(tfDynamicAppEstimate6);
    layoutApplicantEstimate3.addComponent(tfDynamicAppEstimate7);
    layoutApplicantEstimate3.addComponent(tfDynamicAppEstimate8);
    layoutApplicantEstimate4.addComponent(lblTotal);
    layoutApplicantEstimate4.addComponent(tfTotalval);

    layoutApplicantEstimate.addComponent(btnDynamicAppEstimate);
    layoutApplicantEstimate.setComponentAlignment(btnDynamicAppEstimate, Alignment.TOP_RIGHT);
    layoutApplicantEstimate.addComponent(layoutApplicantEstimate1);
    layoutApplicantEstimate.addComponent(layoutApplicantEstimate2);
    layoutApplicantEstimate.addComponent(layoutApplicantEstimate3);
    layoutApplicantEstimate.addComponent(layoutApplicantEstimate4);
    layoutApplicantEstimate2.setVisible(true);
    layoutApplicantEstimate3.setVisible(true);
    layoutApplicantEstimate.setMargin(true);
    tfDynamicAppEstimate2.setValue("0.00");
    tfDetailVal2.setValue("0.00");
    tfDetailVal1.setValue("0.00");
    tfDynamicAppEstimate4.setValue("0.00");
    tfDynamicAppEstimate6.setValue("0.00");
    tfDynamicAppEstimate8.setValue("0.00");
    tfDetailVal3.setValue("0.00");
    tfTotalval.setImmediate(true);
    tfTotalval.addBlurListener(new BlurListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void blur(BlurEvent event) {
            // TODO Auto-generated method stub
            BigDecimal appEstimate = 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");
            BigDecimal test6 = new BigDecimal("0.00");

            try {
                test = new BigDecimal(tfDetailVal1.getValue());

            } catch (Exception e) {
                test = new BigDecimal("0.00");
            }
            try {
                test1 = new BigDecimal(tfDetailVal2.getValue());
            } catch (Exception e) {
                test1 = new BigDecimal("0.00");
            }
            try {
                test2 = new BigDecimal(tfDetailVal3.getValue());
            } catch (Exception e) {
                test2 = new BigDecimal("0.00");
            }
            try {
                test3 = new BigDecimal(tfDynamicAppEstimate2.getValue());

            } catch (Exception e) {
                test3 = new BigDecimal("0.00");
            }
            try {
                test4 = new BigDecimal(tfDynamicAppEstimate4.getValue());
            } catch (Exception e) {
                test4 = new BigDecimal("0.00");
            }
            try {
                test5 = new BigDecimal(tfDynamicAppEstimate6.getValue());
            } catch (Exception e) {
                test4 = new BigDecimal("0.00");
            }
            try {
                test6 = new BigDecimal(tfDynamicAppEstimate8.getValue());
            } catch (Exception e) {
                test4 = new BigDecimal("0.00");
            }
            appEstimate = appEstimate.add(test).add(test1).add(test2).add(test3).add(test4).add(test5)
                    .add(test6);
            tfTotalval.setValue(appEstimate.toString());
            tfAppEstimate.setValue(appEstimate.toString());
        }
    });

    // for applicant reasonable
    layoutApplicantReasonable.setSpacing(true);
    layoutApplicantReasonable1.setSpacing(true);
    layoutApplicantReasonable2.setSpacing(true);
    layoutApplicantReasonable1.setColumns(2);
    layoutApplicantReasonable2.setColumns(2);
    layoutApplicantReasonable1.setVisible(false);
    layoutApplicantReasonable2.addComponent(lblAppReasonable);
    layoutApplicantReasonable2.addComponent(slAppReasonable);
    layoutApplicantReasonable1.addComponent(lblReasonEstimate);
    layoutApplicantReasonable1.addComponent(tfReasonEstimateVal);
    layoutApplicantReasonable1.addComponent(lblDtlsAppReasonable);
    layoutApplicantReasonable1.addComponent(tfDtlsAppReasonable);
    layoutApplicantReasonable1.addComponent(tfDetailsReason1);
    layoutApplicantReasonable1.addComponent(tfDetailReasonVal1);
    layoutApplicantReasonable1.addComponent(tfDetailsReason2);
    layoutApplicantReasonable1.addComponent(tfDetailReasonVal2);
    layoutApplicantReasonable1.addComponent(tfDetailsReason3);
    layoutApplicantReasonable1.addComponent(tfDetailReasonVal3);
    layoutApplicantReasonable1.addComponent(tfDynamicAppReason1);
    layoutApplicantReasonable1.addComponent(tfDynamicAppReason2);
    layoutApplicantReasonable1.addComponent(tfDynamicAppReason3);
    layoutApplicantReasonable1.addComponent(tfDynamicAppReason4);
    layoutApplicantReasonable1.addComponent(lblReasonTotal);
    layoutApplicantReasonable1.addComponent(tfReasonTotalval);
    tfDynamicAppReason1.setVisible(false);
    tfDynamicAppReason2.setVisible(false);
    tfDynamicAppReason3.setVisible(false);
    tfDynamicAppReason4.setVisible(false);

    layoutApplicantReasonable.addComponent(btnDynamicAppReason);
    layoutApplicantReasonable.setComponentAlignment(btnDynamicAppReason, Alignment.TOP_RIGHT);
    layoutApplicantReasonable.addComponent(layoutApplicantReasonable2);
    layoutApplicantReasonable.addComponent(layoutApplicantReasonable1);
    layoutApplicantReasonable.setMargin(true);

    tfDetailReasonVal1.setValue("0.00");
    tfDetailReasonVal2.setValue("0.00");
    tfDetailReasonVal3.setValue("0.00");
    tfDynamicAppReason2.setValue("0.00");
    tfDynamicAppReason4.setValue("0.00");
    tfReasonTotalval.setImmediate(true);
    tfReasonTotalval.addBlurListener(new BlurListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void blur(BlurEvent event) {
            // TODO Auto-generated method stubBigDecimal appEstimate =new
            BigDecimal appReason = 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(tfDetailReasonVal1.getValue());

            } catch (Exception e) {
                test = new BigDecimal("0.00");
            }
            try {
                test1 = new BigDecimal(tfDetailReasonVal2.getValue());
            } catch (Exception e) {
                test1 = new BigDecimal("0.00");
            }
            try {
                test2 = new BigDecimal(tfDetailReasonVal3.getValue());
            } catch (Exception e) {
                test2 = new BigDecimal("0.00");
            }
            try {
                test3 = new BigDecimal(tfDynamicAppReason2.getValue());

            } catch (Exception e) {
                test3 = new BigDecimal("0.00");
            }
            try {
                test4 = new BigDecimal(tfDynamicAppReason2.getValue());
            } catch (Exception e) {
                test4 = new BigDecimal("0.00");
            }
            appReason = appReason.add(test).add(test1).add(test2).add(test3).add(test4);
            tfReasonTotalval.setValue(appReason.toString());
            tfReasonEstimateVal.setValue(appReason.toString());
        }
    });

    slAppReasonable.setImmediate(true);
    slAppReasonable.setNullSelectionAllowed(false);
    slAppReasonable.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {
            if (slAppReasonable.getValue() != null) {
                if (slAppReasonable.getValue().equals(Common.NO_DESC)) {
                    layoutApplicantReasonable1.setVisible(true);
                    btnDynamicAppReason.setVisible(true);
                } else {
                    layoutApplicantReasonable1.setVisible(false);
                    btnDynamicAppReason.setVisible(false);
                }
            }
        }
    });
    /*tfEvaluationNumber.addValidator(new IntegerValidator("Enter numbers only"));
    tfEvaluationNumber.addBlurListener(new SaarcValidate(tfEvaluationNumber));*/
    tfEvaluationNumber.setImmediate(true);
    tfEvaluationNumber.addBlurListener(new BlurListener() {

        private static final long serialVersionUID = 1L;

        public void blur(BlurEvent event) {
            // TODO Auto-generated method stub
            if (!tfEvaluationNumber.isReadOnly()) {
                tfEvaluationNumber.setComponentError(null);
                try {
                    tfEvaluationNumber.setComponentError(null);
                    String evalno = tfEvaluationNumber.getValue().toString();
                    int count = beanEvaluation.getEvalNoCount(evalno);

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

                        if (count == 0) {

                            tfEvaluationNumber.setComponentError(null);

                        } else {

                            tfEvaluationNumber
                                    .setComponentError(new UserError("Evaluation number is already Exist"));

                        }
                    }
                } catch (Exception e) {

                }
            }
        }
    });
    // Earth quake

    layoutEarthquake1.setSpacing(true);
    layoutEarthquake1.setColumns(4);
    layoutEarthquake1.addComponent(slEarthQuake);
    layoutEarthquake1.addComponent(tfDynamicEarthquake1);
    layoutEarthquake1.addComponent(tfDynamicEarthquake2);
    tfDynamicEarthquake1.setVisible(false);
    tfDynamicEarthquake2.setVisible(false);

    layoutEarthquake.addComponent(btnDynamicEarthQuake);
    layoutEarthquake.setComponentAlignment(btnDynamicEarthQuake, Alignment.TOP_RIGHT);
    layoutEarthquake.addComponent(layoutEarthquake1);
    layoutEarthquake.setMargin(true);
    // cost of construction
    layoutCost.setColumns(2);
    layoutCostConstruction1.setColumns(2);
    layoutCostConstruction2.setColumns(2);
    layoutCostConstruction.setSpacing(true);
    layoutCost.setSpacing(true);
    layoutCostConstruction2.setSpacing(true);
    layoutCostConstruction1.setSpacing(true);
    layoutCostConstruction1.setSpacing(true);
    layoutCost.addComponent(lblCostConst);
    layoutCost.addComponent(tfCostConstruction);

    layoutCostConstruction1.addComponent(tfDynamicCostConst1);
    layoutCostConstruction1.addComponent(tfDynamicCostConst2);
    layoutCostConstruction1.addComponent(tfDynamicCostConst3);
    layoutCostConstruction1.addComponent(tfDynamicCostConst4);
    layoutCostConstruction1.addComponent(tfDynamicCostConst5);
    layoutCostConstruction1.addComponent(tfDynamicCostConst6);

    layoutCostConstruction2.addComponent(tfDynamicCostConst7);
    layoutCostConstruction2.addComponent(tfDynamicCostConst8);
    layoutCostConstruction2.addComponent(tfDynamicCostConst9);
    layoutCostConstruction2.addComponent(tfDynamicCostConst10);
    layoutCostConstruction1.setVisible(false);
    layoutCostConstruction2.setVisible(false);

    layoutCostConstruction.addComponent(btnDynamicCostConst);
    layoutCostConstruction.setComponentAlignment(btnDynamicCostConst, Alignment.TOP_RIGHT);
    layoutCostConstruction.addComponent(layoutCost);
    layoutCostConstruction.addComponent(layoutCostConstruction1);
    layoutCostConstruction.addComponent(layoutCostConstruction2);
    layoutCostConstruction.setMargin(true);

    // for Guideline area
    layoutGuideline.addComponent(btnAddGuideline);
    layoutGuideline.setComponentAlignment(btnAddGuideline, Alignment.TOP_RIGHT);
    layoutGuideline.setMargin(true);
    layoutGuideline.addComponent(new ComponentIterGuideline("Land", "", "", ""));
    layoutGuideline.addComponent(new ComponentIterGuideline("Building", "", "", ""));
    // for guide line reference
    streetLayout.addComponent(slStreetSerNo);
    streetLayout.addComponent(tfStreetName);

    layoutGuidelineReference1.setColumns(4);
    layoutGuidelineReference1.setSpacing(true);
    layoutGuidelineReference1.addComponent(tfZone);
    layoutGuidelineReference1.addComponent(tfSRO);
    layoutGuidelineReference1.addComponent(tfVillage);
    layoutGuidelineReference1.addComponent(tfRevnueDist);
    layoutGuidelineReference1.addComponent(tfTalukName);
    layoutGuidelineReference1.addComponent(streetLayout);
    layoutGuidelineReference1.addComponent(tfGuidelineValue);
    layoutGuidelineReference1.addComponent(tfGuidelineValueMatric);
    layoutGuidelineReference1.addComponent(slClassification);
    layoutGuidelineReference1.setMargin(true);

    layoutGuidelineReference.setSpacing(true);
    layoutGuidelineReference.addComponent(layoutGuidelineReference1);

    // add components in main panel
    accordion.setWidth("100%");

    layoutEvaluationDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutEvaluationDetails), "Evaluation Details");
    layoutOwnerDetails.setStyleName("bluebar");
    layoutAssetDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutAssetOwner), "Owner Details/Asset Details");

    layoutNormalLegal.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutNormalLegal), "Document Details");

    panelAdjoinProperties.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(panelAdjoinProperties), "Adjoining Properties");

    panelDimension.setStyleName("bluebar");
    accordion.addTab(panelDimension, "Dimension");

    layoutmachingBoundary.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutmachingBoundary),
            "Matching of Boundaires And Tenure/Occupancy Details");

    layoutNoofRooms.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutNoofRooms), "No. of Rooms/No. of Floors");

    layoutAreaDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutAreaDetails), "Area Details of the Property");

    layoutPlanApproval.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPlanApproval), "Details of Plan Approval");

    layoutLandConstValuation1.setStyleName("bluebar");
    accordion.addTab(layoutLandConstValuation1, "Valuation of Land/under Construcation Building");

    panelBuildSpecfication.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(panelBuildSpecfication), "Specfication of the building");

    layoutApplicantEstimate.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutApplicantEstimate), "Applicant Estimate");

    layoutApplicantReasonable.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutApplicantReasonable), "Applicant Reasonable");

    layoutGuideline.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutGuideline), "Guideline Details");

    layoutGuidelineReference.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutGuidelineReference), "Guideline Reference Details");
    layoutPropertyValue.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPropertyValue), "Property Value Details");

    layoutPlintharea.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPlintharea), "Plinth Area Details");

    layoutConstruction.setStyleName("bluebar");
    layoutViolation.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutConstViolation), "Construction/Violation Details");
    layoutEarthquake.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutEarthquake), "Earth Quake Details");

    layoutCostConstruction.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutCostConstruction), "Cost of Construction");
    this.accordion.addListener(new SelectedTabChangeListener() {
        public void selectedTabChange(SelectedTabChangeEvent event) {
            if (event.getTabSheet().getSelectedTab().equals(panelDimension)) {
                Iterator<Component> myComps = panelDimension.getComponentIterator();
                BigDecimal siteArea = new BigDecimal(0.00);
                while (myComps.hasNext()) {
                    final Component component = myComps.next();
                    int i = 1;

                    if (component instanceof ComponentIterDimensionofPlot) {

                        ComponentIterDimensionofPlot mycomponent = (ComponentIterDimensionofPlot) component;
                        List<TPemCmPropDimension> getList = mycomponent.getDimensionPropertyList();

                        try {
                            List<String> mylist = mycomponent.getLeastValaue();
                            siteArea = siteArea.add(new BigDecimal(mylist.get(0).replaceAll("[^\\d.]", "")));
                            tfNorthandSouth.setValue(mylist.get(1));
                            tfSiteArea.setValue(siteArea.toString());
                        } catch (Exception e) {

                            logger.info("Error-->" + e);
                        }
                    }
                }
                BigDecimal site = new BigDecimal(0.00);
                BigDecimal fair = new BigDecimal(1.00);
                BigDecimal salbale = new BigDecimal(435.60);
                try {
                    site = new BigDecimal(tfSiteArea.getValue().replaceAll("[^\\d.]", ""));
                } catch (Exception e) {
                    site = new BigDecimal("0.00");

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

                }
            }

        }
    });

    layoutMainForm.addComponent(PanelGenerator.createPanel(accordion));

    layoutMainForm.setMargin(true);
    layoutMainForm.setSpacing(true);
    // for main panel
    layoutButton2.setSpacing(true);
    btnSave.setStyleName("savebt");
    btnCancel.setStyleName("cancelbt");
    //saveExcel.addStyleName("downloadbt");
    btnSubmit.setStyleName("submitbt");
    layoutButton2.addComponent(btnSave);
    layoutButton2.addComponent(btnSubmit);
    //   layoutButton2.addComponent(saveExcel);
    layoutButton2.addComponent(btnCancel);

    btnSave.setVisible(false);
    btnCancel.setVisible(false);
    btnSubmit.setVisible(false);
    //saveExcel.setVisible(false);
    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);

    // Initaited the Label Function here by Hohul
    lblTableTitle = new Label();
    lblSaveNotification = new Label();
    lblSaveNotification.setContentMode(ContentMode.HTML);
    lblNotificationIcon = new Label();
    lblTableTitle.setValue("<B>&nbsp;&nbsp;Action:</B>");
    lblTableTitle.setContentMode(ContentMode.HTML);
    lblFormTittle = new Label();
    lblFormTittle.setContentMode(ContentMode.HTML);
    lblFormTittle.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;Home");
    lblFormTitle1 = new Label();
    lblFormTitle1.setContentMode(ContentMode.HTML);
    lblFormTitle1.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;");
    lblAddEdit = new Label();
    lblAddEdit.setContentMode(ContentMode.HTML);

    // Button Back declaration by Hohul
    btnBack = new Button("Home", this);
    btnBack.setStyleName("link");

    // Bread Scrumbs initiated here by Hohul

    hlBreadCrumbs = new HorizontalLayout();
    hlBreadCrumbs.addComponent(lblFormTitle1);
    hlBreadCrumbs.addComponent(btnBack);
    hlBreadCrumbs.setComponentAlignment(btnBack, Alignment.TOP_CENTER);
    hlBreadCrumbs.addComponent(lblAddEdit);
    hlBreadCrumbs.setComponentAlignment(lblAddEdit, Alignment.MIDDLE_CENTER);
    hlBreadCrumbs.setVisible(false);

    mainPanel.addComponent(layoutMainForm);
    mainPanel.setVisible(false);

    // for search panel   // for search panel
    // Added by Hohul ----->  For Search Panel Layouts
    FormLayout flSearchEvalNumber = new FormLayout();
    flSearchEvalNumber.addComponent(tfSearchEvalNumber);

    FormLayout flSearchBankbranch = new FormLayout();
    flSearchBankbranch.addComponent(tfSearchBankbranch);

    FormLayout flSearchCustomer = new FormLayout();
    flSearchCustomer.addComponent(tfSearchCustomer);

    HorizontalLayout hlSearchComponentLayout = new HorizontalLayout();
    hlSearchComponentLayout.addComponent(flSearchEvalNumber);
    hlSearchComponentLayout.addComponent(flSearchBankbranch);
    hlSearchComponentLayout.addComponent(flSearchCustomer);
    hlSearchComponentLayout.setSpacing(true);
    hlSearchComponentLayout.setMargin(true);

    //Initialization and properties for btnDownload      
    btnDownload = new Button("Download");
    //btnDownload.setDescription("Download");
    btnDownload.addStyleName("downloadbt");
    btnDownload.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            //  UI.getCurrent()..clearDashboardButtonBadge();
            event.getButton().removeStyleName("unread");
            if (notifications != null && notifications.getUI() != null)
                notifications.close();
            else {
                buildNotifications(event);
                UI.getCurrent().addWindow(notifications);
                notifications.focus();
                ((VerticalLayout) UI.getCurrent().getContent())
                        .addLayoutClickListener(new LayoutClickListener() {
                            @Override
                            public void layoutClick(LayoutClickEvent event) {
                                notifications.close();
                                ((VerticalLayout) UI.getCurrent().getContent()).removeLayoutClickListener(this);
                            }
                        });
            }

        }
    });

    hlFileDownloadLayout = new HorizontalLayout();
    hlFileDownloadLayout.setSpacing(true);
    hlFileDownloadLayout.addComponent(btnDownload);
    hlFileDownloadLayout.setComponentAlignment(btnDownload, Alignment.MIDDLE_CENTER);

    VerticalLayout vlSearchandResetButtonLAyout = new VerticalLayout();
    vlSearchandResetButtonLAyout.setSpacing(true);
    vlSearchandResetButtonLAyout.addComponent(btnReset);
    vlSearchandResetButtonLAyout.setWidth("100");
    vlSearchandResetButtonLAyout.addStyleName("topbarthree");
    vlSearchandResetButtonLAyout.setMargin(true);

    HorizontalLayout hlSearchComponentandButtonLayout = new HorizontalLayout();
    hlSearchComponentandButtonLayout.setSizeFull();
    hlSearchComponentandButtonLayout.setSpacing(true);
    hlSearchComponentandButtonLayout.addComponent(hlSearchComponentLayout);
    hlSearchComponentandButtonLayout.setComponentAlignment(hlSearchComponentLayout, Alignment.MIDDLE_LEFT);
    hlSearchComponentandButtonLayout.addComponent(vlSearchandResetButtonLAyout);
    hlSearchComponentandButtonLayout.setComponentAlignment(vlSearchandResetButtonLAyout,
            Alignment.MIDDLE_RIGHT);
    hlSearchComponentandButtonLayout.setExpandRatio(vlSearchandResetButtonLAyout, 1);
    final VerticalLayout vlSearchComponentandButtonLayout = new VerticalLayout();
    vlSearchComponentandButtonLayout.setSpacing(true);
    vlSearchComponentandButtonLayout.setSizeFull();
    vlSearchComponentandButtonLayout.addComponent(hlSearchComponentandButtonLayout);

    /*layoutSearch.addComponent(tfSearchEvalNumber);
    layoutSearch.addComponent(tfSearchBankbranch);
    layoutSearch.addComponent(tfSearchCustomer);
    //layoutSearch.addComponent(btnSearch);
    layoutSearch.addComponent(btnReset);
    //layoutSearch.setComponentAlignment(btnSearch, Alignment.BOTTOM_LEFT);
    layoutSearch.setComponentAlignment(btnReset, Alignment.BOTTOM_LEFT);
    //btnSearch.addStyleName("default");
    */ btnReset.addStyleName("resetbt");
    tfSearchCustomer.setImmediate(true);
    tfSearchCustomer.addListener(new TextChangeListener() {
        private static final long serialVersionUID = 1L;
        SimpleStringFilter filter = null;

        public void textChange(TextChangeEvent event) {
            Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
            if (filter != null)
                f.removeContainerFilter(filter);

            filter = new SimpleStringFilter("custName", event.getText(), true, false);

            f.addContainerFilter(filter);
            total = f.size();
            tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
        }
    });
    tfSearchEvalNumber.setImmediate(true);
    tfSearchEvalNumber.addListener(new TextChangeListener() {
        private static final long serialVersionUID = 1L;
        SimpleStringFilter filter = null;

        public void textChange(TextChangeEvent event) {
            Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
            if (filter != null)
                f.removeContainerFilter(filter);

            filter = new SimpleStringFilter("evalNo", event.getText(), true, false);

            f.addContainerFilter(filter);
            total = f.size();
            tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
        }
    });
    tfSearchBankbranch.setImmediate(true);
    tfSearchBankbranch.addValueChangeListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;
        Filter filter = null;

        @Override
        public void valueChange(ValueChangeEvent event) {
            // TODO Auto-generated method stub

            try {
                String strBankBranch = tfSearchBankbranch.getValue().toString();
                Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
                if (filter != null)
                    f.removeContainerFilter(filter);

                filter = new Compare.Equal("bankBranch", strBankBranch);
                f.addContainerFilter(filter);
                f.addContainerFilter(filter);
                total = f.size();
                tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
            } catch (Exception e) {
            }
        }

    });

    searchPanel.addComponent(PanelGenerator.createPanel(vlSearchComponentandButtonLayout));
    searchPanel.setMargin(true);

    // Add Layout table panel by Hohul

    HorizontalLayout flTableCaption = new HorizontalLayout();
    flTableCaption.addComponent(lblTableTitle);
    flTableCaption.setComponentAlignment(lblTableTitle, Alignment.MIDDLE_CENTER);
    flTableCaption.addStyleName("lightgray");
    flTableCaption.setHeight("25px");
    flTableCaption.setWidth("60px");
    lblNoofRecords = new Label(" ", ContentMode.HTML);
    lblNoofRecords.addStyleName("lblfooter");

    HorizontalLayout hlTableTittleLayout = new HorizontalLayout();
    hlTableTittleLayout.addComponent(flTableCaption);
    hlTableTittleLayout.addComponent(btnAdd);
    hlTableTittleLayout.addComponent(btnEdit);
    hlTableTittleLayout.addComponent(btnView);
    hlTableTittleLayout.setHeight("25px");
    hlTableTittleLayout.setSpacing(true);

    HorizontalLayout hlTableTitleandCaptionLayout = new HorizontalLayout();
    hlTableTitleandCaptionLayout.addStyleName("topbarthree");
    hlTableTitleandCaptionLayout.setWidth("100%");
    hlTableTitleandCaptionLayout.addComponent(hlTableTittleLayout);
    hlTableTitleandCaptionLayout.addComponent(hlFileDownloadLayout);
    hlTableTitleandCaptionLayout.setComponentAlignment(hlFileDownloadLayout, Alignment.MIDDLE_RIGHT);
    hlTableTitleandCaptionLayout.setHeight("28px");

    // for table panel
    btnAdd.addStyleName("add");
    btnEdit.addStyleName("editbt");
    btnView.addStyleName("view");
    btnView.setEnabled(false);

    hlAddEditLayout.addStyleName("topbarthree");
    hlAddEditLayout.setWidth("100%");
    hlAddEditLayout.addComponent(hlTableTitleandCaptionLayout);
    hlAddEditLayout.setHeight("28px");

    // Added Action Label to Table
    layoutTable.addComponent(hlAddEditLayout);
    layoutTable.setComponentAlignment(hlAddEditLayout, Alignment.TOP_LEFT);
    layoutTable.addComponent(tblEvalDetails);

    tablePanel.addComponent(layoutTable);
    tablePanel.setWidth("100%");
    tablePanel.setMargin(true);

    layoutPage.addComponent(mainPanel);
    layoutPage.addComponent(searchPanel);
    layoutPage.addComponent(tablePanel);

    // Added labels and titles to respective Location by Hohul

    HorizontalLayout hlNotificationLayout = new HorizontalLayout();
    hlNotificationLayout.addComponent(lblNotificationIcon);
    hlNotificationLayout.setComponentAlignment(lblNotificationIcon, Alignment.MIDDLE_LEFT);
    hlNotificationLayout.addComponent(lblSaveNotification);
    hlNotificationLayout.setComponentAlignment(lblSaveNotification, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(lblFormTittle);
    hlHeaderLayout.setComponentAlignment(lblFormTittle, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(hlBreadCrumbs);
    hlHeaderLayout.setComponentAlignment(hlBreadCrumbs, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(hlNotificationLayout);
    hlHeaderLayout.setComponentAlignment(hlNotificationLayout, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.MIDDLE_RIGHT);

    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);

    // load Component list values
    loadComponentListValues();

    //setTableProperties();
    populateAndConfig(false);
}

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

@SuppressWarnings("deprecation")
void buildView(VerticalLayout layoutPage, HorizontalLayout hlHeaderLayout) {
    // for component width
    hlHeaderLayout.removeAllComponents();
    setComponentStyle();/*w w  w  . j  a v  a2s. c  o  m*/

    tblEvalDetails = new Table();
    tblEvalDetails.setStyleName(Runo.TABLE_SMALL);
    tblEvalDetails.setPageLength(14);
    tblEvalDetails.setSizeFull();
    tblEvalDetails.setFooterVisible(true);
    tblEvalDetails.setSelectable(true);
    tblEvalDetails.setImmediate(true);
    tblEvalDetails.setColumnCollapsingAllowed(true);

    // for evaluation details
    tfEvaluationPurpose.setValue("Collateral Security to the Bank");
    slStreetSerNo.addItem("STREET NAME");
    slStreetSerNo.addItem("SURVEY NO");
    slStreetSerNo.setNullSelectionAllowed(false);

    tfEvaluationNumber.setRequired(true);
    tfBankBranch.setRequired(true);
    dfDateofValuation.setRequired(true);
    tfEvaluationPurpose.setRequired(true);
    layoutEvaluationDetails1.setColumns(4);

    layoutEvaluationDetails1.addComponent(tfEvaluationNumber);
    layoutEvaluationDetails1.addComponent(tfBankBranch);
    layoutEvaluationDetails1.addComponent(tfEvaluationPurpose);
    layoutEvaluationDetails1.addComponent(tfValuatedBy);
    layoutEvaluationDetails1.addComponent(dfDateofValuation);
    layoutEvaluationDetails1.addComponent(dfVerifiedDate);
    layoutEvaluationDetails1.addComponent(tfVerifiedBy);
    layoutEvaluationDetails1.addComponent(tfDynamicEvaluation1);
    layoutEvaluationDetails1.addComponent(tfDynamicEvaluation2);
    tfDynamicEvaluation1.setVisible(false);
    tfDynamicEvaluation2.setVisible(false);
    layoutEvaluationDetails1.setSpacing(true);
    layoutEvaluationDetails1.setMargin(true);

    layoutEvaluationDetails.addComponent(btnDynamicEvaluation1);
    layoutEvaluationDetails.setComponentAlignment(btnDynamicEvaluation1, Alignment.TOP_RIGHT);
    layoutEvaluationDetails.addComponent(layoutEvaluationDetails1);
    // for customer details
    tfDynamicCustomer1.setVisible(false);
    tfDynamicCustomer2.setVisible(false);
    layoutCustomerDetail1.setColumns(4);
    //layoutCustomerDetail.setCaption("Customer Details");
    layoutCustomerDetail1.addComponent(tfCustomerName);
    layoutCustomerDetail1.addComponent(slPropertyDesc);
    layoutCustomerDetail1.addComponent(tfDynamicCustomer1);
    layoutCustomerDetail1.addComponent(tfDynamicCustomer2);
    layoutCustomerDetail1.setSpacing(true);
    layoutCustomerDetail1.setMargin(true);

    layoutCustomerDetail.addComponent(btnDynamicCustomer);
    layoutCustomerDetail.setComponentAlignment(btnDynamicCustomer, Alignment.TOP_RIGHT);
    layoutCustomerDetail.addComponent(layoutCustomerDetail1);

    // for asset details
    VerticalLayout formAsset1 = new VerticalLayout();
    VerticalLayout formAsset2 = new VerticalLayout();
    VerticalLayout formAsset3 = new VerticalLayout();
    VerticalLayout formAsset4 = new VerticalLayout();
    formAsset1.setSpacing(true);
    formAsset2.setSpacing(true);
    formAsset4.setSpacing(true);

    formAsset1.addComponent(tfCustomerName);
    formAsset1.addComponent(tfLandMark);
    formAsset1.addComponent(slPropertyDesc);
    formAsset2.addComponent(tfCustomerAddr);
    formAsset3.addComponent(tfPropertyAddress);
    formAsset3.addComponent(chkSameAddress);
    formAsset4.addComponent(tfDynamicAsset1);
    formAsset4.addComponent(tfDynamicAsset2);
    tfDynamicAsset1.setVisible(false);
    tfDynamicAsset2.setVisible(false);

    chkSameAddress.setImmediate(true);
    chkSameAddress.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {

            if (chkSameAddress.getValue().equals(true)) {
                tfPropertyAddress.setValue(tfCustomerAddr.getValue());

            } else {
                tfPropertyAddress.setValue("");
            }
        }
    });

    layoutAssetDetails1.setSpacing(true);
    layoutAssetDetails1.setColumns(4);
    layoutAssetDetails1.addComponent(formAsset1);
    layoutAssetDetails1.addComponent(formAsset2);
    layoutAssetDetails1.addComponent(formAsset3);
    layoutAssetDetails1.addComponent(formAsset4);
    layoutAssetDetails1.setMargin(true);

    layoutAssetDetails.addComponent(btnDynamicAsset);
    layoutAssetDetails.setComponentAlignment(btnDynamicAsset, Alignment.TOP_RIGHT);
    layoutAssetDetails.addComponent(layoutAssetDetails1);

    lblHeading = new Label("Owner Details");
    layoutAssetOwner.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutAssetOwner.addComponent(PanelGenerator.createPanel(layoutOwnerDetails));
    lblHeading = new Label("Asset Details");
    layoutAssetOwner.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutAssetOwner.addComponent(PanelGenerator.createPanel(layoutAssetDetails));

    //for Owner Details
    layoutOwnerDetails.addComponent(btnAddOwner);
    layoutOwnerDetails.setComponentAlignment(btnAddOwner, Alignment.TOP_RIGHT);
    layoutOwnerDetails1.setColumns(4);
    layoutOwnerDetails1.addComponent(new ComponentIterOwnerDetails("", ""));
    layoutOwnerDetails.addComponent(layoutOwnerDetails1);
    layoutOwnerDetails1.setSpacing(true);
    layoutOwnerDetails1.setMargin(true);

    // for document details
    panelNormalDocumentDetails.addComponent(btnAddNorDoc);
    panelNormalDocumentDetails.setComponentAlignment(btnAddNorDoc, Alignment.TOP_RIGHT);
    panelNormalDocumentDetails.addComponent(new ComponentIteratorNormlDoc(null, null, "", ""));
    panelNormalDocumentDetails.setMargin(true);
    panelLegalDocumentDetails.addComponent(btnAddLegalDoc);
    panelLegalDocumentDetails.setComponentAlignment(btnAddLegalDoc, Alignment.TOP_RIGHT);
    panelLegalDocumentDetails.addComponent(new ComponentIteratorLegalDoc("", "", null));
    panelLegalDocumentDetails.setMargin(true);
    layoutNormalLegal.addComponent(PanelGenerator.createPanel(panelNormalDocumentDetails));
    lblHeading = new Label("Legal Documents");
    layoutNormalLegal.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutNormalLegal.addComponent(PanelGenerator.createPanel(panelLegalDocumentDetails));
    layoutNormalLegal.setMargin(true);

    // for adjoin properties
    //panelAdjoinProperties.setCaption("Adjoining Properties");
    panelAdjoinProperties.addComponent(btnAddAdjoinProperty);
    panelAdjoinProperties.setComponentAlignment(btnAddAdjoinProperty, Alignment.BOTTOM_RIGHT);
    panelAdjoinProperties.addComponent(new ComponentIteratorAdjoinProperty(null, true, true, true));

    // for dimensions
    //panelDimension.setCaption("Dimensions");
    panelDimension.addComponent(btnAddDimension);
    panelDimension.setComponentAlignment(btnAddDimension, Alignment.BOTTOM_RIGHT);
    panelDimension.addComponent(new ComponentIterDimensionofPlot(null, true, true, true));

    panelNormalDocumentDetails.setWidth("100%");
    panelLegalDocumentDetails.setWidth("100%");
    panelAdjoinProperties.setStyleName("width:100%;display:block;");

    // for
    layoutmachingBoundary1.setSpacing(true);
    tfDynamicmatching1.setVisible(true);
    tfDynamicmatching2.setVisible(true);
    layoutmachingBoundary2.addComponent(btnDynamicmatching);
    layoutmachingBoundary2.setComponentAlignment(btnDynamicmatching, Alignment.TOP_RIGHT);
    layoutmachingBoundary1.setSpacing(true);
    layoutmachingBoundary1.addComponent(slMatchingBoundary);
    layoutmachingBoundary1.addComponent(slPlotDemarcated);
    layoutmachingBoundary1.addComponent(slApproveLandUse);
    layoutmachingBoundary1.addComponent(slTypeofProperty);
    layoutmachingBoundary1.addComponent(tfDynamicmatching1);
    layoutmachingBoundary1.addComponent(tfDynamicmatching2);
    layoutmachingBoundary1.setSpacing(true);
    layoutmachingBoundary1.setMargin(true);

    // tenure/occupancy details
    layoutTenureOccupay.setSpacing(true);
    layoutTenureOccupay1.setSpacing(true);
    layoutTenureOccupay2.addComponent(btnDynamicTenure);
    layoutTenureOccupay2.setComponentAlignment(btnDynamicTenure, Alignment.TOP_RIGHT);
    layoutTenureOccupay.setColumns(2);
    layoutTenureOccupay1.addComponent(tfStatusofTenure);
    layoutTenureOccupay1.addComponent(slOwnedorRent);
    layoutTenureOccupay1.addComponent(tfNoOfYears);
    layoutTenureOccupay1.addComponent(tfRelationship);
    layoutTenureOccupay1.addComponent(tfDynamicTenure1);
    layoutTenureOccupay1.addComponent(tfDynamicTenure2);
    layoutmachingBoundary2.addComponent(layoutmachingBoundary1);
    layoutTenureOccupay2.addComponent(layoutTenureOccupay1);
    layoutTenureOccupay.addComponent(PanelGenerator.createPanel(layoutmachingBoundary2));
    layoutTenureOccupay.addComponent(PanelGenerator.createPanel(layoutTenureOccupay2));
    tfDynamicTenure1.setVisible(false);
    tfDynamicTenure2.setVisible(false);
    layoutmachingBoundary1.setMargin(true);
    layoutTenureOccupay1.setMargin(true);
    layoutmachingBoundary.addComponent(layoutTenureOccupay);
    layoutTenureOccupay1.setMargin(true);
    layoutmachingBoundary.setMargin(true);

    // for no of rooms
    layoutNoofRooms2.addComponent(btnDynamicRooms);
    layoutNoofRooms2.setComponentAlignment(btnDynamicRooms, Alignment.TOP_RIGHT);
    layoutNoofRooms2.setMargin(true);
    layoutNoofRooms1.addComponent(tfNoofRooms);
    layoutNoofRooms1.addComponent(tfLivingDining);
    layoutNoofRooms1.addComponent(tfBedRooms);
    layoutNoofRooms1.addComponent(tfKitchen);
    layoutNoofRooms1.addComponent(tfToilets);
    layoutNoofRooms1.addComponent(tfDynamicRooms1);
    layoutNoofRooms1.addComponent(tfDynamicRooms2);
    tfDynamicRooms1.setVisible(false);
    tfDynamicRooms2.setVisible(false);
    layoutNoofRooms1.setSpacing(true);
    layoutNoofRooms2.addComponent(layoutNoofRooms1);
    // no of floors
    layoutNoofFloors.setColumns(2);
    layoutNoofFloors2.setMargin(true);
    layoutNoofFloors2.addComponent(btnDynamicFloor);
    layoutNoofFloors2.setComponentAlignment(btnDynamicFloor, Alignment.TOP_RIGHT);
    layoutNoofFloors1.addComponent(tfTotNoofFloors);
    layoutNoofFloors1.addComponent(tfPropertyLocated);
    layoutNoofFloors1.addComponent(tfApproxAgeofBuilding);
    layoutNoofFloors1.addComponent(tfResidualAgeofBuilding);
    layoutNoofFloors1.addComponent(slTypeofStructure);
    layoutNoofFloors1.addComponent(tfDynamicFloors1);
    layoutNoofFloors1.addComponent(tfDynamicFloors2);
    tfDynamicFloors1.setVisible(false);
    tfDynamicFloors2.setVisible(false);
    layoutNoofFloors1.setSpacing(true);
    layoutNoofFloors2.addComponent(layoutNoofFloors1);
    layoutNoofFloors.setSpacing(true);
    layoutNoofFloors.addComponent(PanelGenerator.createPanel(layoutNoofFloors2));
    layoutNoofFloors.addComponent(PanelGenerator.createPanel(layoutNoofRooms2));

    layoutNoofRooms.addComponent(layoutNoofFloors);
    layoutNoofRooms.setMargin(true);
    // construction
    //layoutConstruction.setCaption("Construction");
    layoutConstruction1.setSpacing(true);
    layoutConstruction1.setColumns(4);
    layoutConstruction1.addComponent(tfStageofConst);
    layoutConstruction1.addComponent(tfDynamicConstruction1);
    layoutConstruction1.addComponent(tfDynamicConstruction2);
    tfDynamicConstruction1.setVisible(false);
    tfDynamicConstruction2.setVisible(false);

    layoutConstruction.addComponent(btnDynamicConstruction);
    layoutConstruction.setComponentAlignment(btnDynamicConstruction, Alignment.TOP_RIGHT);
    layoutConstruction.addComponent(layoutConstruction1);
    layoutConstruction.setMargin(true);

    //for violation
    //layoutViolation.setCaption("Violation Details");
    layoutViolation1.setSpacing(true);
    layoutViolation1.setColumns(4);
    layoutViolation1.addComponent(tfAnyViolation);
    layoutViolation1.addComponent(tfDynamicViolation1);
    layoutViolation1.addComponent(tfDynamicViolation2);
    tfDynamicViolation1.setVisible(false);
    tfDynamicViolation2.setVisible(false);

    layoutViolation.addComponent(btnDynamicViolation);
    layoutViolation.setComponentAlignment(btnDynamicViolation, Alignment.TOP_RIGHT);
    layoutViolation.addComponent(layoutViolation1);
    layoutViolation.setMargin(true);

    layoutConstViolation.addComponent(PanelGenerator.createPanel(layoutConstruction));
    layoutConstViolation.addComponent(PanelGenerator.createPanel(layoutViolation));
    layoutConstViolation.setSpacing(true);
    layoutConstViolation.setMargin(true);
    // area details of the property
    //layoutAreaDetails.setCaption("Area Details of the Property");
    layoutAreaDetails1.setSpacing(true);
    layoutAreaDetails1.setColumns(4);
    layoutAreaDetails1.addComponent(tfSiteArea);
    layoutAreaDetails1.addComponent(tfPlinthArea);
    layoutAreaDetails1.addComponent(tfCarpetArea);
    layoutAreaDetails1.addComponent(tfSalableArea);
    layoutAreaDetails1.addComponent(tfRemarks);
    layoutAreaDetails1.addComponent(tfDynamicAreaDetail1);
    layoutAreaDetails1.addComponent(tfDynamicAreaDetail2);
    tfDynamicAreaDetail1.setVisible(false);
    tfDynamicAreaDetail2.setVisible(false);

    layoutAreaDetails.addComponent(btnDynamicAreaDetail);
    layoutAreaDetails.setComponentAlignment(btnDynamicAreaDetail, Alignment.TOP_RIGHT);
    layoutAreaDetails.addComponent(layoutAreaDetails1);
    layoutAreaDetails.setMargin(true);

    // valuation of land
    layoutValuationLand.setSpacing(true);
    layoutValuationLand1.setSpacing(true);
    layoutValuationLand1.addComponent(tfAreaofLand);
    layoutValuationLand1.addComponent(tfNorthandSouth);
    layoutValuationLand1.addComponent(tfMarketRate);
    layoutValuationLand1.addComponent(tfAdopetdMarketRate);
    layoutValuationLand1.addComponent(tfFairMarketRate);
    layoutValuationLand1.addComponent(tfRealizabletRate);
    layoutValuationLand1.addComponent(tfDistressRate);
    layoutValuationLand1.addComponent(tfGuidelineRate);
    layoutValuationLand1.addComponent(tfDynamicValuation1);
    layoutValuationLand1.addComponent(tfDynamicValuation2);
    tfDynamicValuation1.setVisible(false);
    tfDynamicValuation2.setVisible(false);
    tfAdopetdMarketRate.setRequired(true);
    layoutValuationLand.addComponent(btnDynamicValuation);
    layoutValuationLand.setComponentAlignment(btnDynamicValuation, Alignment.TOP_RIGHT);
    layoutValuationLand.addComponent(layoutValuationLand1);
    layoutValuationLand.setMargin(true);

    //property value
    layoutPropertyValue.setSpacing(true);
    layoutPropertyValue.setMargin(true);
    layoutPropertyValue1.setColumns(4);
    layoutPropertyValue1.setSpacing(true);
    layoutPropertyValue1.addComponent(tfRealizabletRate);
    layoutPropertyValue1.addComponent(tfDistressRate);
    layoutPropertyValue1.addComponent(tfGuidelineRate);
    layoutPropertyValue.addComponent(layoutPropertyValue1);

    // for details of plan approval
    layoutPlanApproval1.setColumns(4);
    formLand.addComponent(slLandandBuilding);
    formLand.addComponent(tfLandandBuilding);
    formBuilding.addComponent(slBuilding);
    formBuilding.addComponent(tfBuilding);

    layoutPlanApproval1.addComponent(formLand);
    layoutPlanApproval1.addComponent(formBuilding);
    layoutPlanApproval1.addComponent(tfPlanApprovedBy);
    layoutPlanApproval1.addComponent(dfLicenseFrom);
    layoutPlanApproval1.addComponent(slIsLicenceForced);
    layoutPlanApproval1.addComponent(slAllApprovalRecved);
    layoutPlanApproval1.addComponent(slConstAsperAppPlan);
    layoutPlanApproval1.addComponent(tfDynamicPlanApproval1);
    layoutPlanApproval1.addComponent(tfDynamicPlanApproval2);

    tfDynamicPlanApproval1.setVisible(false);
    tfDynamicPlanApproval2.setVisible(false);
    layoutPlanApproval1.setSpacing(true);
    layoutPlanApproval1.setMargin(true);
    layoutPlanApproval.addComponent(btnDynamicPlanApproval);
    layoutPlanApproval.setComponentAlignment(btnDynamicPlanApproval, Alignment.TOP_RIGHT);
    layoutPlanApproval.addComponent(layoutPlanApproval1);

    //details of the plan approval construction
    vlLand.addComponent(slLandBuildConst);
    vlLand.addComponent(tfLandBuildConst);
    vlBuilding.addComponent(slBuildConst);
    vlBuilding.addComponent(tfBuildConst);

    hlConstPlanApp1.addComponent(vlLand);
    hlConstPlanApp1.addComponent(vlBuilding);
    hlConstPlanApp1.addComponent(tfPlanApproveConst);
    hlConstPlanApp1.addComponent(slAllApprovalRecvedConst);
    hlConstPlanApp2.addComponent(slConstAsperAppPlanConst);
    hlConstPlanApp2.addComponent(tfDynamicConstPlanApp1);
    hlConstPlanApp2.addComponent(tfDynamicConstPlanApp2);

    tfDynamicConstPlanApp1.setVisible(false);
    tfDynamicConstPlanApp2.setVisible(false);
    hlConstPlanApp1.setSpacing(true);
    hlConstPlanApp1.setMargin(true);
    hlConstPlanApp2.setSpacing(true);
    hlConstPlanApp2.setMargin(true);
    vlConstPlanApp.addComponent(btnDynamicConstPlan);
    vlConstPlanApp.setComponentAlignment(btnDynamicConstPlan, Alignment.TOP_RIGHT);
    vlConstPlanApp.addComponent(hlConstPlanApp1);
    vlConstPlanApp.addComponent(hlConstPlanApp2);
    //valuation of Construction
    layoutConstValuation.setSpacing(true);
    layoutConstValuation1.setSpacing(true);
    layoutConstValuation1.addComponent(slTypeProperty);
    layoutConstValuation1.addComponent(slTypeStructure);
    layoutConstValuation1.addComponent(tfYearConstruction);
    layoutConstValuation1.addComponent(tfNoFloors);
    layoutConstValuation1.addComponent(tfConstQuality);
    layoutConstValuation1.addComponent(slAllapproval);
    layoutConstValuation1.addComponent(slIsConstruction);
    layoutConstValuation1.addComponent(tfReason);
    layoutConstValuation1.addComponent(tfDynamicConstval1);
    layoutConstValuation1.addComponent(tfDynamicConstval2);
    tfDynamicConstval1.setVisible(false);
    tfDynamicConstval2.setVisible(false);

    layoutConstValuation.addComponent(btnDynamicConstVal);
    layoutConstValuation.setComponentAlignment(btnDynamicConstVal, Alignment.TOP_RIGHT);
    layoutConstValuation.addComponent(layoutConstValuation1);
    layoutConstValuation.setMargin(true);
    layoutLandConstValuation.setSpacing(true);
    layoutLandConstValuation.setColumns(2);
    //layoutLandConstValuation.addComponent(PanelGenerator.createPanel(layoutValuationLand));
    //layoutLandConstValuation.addComponent(PanelGenerator.createPanel(layoutConstValuation));
    //layoutLandConstValuation1.addComponent(layoutLandConstValuation);
    //layoutLandConstValuation1.setMargin(true);
    // for plinth area
    layoutPlintharea.addComponent(btnAddPlinth);
    layoutPlintharea.setComponentAlignment(btnAddPlinth, Alignment.TOP_RIGHT);
    layoutPlintharea.setMargin(true);
    layoutPlintharea.addComponent(new ComponentIterPlinthArea("Ground Floor", "", ""));
    layoutPlintharea.addComponent(new ComponentIterPlinthArea("Portico and Stair", "", ""));
    // for plinth area
    vlPlinthAreaNew.addComponent(btnAddPlinthNew);
    vlPlinthAreaNew.setComponentAlignment(btnAddPlinthNew, Alignment.TOP_RIGHT);
    vlPlinthAreaNew.setMargin(true);
    vlPlinthAreaNew.addComponent(new ComponentIterPlinthArea("Ground Floor", "", ""));
    vlPlinthAreaNew.addComponent(new ComponentIterPlinthArea("Portico and Stair", "", ""));

    //for Valuation Details
    layoutValuationDetails.addComponent(btnAddValDtls);
    layoutValuationDetails1.setColumns(8);
    layoutValuationDetails1.setSpacing(true);
    layoutValuationDetails.setComponentAlignment(btnAddValDtls, Alignment.TOP_RIGHT);
    layoutValuationDetails1.addComponent(lblParticular);
    layoutValuationDetails1.addComponent(lblPlinthArea);
    layoutValuationDetails1.addComponent(lblRoofHt);
    layoutValuationDetails1.addComponent(lblBuildAge);
    layoutValuationDetails1.addComponent(lblRate);
    layoutValuationDetails1.addComponent(lblReplace);
    layoutValuationDetails1.addComponent(lblDepreciation);
    layoutValuationDetails1.addComponent(lblNetvalue);
    layoutValuationDetails1.setComponentAlignment(lblParticular, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblPlinthArea, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblRoofHt, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblBuildAge, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblRate, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblReplace, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblDepreciation, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setComponentAlignment(lblNetvalue, Alignment.BOTTOM_LEFT);
    layoutValuationDetails1.setWidth("650px");
    layoutValuationDetails.addComponent(layoutValuationDetails1);
    layoutValuationDetails.addComponent(layoutValuationDetails2);
    layoutValuationDetails.setWidth("100%");
    layoutValuationDetails.setMargin(true);
    ValuationDetailsList obj = new ValuationDetailsList();
    ValuationDetailsList obj1 = new ValuationDetailsList();
    obj.setFloorDtlsLabel("Ground Floor Building");
    obj1.setFloorDtlsLabel("First Floor Building");
    layoutValuationDetails2.addComponent(new ComponenetIterValuationDetails(obj));
    layoutValuationDetails2.addComponent(new ComponenetIterValuationDetails(obj1));

    //for Calculation-extra Items
    layoutExtraItems.setCaption("Extra Items");
    layoutExtraItems.setWidth("420px");
    layoutExtraItems.addComponent(btnDynamicExtra);
    layoutExtraItems.setComponentAlignment(btnDynamicExtra, Alignment.TOP_RIGHT);
    layoutExtraItems.addComponent(new ComponentIterExtraItems(null, ""));

    layoutAdditionItem.setCaption("Additional Items");
    layoutAdditionItem.setWidth("400px");
    layoutAdditionItem.addComponent(btnDynamicAdditional);
    layoutAdditionItem.setComponentAlignment(btnDynamicAdditional, Alignment.TOP_RIGHT);
    layoutAdditionItem.addComponent(new ComponentIterAdditionalItems(null, ""));

    layoutExtraAddItems1.setSpacing(true);
    layoutExtraAddItems1.setMargin(true);
    layoutExtraAddItems.setColumns(2);
    layoutExtraAddItems.addComponent(layoutExtraItems);
    layoutExtraAddItems.addComponent(layoutAdditionItem);
    layoutExtraAddItems1.addComponent(layoutExtraAddItems);

    //for Miscellaneous
    layoutMiscellaneous.setCaption("Miscellaneous");
    layoutMiscellaneous.setWidth("420px");
    layoutMiscellaneous.addComponent(btnDynamicMiscell);
    layoutMiscellaneous.setComponentAlignment(btnDynamicMiscell, Alignment.TOP_RIGHT);
    layoutMiscellaneous.addComponent(new ComponentIterMiscellaneous(null, ""));

    layoutServices.setCaption("Services");
    layoutServices.setWidth("400px");
    layoutServices.addComponent(btnDynamicServices);
    layoutServices.setComponentAlignment(btnDynamicServices, Alignment.TOP_RIGHT);
    layoutServices.addComponent(new ComponentIerServices(null, ""));

    layoutMiscellService1.setSpacing(true);
    layoutMiscellService1.setMargin(true);
    layoutMiscellService.setColumns(2);
    layoutMiscellService.addComponent(layoutMiscellaneous);
    layoutMiscellService.addComponent(layoutServices);
    layoutMiscellService1.addComponent(layoutMiscellService);
    // for Build Specification
    panelBuildSpecfication.addComponent(btnAddBuildSpec);
    panelBuildSpecfication.setComponentAlignment(btnAddBuildSpec, Alignment.BOTTOM_RIGHT);
    panelBuildSpecfication.addComponent(new ComponentIterBuildingSpecfication(null, true, true, true));
    panelBuildSpecfication.setWidth("100%");
    // for Build Specification
    panelBuildSpecficationNew.addComponent(btnAddBuildSpecNew);
    panelBuildSpecficationNew.setComponentAlignment(btnAddBuildSpecNew, Alignment.BOTTOM_RIGHT);
    panelBuildSpecficationNew.addComponent(new ComponentIterBuildingSpecfication(null, true, true, true));
    panelBuildSpecficationNew.setWidth("100%");

    // for applicant estimate
    layoutApplicantEstimate.setSpacing(true);
    layoutApplicantEstimate1.setSpacing(true);
    layoutApplicantEstimate1.setColumns(2);
    layoutApplicantEstimate2.setSpacing(true);
    layoutApplicantEstimate2.setColumns(2);
    layoutApplicantEstimate3.setSpacing(true);
    layoutApplicantEstimate3.setColumns(2);
    layoutApplicantEstimate4.setSpacing(true);
    layoutApplicantEstimate4.setColumns(2);
    layoutApplicantEstimate1.addComponent(lblAppEstimate);
    layoutApplicantEstimate1.addComponent(tfAppEstimate);
    layoutApplicantEstimate1.addComponent(lblDtlsAppEstimate);
    layoutApplicantEstimate1.addComponent(tfDtlsAppEstimate);
    layoutApplicantEstimate1.addComponent(tfDetails1);
    layoutApplicantEstimate1.addComponent(tfDetailVal1);
    layoutApplicantEstimate1.addComponent(tfDetails2);
    layoutApplicantEstimate1.addComponent(tfDetailVal2);
    layoutApplicantEstimate1.addComponent(tfDetails3);
    layoutApplicantEstimate1.addComponent(tfDetailVal3);
    layoutApplicantEstimate2.addComponent(tfDynamicAppEstimate1);
    layoutApplicantEstimate2.addComponent(tfDynamicAppEstimate2);
    layoutApplicantEstimate2.addComponent(tfDynamicAppEstimate3);
    layoutApplicantEstimate2.addComponent(tfDynamicAppEstimate4);
    layoutApplicantEstimate3.addComponent(tfDynamicAppEstimate5);
    layoutApplicantEstimate3.addComponent(tfDynamicAppEstimate6);
    layoutApplicantEstimate3.addComponent(tfDynamicAppEstimate7);
    layoutApplicantEstimate3.addComponent(tfDynamicAppEstimate8);
    layoutApplicantEstimate4.addComponent(lblTotal);
    layoutApplicantEstimate4.addComponent(tfTotalval);

    layoutApplicantEstimate.addComponent(btnDynamicAppEstimate);
    layoutApplicantEstimate.setComponentAlignment(btnDynamicAppEstimate, Alignment.TOP_RIGHT);
    layoutApplicantEstimate.addComponent(layoutApplicantEstimate1);
    layoutApplicantEstimate.addComponent(layoutApplicantEstimate2);
    layoutApplicantEstimate.addComponent(layoutApplicantEstimate3);
    layoutApplicantEstimate.addComponent(layoutApplicantEstimate4);
    layoutApplicantEstimate2.setVisible(true);
    layoutApplicantEstimate3.setVisible(true);
    layoutApplicantEstimate.setMargin(true);
    tfDynamicAppEstimate2.setValue("0.00");
    tfDetailVal2.setValue("0.00");
    tfDetailVal1.setValue("0.00");
    tfDynamicAppEstimate4.setValue("0.00");
    tfDynamicAppEstimate6.setValue("0.00");
    tfDynamicAppEstimate8.setValue("0.00");
    tfDetailVal3.setValue("0.00");
    tfTotalval.setImmediate(true);
    tfTotalval.addBlurListener(new BlurListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void blur(BlurEvent event) {
            // TODO Auto-generated method stub
            BigDecimal appEstimate = 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");
            BigDecimal test6 = new BigDecimal("0.00");

            try {
                test = new BigDecimal(tfDetailVal1.getValue());

            } catch (Exception e) {
                test = new BigDecimal("0.00");
            }
            try {
                test1 = new BigDecimal(tfDetailVal2.getValue());
            } catch (Exception e) {
                test1 = new BigDecimal("0.00");
            }
            try {
                test2 = new BigDecimal(tfDetailVal3.getValue());
            } catch (Exception e) {
                test2 = new BigDecimal("0.00");
            }
            try {
                test3 = new BigDecimal(tfDynamicAppEstimate2.getValue());

            } catch (Exception e) {
                test3 = new BigDecimal("0.00");
            }
            try {
                test4 = new BigDecimal(tfDynamicAppEstimate4.getValue());
            } catch (Exception e) {
                test4 = new BigDecimal("0.00");
            }
            try {
                test5 = new BigDecimal(tfDynamicAppEstimate6.getValue());
            } catch (Exception e) {
                test4 = new BigDecimal("0.00");
            }
            try {
                test6 = new BigDecimal(tfDynamicAppEstimate8.getValue());
            } catch (Exception e) {
                test4 = new BigDecimal("0.00");
            }
            appEstimate = appEstimate.add(test).add(test1).add(test2).add(test3).add(test4).add(test5)
                    .add(test6);
            tfTotalval.setValue(appEstimate.toString());
            tfAppEstimate.setValue(appEstimate.toString());
        }
    });

    //for applicant reasonable
    layoutApplicantReasonable.setSpacing(true);
    layoutApplicantReasonable1.setSpacing(true);
    layoutApplicantReasonable2.setSpacing(true);
    layoutApplicantReasonable1.setColumns(2);
    layoutApplicantReasonable2.setColumns(2);
    layoutApplicantReasonable1.setVisible(false);
    layoutApplicantReasonable2.addComponent(lblAppReasonable);
    layoutApplicantReasonable2.addComponent(slAppReasonable);
    layoutApplicantReasonable1.addComponent(lblReasonEstimate);
    layoutApplicantReasonable1.addComponent(tfReasonEstimateVal);
    layoutApplicantReasonable1.addComponent(lblDtlsAppReasonable);
    layoutApplicantReasonable1.addComponent(tfDtlsAppReasonable);
    layoutApplicantReasonable1.addComponent(tfDetailsReason1);
    layoutApplicantReasonable1.addComponent(tfDetailReasonVal1);
    layoutApplicantReasonable1.addComponent(tfDetailsReason2);
    layoutApplicantReasonable1.addComponent(tfDetailReasonVal2);
    layoutApplicantReasonable1.addComponent(tfDetailsReason3);
    layoutApplicantReasonable1.addComponent(tfDetailReasonVal3);
    layoutApplicantReasonable1.addComponent(tfDynamicAppReason1);
    layoutApplicantReasonable1.addComponent(tfDynamicAppReason2);
    layoutApplicantReasonable1.addComponent(tfDynamicAppReason3);
    layoutApplicantReasonable1.addComponent(tfDynamicAppReason4);
    layoutApplicantReasonable1.addComponent(lblReasonTotal);
    layoutApplicantReasonable1.addComponent(tfReasonTotalval);
    tfDynamicAppReason1.setVisible(false);
    tfDynamicAppReason2.setVisible(false);
    tfDynamicAppReason3.setVisible(false);
    tfDynamicAppReason4.setVisible(false);

    layoutApplicantReasonable.addComponent(btnDynamicAppReason);
    layoutApplicantReasonable.setComponentAlignment(btnDynamicAppReason, Alignment.TOP_RIGHT);
    layoutApplicantReasonable.addComponent(layoutApplicantReasonable2);
    layoutApplicantReasonable.addComponent(layoutApplicantReasonable1);
    layoutApplicantReasonable.setMargin(true);

    tfDetailReasonVal1.setValue("0.00");
    tfDetailReasonVal2.setValue("0.00");
    tfDetailReasonVal3.setValue("0.00");

    tfReasonTotalval.setImmediate(true);
    tfReasonTotalval.addBlurListener(new BlurListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void blur(BlurEvent event) {
            // TODO Auto-generated method stubBigDecimal appEstimate =new BigDecimal(0.00);
            BigDecimal appReason = 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(tfDetailReasonVal1.getValue());

            } catch (Exception e) {
                test = new BigDecimal("0.00");
            }
            try {
                test1 = new BigDecimal(tfDetailReasonVal2.getValue());
            } catch (Exception e) {
                test1 = new BigDecimal("0.00");
            }
            try {
                test2 = new BigDecimal(tfDetailReasonVal3.getValue());
            } catch (Exception e) {
                test2 = new BigDecimal("0.00");
            }
            try {
                test3 = new BigDecimal(tfDynamicAppReason2.getValue());

            } catch (Exception e) {
                test3 = new BigDecimal("0.00");
            }
            try {
                test4 = new BigDecimal(tfDynamicAppReason2.getValue());
            } catch (Exception e) {
                test4 = new BigDecimal("0.00");
            }
            appReason = appReason.add(test).add(test1).add(test2).add(test3).add(test4);
            tfReasonTotalval.setValue(appReason.toString());
            tfReasonEstimateVal.setValue(appReason.toString());
        }
    });

    slAppReasonable.setImmediate(true);
    slAppReasonable.setNullSelectionAllowed(false);
    slAppReasonable.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {
            if (slAppReasonable.getValue() != null) {
                if (slAppReasonable.getValue().equals(Common.NO_DESC)) {
                    layoutApplicantReasonable1.setVisible(true);
                    btnDynamicAppReason.setVisible(true);
                } else {
                    layoutApplicantReasonable1.setVisible(false);
                    btnDynamicAppReason.setVisible(false);
                }
            }
        }
    });

    //Earth quake

    layoutEarthquake1.setSpacing(true);
    layoutEarthquake1.setColumns(4);
    layoutEarthquake1.addComponent(slEarthQuake);
    layoutEarthquake1.addComponent(tfDynamicEarthquake1);
    layoutEarthquake1.addComponent(tfDynamicEarthquake2);
    tfDynamicEarthquake1.setVisible(false);
    tfDynamicEarthquake2.setVisible(false);

    layoutEarthquake.addComponent(btnDynamicEarthQuake);
    layoutEarthquake.setComponentAlignment(btnDynamicEarthQuake, Alignment.TOP_RIGHT);
    layoutEarthquake.addComponent(layoutEarthquake1);
    layoutEarthquake.setMargin(true);
    // cost of construction
    layoutCost.setColumns(2);
    layoutCostConstruction1.setColumns(2);
    layoutCostConstruction2.setColumns(2);
    layoutCostConstruction.setSpacing(true);
    layoutCost.setSpacing(true);
    layoutCostConstruction2.setSpacing(true);
    layoutCostConstruction1.setSpacing(true);
    layoutCostConstruction1.setSpacing(true);
    layoutCost.addComponent(lblCostConst);
    layoutCost.addComponent(tfCostConstruction);

    layoutCostConstruction1.addComponent(tfDynamicCostConst1);
    layoutCostConstruction1.addComponent(tfDynamicCostConst2);
    layoutCostConstruction1.addComponent(tfDynamicCostConst3);
    layoutCostConstruction1.addComponent(tfDynamicCostConst4);
    layoutCostConstruction1.addComponent(tfDynamicCostConst5);
    layoutCostConstruction1.addComponent(tfDynamicCostConst6);

    layoutCostConstruction2.addComponent(tfDynamicCostConst7);
    layoutCostConstruction2.addComponent(tfDynamicCostConst8);
    layoutCostConstruction2.addComponent(tfDynamicCostConst9);
    layoutCostConstruction2.addComponent(tfDynamicCostConst10);
    layoutCostConstruction1.setVisible(false);
    layoutCostConstruction2.setVisible(false);

    layoutCostConstruction.addComponent(btnDynamicCostConst);
    layoutCostConstruction.setComponentAlignment(btnDynamicCostConst, Alignment.TOP_RIGHT);
    layoutCostConstruction.addComponent(layoutCost);
    layoutCostConstruction.addComponent(layoutCostConstruction1);
    layoutCostConstruction.addComponent(layoutCostConstruction2);
    layoutCostConstruction.setMargin(true);

    //valuation of Building
    formConstValuation1.addComponent(slTypeBuilding);
    formConstValuation1.addComponent(slBuildStructure);
    formConstValuation1.addComponent(tfYearConstructionBuild);
    formConstValuation1.addComponent(slExterior);
    formConstValuation1.addComponent(slInterior);
    formConstValuation1.addComponent(tfLifeAge);
    formConstValuation1.addComponent(tfFutureLife);
    formConstValuation1.addComponent(tfDetailsPlan);
    formConstValuation1.addComponent(slDeviation);
    formConstValuation1.addComponent(tfDtlsDeviation);

    formConstValuation2.addComponent(btnAddRoofHt);
    formConstValuation2.addComponent(tfBuildNoFloors);

    layoutBuildtValuation.setSpacing(true);
    layoutBuildtValuation1.setSpacing(true);
    layoutBuildtValuation1.setColumns(2);
    layoutBuildtValuation1.addComponent(formConstValuation1);
    layoutBuildtValuation1.addComponent(new VerticalLayout() {
        {
            addComponent(formConstValuation2);
            addComponent(layoutRoofHeight);
        }

    });

    formConstValuation1.addComponent(tfDynamicBuildval1);
    formConstValuation1.addComponent(tfDynamicBuildval2);
    layoutBuildtValuation.addComponent(btnDynamicBuildVal);
    layoutBuildtValuation.setComponentAlignment(btnDynamicBuildVal, Alignment.TOP_RIGHT);
    layoutBuildtValuation.addComponent(layoutBuildtValuation1);
    layoutBuildtValuation.setMargin(true);

    // for Guideline area
    layoutGuideline.addComponent(btnAddGuideline);
    layoutGuideline.setComponentAlignment(btnAddGuideline, Alignment.TOP_RIGHT);
    layoutGuideline.setMargin(true);
    layoutGuideline.addComponent(new ComponentIterGuideline("Land", "", "", ""));
    layoutGuideline.addComponent(new ComponentIterGuideline("Building", "", "", ""));
    // for guide line reference
    streetLayout.addComponent(slStreetSerNo);
    streetLayout.addComponent(tfStreetName);

    layoutGuidelineReference1.setColumns(4);
    layoutGuidelineReference1.setSpacing(true);
    layoutGuidelineReference1.addComponent(tfZone);
    layoutGuidelineReference1.addComponent(tfSRO);
    layoutGuidelineReference1.addComponent(tfVillage);
    layoutGuidelineReference1.addComponent(tfRevnueDist);
    layoutGuidelineReference1.addComponent(tfTalukName);
    layoutGuidelineReference1.addComponent(streetLayout);
    layoutGuidelineReference1.addComponent(tfGuidelineValue);
    layoutGuidelineReference1.addComponent(tfGuidelineValueMatric);
    layoutGuidelineReference1.addComponent(slClassification);
    layoutGuidelineReference1.setMargin(true);

    layoutGuidelineReference.setSpacing(true);
    layoutGuidelineReference.addComponent(layoutGuidelineReference1);

    //add components in main panel
    accordion.setWidth("100%");

    layoutEvaluationDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutEvaluationDetails), "Evaluation Details");
    layoutOwnerDetails.setStyleName("bluebar");
    layoutAssetDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutAssetOwner), "Owner Details/Asset Details");

    layoutNormalLegal.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutNormalLegal), "Document Details");

    panelAdjoinProperties.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(panelAdjoinProperties), "Adjoining Properties");

    panelDimension.setStyleName("bluebar");
    accordion.addTab(panelDimension, "Dimension");

    layoutmachingBoundary.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutmachingBoundary),
            "Matching of Boundaries And Tenure/Occupancy Details");

    layoutNoofRooms.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutNoofRooms), "No. of Rooms/No. of Floors");

    layoutAreaDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutAreaDetails), "Area Details of the Property");
    layoutValuationLand.setStyleName("bluebar");
    accordion.addTab(layoutValuationLand, "Valuation of Land");
    //for Building
    vlConstPlanApp.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(vlConstPlanApp), "Details of Existing Plan Approval");
    layoutBuildtValuation.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutBuildtValuation), "Details of Building");
    layoutPlintharea.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPlintharea), "Plinth Area Details");
    panelBuildSpecfication.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(panelBuildSpecfication),
            "Specification of the building(Existing)");
    layoutValuationDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutValuationDetails), "Details of Valuation");
    layoutExtraAddItems1.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutExtraAddItems1), "Extra/Additional Items");
    layoutMiscellService1.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutMiscellService1), "Miscellaneous/Services");
    //for construction
    layoutPlanApproval.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPlanApproval), "Details of Plan Approval");
    layoutConstValuation.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutConstValuation), "Details of Construction");
    layoutApplicantEstimate.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutApplicantEstimate), "Applicant Estimate");

    layoutApplicantReasonable.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutApplicantReasonable), "Applicant Reasonable");

    vlPlinthAreaNew.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(vlPlinthAreaNew), "Plinth Area Details for Construction");
    panelBuildSpecficationNew.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(panelBuildSpecficationNew), "Specification of the building");
    layoutMainForm.addComponent(PanelGenerator.createPanel(accordion));
    layoutConstruction.setStyleName("bluebar");
    layoutViolation.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutConstViolation), "Construction/Violation Details");
    layoutEarthquake.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutEarthquake), "Earth Quake Details");

    layoutCostConstruction.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutCostConstruction), "Cost of Construction");

    layoutGuideline.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutGuideline), "Guideline Details");

    layoutGuidelineReference.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutGuidelineReference), "Guideline Reference Details");
    layoutPropertyValue.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPropertyValue), "Property Value Details");

    layoutMainForm.setMargin(true);
    layoutMainForm.setSpacing(true);
    this.accordion.addListener(new SelectedTabChangeListener() {
        public void selectedTabChange(SelectedTabChangeEvent event) {
            if (event.getTabSheet().getSelectedTab().equals(panelDimension)) {
                Iterator<Component> myComps = panelDimension.getComponentIterator();
                BigDecimal siteArea = new BigDecimal(0.00);
                while (myComps.hasNext()) {
                    final Component component = myComps.next();
                    int i = 1;

                    if (component instanceof ComponentIterDimensionofPlot) {

                        ComponentIterDimensionofPlot mycomponent = (ComponentIterDimensionofPlot) component;
                        List<TPemCmPropDimension> getList = mycomponent.getDimensionPropertyList();

                        try {
                            List<String> mylist = mycomponent.getLeastValaue();
                            siteArea = siteArea.add(new BigDecimal(mylist.get(0).replaceAll("[^\\d.]", "")));
                            tfNorthandSouth.setValue(mylist.get(1));
                            tfSiteArea.setValue(siteArea.toString());
                        } catch (Exception e) {

                            logger.info("Error-->" + e);
                        }
                    }
                }
                BigDecimal site = new BigDecimal(0.00);
                BigDecimal fair = new BigDecimal(1.00);
                BigDecimal salbale = new BigDecimal(435.60);
                try {
                    site = new BigDecimal(tfSiteArea.getValue().replaceAll("[^\\d.]", ""));
                } catch (Exception e) {
                    site = new BigDecimal("0.00");

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

                }
            }

        }
    });
    // for main panel
    layoutButton2.setSpacing(true);
    btnSave.setStyleName("savebt");
    btnCancel.setStyleName("cancelbt");
    //saveExcel.addStyleName("downloadbt");
    btnSubmit.setStyleName("savebt");
    btnSave.setVisible(false);
    btnCancel.setVisible(false);
    //saveExcel.setVisible(false);
    btnSubmit.setVisible(false);

    layoutButton2.addComponent(btnSave);
    layoutButton2.addComponent(btnSubmit);
    //layoutButton2.addComponent(saveExcel);
    layoutButton2.addComponent(btnCancel);
    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);

    // Initaited the Label Function here by Hohul
    lblTableTitle = new Label();
    lblSaveNotification = new Label();
    lblSaveNotification.setContentMode(ContentMode.HTML);
    lblNotificationIcon = new Label();
    lblTableTitle.setValue("<B>&nbsp;&nbsp;Action:</B>");
    lblTableTitle.setContentMode(ContentMode.HTML);
    lblFormTittle = new Label();
    lblFormTittle.setContentMode(ContentMode.HTML);
    lblFormTittle.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;Home");
    lblFormTitle1 = new Label();
    lblFormTitle1.setContentMode(ContentMode.HTML);
    lblFormTitle1.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;");
    lblAddEdit = new Label();
    lblAddEdit.setContentMode(ContentMode.HTML);

    // Button Back declaration by Hohul
    btnBack = new Button("Home", this);
    btnBack.setStyleName("link");

    // Bread Scrumbs initiated here by Hohul

    hlBreadCrumbs = new HorizontalLayout();
    hlBreadCrumbs.addComponent(lblFormTitle1);
    hlBreadCrumbs.addComponent(btnBack);
    hlBreadCrumbs.setComponentAlignment(btnBack, Alignment.TOP_CENTER);
    hlBreadCrumbs.addComponent(lblAddEdit);
    hlBreadCrumbs.setComponentAlignment(lblAddEdit, Alignment.MIDDLE_CENTER);
    hlBreadCrumbs.setVisible(false);

    /*String basepath = VaadinService.getCurrent()
          .getBaseDirectory().getAbsolutePath();
    Resource res = new FileResource(new File(basepath +
              "/WEB-INF/view/channel.doc"));
    FileDownloader fd = new FileDownloader(res);
    fd.extend(saveExcel);*/

    mainPanel.addComponent(layoutMainForm);
    mainPanel.setVisible(false);

    // for search panel   // for search panel
    // Added by Hohul ----->  For Search Panel Layouts
    FormLayout flSearchEvalNumber = new FormLayout();
    flSearchEvalNumber.addComponent(tfSearchEvalNumber);

    FormLayout flSearchBankbranch = new FormLayout();
    flSearchBankbranch.addComponent(tfSearchBankbranch);

    FormLayout flSearchCustomer = new FormLayout();
    flSearchCustomer.addComponent(tfSearchCustomer);

    HorizontalLayout hlSearchComponentLayout = new HorizontalLayout();
    hlSearchComponentLayout.addComponent(flSearchEvalNumber);
    hlSearchComponentLayout.addComponent(flSearchBankbranch);
    hlSearchComponentLayout.addComponent(flSearchCustomer);
    hlSearchComponentLayout.setSpacing(true);
    hlSearchComponentLayout.setMargin(true);

    //Initialization and properties for btnDownload      
    btnDownload = new Button("Download");
    //btnDownload.setDescription("Download");
    btnDownload.addStyleName("downloadbt");
    btnDownload.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            //  UI.getCurrent()..clearDashboardButtonBadge();
            event.getButton().removeStyleName("unread");
            if (notifications != null && notifications.getUI() != null)
                notifications.close();
            else {
                buildNotifications(event);
                UI.getCurrent().addWindow(notifications);
                notifications.focus();
                ((VerticalLayout) UI.getCurrent().getContent())
                        .addLayoutClickListener(new LayoutClickListener() {
                            @Override
                            public void layoutClick(LayoutClickEvent event) {
                                notifications.close();
                                ((VerticalLayout) UI.getCurrent().getContent()).removeLayoutClickListener(this);
                            }
                        });
            }

        }
    });
    hlFileDownloadLayout = new HorizontalLayout();
    hlFileDownloadLayout.setSpacing(true);
    hlFileDownloadLayout.addComponent(btnDownload);
    hlFileDownloadLayout.setComponentAlignment(btnDownload, Alignment.MIDDLE_CENTER);

    VerticalLayout vlSearchandResetButtonLAyout = new VerticalLayout();
    vlSearchandResetButtonLAyout.setSpacing(true);
    vlSearchandResetButtonLAyout.addComponent(btnReset);
    vlSearchandResetButtonLAyout.setWidth("100");
    vlSearchandResetButtonLAyout.addStyleName("topbarthree");
    vlSearchandResetButtonLAyout.setMargin(true);

    HorizontalLayout hlSearchComponentandButtonLayout = new HorizontalLayout();
    hlSearchComponentandButtonLayout.setSizeFull();
    hlSearchComponentandButtonLayout.setSpacing(true);
    hlSearchComponentandButtonLayout.addComponent(hlSearchComponentLayout);
    hlSearchComponentandButtonLayout.setComponentAlignment(hlSearchComponentLayout, Alignment.MIDDLE_LEFT);
    hlSearchComponentandButtonLayout.addComponent(vlSearchandResetButtonLAyout);
    hlSearchComponentandButtonLayout.setComponentAlignment(vlSearchandResetButtonLAyout,
            Alignment.MIDDLE_RIGHT);
    hlSearchComponentandButtonLayout.setExpandRatio(vlSearchandResetButtonLAyout, 1);
    final VerticalLayout vlSearchComponentandButtonLayout = new VerticalLayout();
    vlSearchComponentandButtonLayout.setSpacing(true);
    vlSearchComponentandButtonLayout.setSizeFull();
    vlSearchComponentandButtonLayout.addComponent(hlSearchComponentandButtonLayout);

    /*layoutSearch.addComponent(tfSearchEvalNumber);
    layoutSearch.addComponent(tfSearchBankbranch);
    layoutSearch.addComponent(tfSearchCustomer);
    //layoutSearch.addComponent(btnSearch);
    layoutSearch.addComponent(btnReset);
    //layoutSearch.setComponentAlignment(btnSearch, Alignment.BOTTOM_LEFT);
    layoutSearch.setComponentAlignment(btnReset, Alignment.BOTTOM_LEFT);
    //btnSearch.addStyleName("default");
    */ btnReset.addStyleName("resetbt");
    tfSearchCustomer.setImmediate(true);
    tfSearchCustomer.addListener(new TextChangeListener() {
        private static final long serialVersionUID = 1L;
        SimpleStringFilter filter = null;

        public void textChange(TextChangeEvent event) {
            Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
            if (filter != null)
                f.removeContainerFilter(filter);

            filter = new SimpleStringFilter("custName", event.getText(), true, false);

            f.addContainerFilter(filter);
            total = f.size();
            tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
        }
    });
    tfSearchEvalNumber.setImmediate(true);
    tfSearchEvalNumber.addListener(new TextChangeListener() {
        private static final long serialVersionUID = 1L;
        SimpleStringFilter filter = null;

        public void textChange(TextChangeEvent event) {
            Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
            if (filter != null)
                f.removeContainerFilter(filter);

            filter = new SimpleStringFilter("evalNo", event.getText(), true, false);

            f.addContainerFilter(filter);
            total = f.size();
            tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
        }
    });

    tfSearchBankbranch.setImmediate(true);
    tfSearchBankbranch.addValueChangeListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;
        Filter filter = null;

        @Override
        public void valueChange(ValueChangeEvent event) {
            // TODO Auto-generated method stub

            try {
                String strBankBranch = tfSearchBankbranch.getValue().toString();
                Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
                if (filter != null)
                    f.removeContainerFilter(filter);

                filter = new Compare.Equal("bankBranch", strBankBranch);
                f.addContainerFilter(filter);
                f.addContainerFilter(filter);
                total = f.size();
                tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
            } catch (Exception e) {
            }
        }

    });
    searchPanel.addComponent(PanelGenerator.createPanel(vlSearchComponentandButtonLayout));
    searchPanel.setMargin(true);
    // Add Layout table panel by Hohul

    HorizontalLayout flTableCaption = new HorizontalLayout();
    flTableCaption.addComponent(lblTableTitle);
    flTableCaption.setComponentAlignment(lblTableTitle, Alignment.MIDDLE_CENTER);
    flTableCaption.addStyleName("lightgray");
    flTableCaption.setHeight("25px");
    flTableCaption.setWidth("60px");

    lblNoofRecords = new Label(" ", ContentMode.HTML);
    lblNoofRecords.addStyleName("lblfooter");
    HorizontalLayout hlTableTittleLayout = new HorizontalLayout();
    hlTableTittleLayout.addComponent(flTableCaption);
    hlTableTittleLayout.addComponent(btnAdd);
    hlTableTittleLayout.addComponent(btnEdit);
    hlTableTittleLayout.addComponent(btnView);
    hlTableTittleLayout.setHeight("25px");
    hlTableTittleLayout.setSpacing(true);

    HorizontalLayout hlTableTitleandCaptionLayout = new HorizontalLayout();
    hlTableTitleandCaptionLayout.addStyleName("topbarthree");
    hlTableTitleandCaptionLayout.setWidth("100%");
    hlTableTitleandCaptionLayout.addComponent(hlTableTittleLayout);
    hlTableTitleandCaptionLayout.addComponent(hlFileDownloadLayout);
    hlTableTitleandCaptionLayout.setComponentAlignment(hlFileDownloadLayout, Alignment.MIDDLE_RIGHT);
    hlTableTitleandCaptionLayout.setHeight("28px");

    // for table panel
    btnAdd.addStyleName("add");
    btnEdit.addStyleName("editbt");
    btnView.addStyleName("view");
    btnView.setEnabled(false);

    hlAddEditLayout.addStyleName("topbarthree");
    hlAddEditLayout.setWidth("100%");
    hlAddEditLayout.addComponent(hlTableTitleandCaptionLayout);
    hlAddEditLayout.setHeight("28px");
    // Added Action Label to Table

    layoutTable.addComponent(hlAddEditLayout);
    layoutTable.setComponentAlignment(hlAddEditLayout, Alignment.TOP_LEFT);
    layoutTable.addComponent(tblEvalDetails);

    tablePanel.addComponent(layoutTable);
    tablePanel.setWidth("100%");
    tablePanel.setMargin(true);

    layoutPage.addComponent(mainPanel);
    layoutPage.addComponent(searchPanel);
    layoutPage.addComponent(tablePanel);

    // Added labels and titles to respective Location by Hohul

    HorizontalLayout hlNotificationLayout = new HorizontalLayout();
    hlNotificationLayout.addComponent(lblNotificationIcon);
    hlNotificationLayout.setComponentAlignment(lblNotificationIcon, Alignment.MIDDLE_LEFT);
    hlNotificationLayout.addComponent(lblSaveNotification);
    hlNotificationLayout.setComponentAlignment(lblSaveNotification, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(lblFormTittle);
    hlHeaderLayout.setComponentAlignment(lblFormTittle, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(hlBreadCrumbs);
    hlHeaderLayout.setComponentAlignment(hlBreadCrumbs, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(hlNotificationLayout);
    hlHeaderLayout.setComponentAlignment(hlNotificationLayout, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.MIDDLE_RIGHT);

    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);

    /*tfEvaluationNumber.addValidator(new IntegerValidator("Enter numbers only"));
    tfEvaluationNumber.addBlurListener(new SaarcValidate(tfEvaluationNumber));*/
    tfEvaluationNumber.setImmediate(true);

    tfEvaluationNumber.addBlurListener(new BlurListener() {

        private static final long serialVersionUID = 1L;

        public void blur(BlurEvent event) {
            // TODO Auto-generated method stub
            if (!tfEvaluationNumber.isReadOnly()) {
                tfEvaluationNumber.setComponentError(null);
                try {
                    tfEvaluationNumber.setComponentError(null);
                    String evalno = tfEvaluationNumber.getValue().toString();
                    count = beanEvaluation.getEvalNoCount(evalno);

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

                        if (count == 0) {

                            tfEvaluationNumber.setComponentError(null);

                        } else {

                            tfEvaluationNumber
                                    .setComponentError(new UserError("Evaluation number is already Exist"));

                        }
                    }
                } catch (Exception e) {

                }
            }

        }
    });
    // load Component list values
    loadComponentListValues();

    //setTableProperties();
    populateAndConfig(false);

}

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

License:Open Source License

@SuppressWarnings("deprecation")
void buildView(VerticalLayout layoutPage, HorizontalLayout hlHeaderLayout) {
    // for component width
    hlHeaderLayout.removeAllComponents();
    setComponentStyle();/*from   www . jav a 2 s . c om*/

    tblEvalDetails = new Table();
    tblEvalDetails.setStyleName(Runo.TABLE_SMALL);
    tblEvalDetails.setPageLength(14);
    tblEvalDetails.setSizeFull();
    tblEvalDetails.setFooterVisible(true);
    tblEvalDetails.setSelectable(true);
    tblEvalDetails.setImmediate(true);
    tblEvalDetails.setColumnCollapsingAllowed(true);

    // for evaluation details
    tfEvaluationPurpose.setValue("Collateral Security to the Bank");

    tfEvaluationNumber.setRequired(true);
    slBankBranch.setRequired(true);
    dfDateofValuation.setRequired(true);
    tfEvaluationPurpose.setRequired(true);
    layoutEvaluationDetails1.setColumns(4);

    layoutEvaluationDetails1.addComponent(tfEvaluationNumber);
    layoutEvaluationDetails1.addComponent(slBankBranch);
    layoutEvaluationDetails1.addComponent(tfEvaluationPurpose);
    layoutEvaluationDetails1.addComponent(tfValuatedBy);
    layoutEvaluationDetails1.addComponent(dfDateofValuation);
    layoutEvaluationDetails1.addComponent(dfVerifiedDate);
    layoutEvaluationDetails1.addComponent(tfVerifiedBy);
    layoutEvaluationDetails1.addComponent(tfDynamicEvaluation1);
    layoutEvaluationDetails1.addComponent(tfDynamicEvaluation2);
    tfDynamicEvaluation1.setVisible(false);
    tfDynamicEvaluation2.setVisible(false);
    layoutEvaluationDetails1.setSpacing(true);
    layoutEvaluationDetails1.setMargin(true);

    layoutEvaluationDetails.addComponent(btnDynamicEvaluation1);
    layoutEvaluationDetails.setComponentAlignment(btnDynamicEvaluation1, Alignment.TOP_RIGHT);
    layoutEvaluationDetails.addComponent(layoutEvaluationDetails1);
    // for asset details
    VerticalLayout formAsset1 = new VerticalLayout();
    VerticalLayout formAsset2 = new VerticalLayout();
    VerticalLayout formAsset3 = new VerticalLayout();
    VerticalLayout formAsset4 = new VerticalLayout();
    formAsset1.setSpacing(true);
    formAsset2.setSpacing(true);
    formAsset4.setSpacing(true);

    formAsset1.addComponent(tfCustomerName);
    formAsset1.addComponent(tfLandMark);
    formAsset1.addComponent(slPropertyDesc);
    formAsset2.addComponent(tfCustomerAddr);
    formAsset3.addComponent(tfPropertyAddress);
    formAsset3.addComponent(chkSameAddress);
    formAsset4.addComponent(tfDynamicAsset1);
    formAsset4.addComponent(tfDynamicAsset2);
    tfDynamicAsset1.setVisible(false);
    tfDynamicAsset2.setVisible(false);
    tfCustomerName.setRequired(true);
    chkSameAddress.setImmediate(true);
    chkSameAddress.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {

            if (chkSameAddress.getValue().equals(true)) {
                tfPropertyAddress.setValue(tfCustomerAddr.getValue());

            } else {
                tfPropertyAddress.setValue("");
            }
        }
    });

    layoutAssetDetails1.setSpacing(true);
    layoutAssetDetails1.setColumns(4);
    layoutAssetDetails1.addComponent(formAsset1);
    layoutAssetDetails1.addComponent(formAsset2);
    layoutAssetDetails1.addComponent(formAsset3);
    layoutAssetDetails1.addComponent(formAsset4);
    layoutAssetDetails1.setMargin(true);

    layoutAssetDetails.addComponent(btnDynamicAsset);
    layoutAssetDetails.setComponentAlignment(btnDynamicAsset, Alignment.TOP_RIGHT);
    layoutAssetDetails.addComponent(layoutAssetDetails1);

    lblHeading = new Label("Owner Details");
    layoutAssetOwner.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutAssetOwner.addComponent(PanelGenerator.createPanel(layoutOwnerDetails));
    lblHeading = new Label("Asset Details");
    layoutAssetOwner.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutAssetOwner.addComponent(PanelGenerator.createPanel(layoutAssetDetails));
    // for document details
    panelNormalDocumentDetails.addComponent(btnAddNorDoc);
    panelNormalDocumentDetails.setComponentAlignment(btnAddNorDoc, Alignment.TOP_RIGHT);
    panelNormalDocumentDetails.addComponent(new ComponentIteratorNormlDoc(null, null, "", ""));
    panelNormalDocumentDetails.setMargin(true);
    panelLegalDocumentDetails.addComponent(btnAddLegalDoc);
    panelLegalDocumentDetails.setComponentAlignment(btnAddLegalDoc, Alignment.TOP_RIGHT);
    panelLegalDocumentDetails.addComponent(new ComponentIteratorLegalDoc("", "", null));
    panelLegalDocumentDetails.setMargin(true);
    layoutNormalLegal.addComponent(PanelGenerator.createPanel(panelNormalDocumentDetails));
    lblHeading = new Label("Legal Documents");
    layoutNormalLegal.addComponent(lblHeading);
    lblHeading.setStyleName("h4");
    layoutNormalLegal.addComponent(PanelGenerator.createPanel(panelLegalDocumentDetails));
    layoutNormalLegal.setMargin(true);

    //for Owner Details
    layoutOwnerDetails.addComponent(btnAddOwner);
    layoutOwnerDetails.setComponentAlignment(btnAddOwner, Alignment.TOP_RIGHT);
    layoutOwnerDetails1.setColumns(4);
    layoutOwnerDetails1.addComponent(new ComponentIterOwnerDetails("", ""));
    layoutOwnerDetails.addComponent(layoutOwnerDetails1);
    layoutOwnerDetails1.setSpacing(true);
    layoutOwnerDetails1.setMargin(true);
    // for adjoin properties
    panelAdjoinProperties.addComponent(btnAddAdjoinProperty);
    panelAdjoinProperties.setComponentAlignment(btnAddAdjoinProperty, Alignment.BOTTOM_RIGHT);
    panelAdjoinProperties.addComponent(new ComponentIteratorAdjoinProperty(null, true, true, true));

    // for dimensions
    panelDimension.addComponent(btnAddDimension);
    panelDimension.addComponent(lblDimension);
    lblDimension.setValue("Item No :" + itemDimensionNumber);
    panelDimension.setComponentAlignment(btnAddDimension, Alignment.BOTTOM_RIGHT);
    panelDimension.addComponent(new ComponentIterDimensionofPlot(null, true, true, true));

    panelNormalDocumentDetails.setWidth("100%");
    panelLegalDocumentDetails.setWidth("100%");

    // for
    layoutmachingBoundary1.setSpacing(true);
    tfDynamicmatching1.setVisible(true);
    tfDynamicmatching2.setVisible(true);
    layoutmachingBoundary2.addComponent(btnDynamicmatching);
    layoutmachingBoundary2.setComponentAlignment(btnDynamicmatching, Alignment.TOP_RIGHT);
    layoutmachingBoundary1.setSpacing(true);
    layoutmachingBoundary1.addComponent(slMatchingBoundary);
    layoutmachingBoundary1.addComponent(slPlotDemarcated);
    layoutmachingBoundary1.addComponent(slApproveLandUse);
    layoutmachingBoundary1.addComponent(slTypeofProperty);
    layoutmachingBoundary1.addComponent(tfDynamicmatching1);
    layoutmachingBoundary1.addComponent(tfDynamicmatching2);
    layoutmachingBoundary1.setSpacing(true);
    layoutmachingBoundary1.setMargin(true);

    // tenure/occupancy details
    layoutTenureOccupay.setSpacing(true);
    layoutTenureOccupay1.setSpacing(true);
    layoutTenureOccupay2.addComponent(btnDynamicTenure);
    layoutTenureOccupay2.setComponentAlignment(btnDynamicTenure, Alignment.TOP_RIGHT);
    layoutTenureOccupay.setColumns(2);
    layoutTenureOccupay1.addComponent(tfStatusofTenure);
    layoutTenureOccupay1.addComponent(slOwnedorRent);
    layoutTenureOccupay1.addComponent(tfNoOfYears);
    layoutTenureOccupay1.addComponent(tfRelationship);
    layoutTenureOccupay1.addComponent(tfDynamicTenure1);
    layoutTenureOccupay1.addComponent(tfDynamicTenure2);
    layoutmachingBoundary2.addComponent(layoutmachingBoundary1);
    layoutTenureOccupay2.addComponent(layoutTenureOccupay1);
    layoutTenureOccupay.addComponent(PanelGenerator.createPanel(layoutmachingBoundary2));
    layoutTenureOccupay.addComponent(PanelGenerator.createPanel(layoutTenureOccupay2));
    tfDynamicTenure1.setVisible(false);
    tfDynamicTenure2.setVisible(false);
    layoutmachingBoundary1.setMargin(true);
    layoutTenureOccupay1.setMargin(true);
    layoutmachingBoundary.addComponent(layoutTenureOccupay);
    layoutTenureOccupay1.setMargin(true);
    layoutmachingBoundary.setMargin(true);

    // for no of rooms
    layoutNoofRooms2.addComponent(btnDynamicRooms);
    layoutNoofRooms2.setComponentAlignment(btnDynamicRooms, Alignment.TOP_RIGHT);
    layoutNoofRooms2.setMargin(true);
    layoutNoofRooms1.addComponent(tfNoofRooms);
    layoutNoofRooms1.addComponent(tfLivingDining);
    layoutNoofRooms1.addComponent(tfBedRooms);
    layoutNoofRooms1.addComponent(tfKitchen);
    layoutNoofRooms1.addComponent(tfToilets);
    layoutNoofRooms1.addComponent(tfDynamicRooms1);
    layoutNoofRooms1.addComponent(tfDynamicRooms2);
    tfDynamicRooms1.setVisible(false);
    tfDynamicRooms2.setVisible(false);
    layoutNoofRooms1.setSpacing(true);
    layoutNoofRooms2.addComponent(layoutNoofRooms1);
    // no of floors
    layoutNoofFloors.setColumns(2);
    layoutNoofFloors2.setMargin(true);
    layoutNoofFloors2.addComponent(btnDynamicFloor);
    layoutNoofFloors2.setComponentAlignment(btnDynamicFloor, Alignment.TOP_RIGHT);
    layoutNoofFloors1.addComponent(tfTotNoofFloors);
    layoutNoofFloors1.addComponent(tfPropertyLocated);
    layoutNoofFloors1.addComponent(tfApproxAgeofBuilding);
    layoutNoofFloors1.addComponent(tfResidualAgeofBuilding);
    layoutNoofFloors1.addComponent(slTypeofStructures);
    layoutNoofFloors1.addComponent(tfDynamicFloors1);
    layoutNoofFloors1.addComponent(tfDynamicFloors2);
    tfDynamicFloors1.setVisible(false);
    tfDynamicFloors2.setVisible(false);
    layoutNoofFloors1.setSpacing(true);
    layoutNoofFloors2.addComponent(layoutNoofFloors1);
    layoutNoofFloors.setSpacing(true);
    layoutNoofFloors.addComponent(PanelGenerator.createPanel(layoutNoofFloors2));
    layoutNoofFloors.addComponent(PanelGenerator.createPanel(layoutNoofRooms2));

    layoutNoofRooms.addComponent(layoutNoofFloors);
    layoutNoofRooms.setMargin(true);
    // area details of the property
    layoutAreaDetails1.setSpacing(true);
    layoutAreaDetails1.setColumns(4);
    layoutAreaDetails1.addComponent(tfSiteArea);
    layoutAreaDetails1.addComponent(tfCarpetArea);
    layoutAreaDetails1.addComponent(tfSuperbuiltup);
    layoutAreaDetails1.addComponent(tfSalableArea);
    layoutAreaDetails1.addComponent(tfRemarks);
    layoutAreaDetails1.addComponent(tfDynamicAreaDetail1);
    layoutAreaDetails1.addComponent(tfDynamicAreaDetail2);
    tfDynamicAreaDetail1.setVisible(false);
    tfDynamicAreaDetail2.setVisible(false);

    layoutAreaDetails.addComponent(btnDynamicAreaDetail);
    layoutAreaDetails.setComponentAlignment(btnDynamicAreaDetail, Alignment.TOP_RIGHT);
    layoutAreaDetails.addComponent(layoutAreaDetails1);
    layoutAreaDetails1.setMargin(true);

    // details of apartment building
    layoutApartmentBuilding1.setColumns(4);
    layoutApartmentBuilding1.addComponent(slNatureofApartment);
    layoutApartmentBuilding1.addComponent(tfNameofApartment);
    layoutApartmentBuilding1.addComponent(tfApartmant);
    layoutApartmentBuilding1.addComponent(tfFlatNumber);
    layoutApartmentBuilding1.addComponent(tfSFNumber);
    layoutApartmentBuilding1.addComponent(tfFloor);
    layoutApartmentBuilding1.addComponent(tfVillageLoc);
    layoutApartmentBuilding1.addComponent(tfTalukLoc);
    layoutApartmentBuilding1.addComponent(tfDisrictLoc);
    layoutApartmentBuilding1.addComponent(slDescriptionofLocality);
    layoutApartmentBuilding1.addComponent(tfNoofFloors);
    layoutApartmentBuilding1.addComponent(slTypeofStructure);
    layoutApartmentBuilding1.addComponent(tfNumberofFlats);
    layoutAddress.addComponent(tfPostalAddress);
    layoutAddress.addComponent(chkSamePostelAddress);
    layoutApartmentBuilding1.addComponent(layoutAddress);
    layoutApartmentBuilding1.addComponent(tfDynamicApartment1);
    layoutApartmentBuilding1.addComponent(tfDynamicApartment2);
    layoutApartmentBuilding1.setSpacing(true);
    tfDynamicApartment1.setVisible(false);
    tfDynamicApartment2.setVisible(false);
    layoutApartmentBuilding1.setMargin(true);
    chkSamePostelAddress.setImmediate(true);
    chkSamePostelAddress.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        public void valueChange(ValueChangeEvent event) {

            if (chkSamePostelAddress.getValue().equals(true)) {
                tfPostalAddress.setValue(tfPropertyAddress.getValue());

            } else {
                tfPostalAddress.setValue("");
            }
        }
    });
    /*   tfEvaluationNumber.addValidator(new IntegerValidator("Enter numbers only"));
       tfEvaluationNumber.addBlurListener(new SaarcValidate(tfEvaluationNumber));*/
    tfEvaluationNumber.setImmediate(true);
    tfEvaluationNumber.addBlurListener(new BlurListener() {

        private static final long serialVersionUID = 1L;

        public void blur(BlurEvent event) {
            // TODO Auto-generated method stub
            if (!tfEvaluationNumber.isReadOnly()) {
                tfEvaluationNumber.setComponentError(null);
                try {
                    tfEvaluationNumber.setComponentError(null);
                    String evalno = tfEvaluationNumber.getValue().toString();
                    count = beanEvaluation.getEvalNoCount(evalno);

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

                        if (count == 0) {

                            tfEvaluationNumber.setComponentError(null);

                        } else {

                            tfEvaluationNumber
                                    .setComponentError(new UserError("Evaluation number is already Exist"));

                        }
                    }
                } catch (Exception e) {

                }
            }
        }
    });
    // flat under valuation
    layoutFlatValuation1.setColumns(4);
    layoutFlatValuation1.addComponent(tfFlatisSituated);
    layoutFlatValuation1.addComponent(tfDynamicFlatValuation1);
    layoutFlatValuation1.addComponent(tfDynamicFlatValuation2);
    tfDynamicFlatValuation1.setVisible(false);
    tfDynamicFlatValuation2.setVisible(false);
    layoutFlatValuation1.setSpacing(true);
    layoutFlatValuation1.setMargin(true);

    layoutFlatValuation.addComponent(btnDynamicFlatValuation);
    layoutFlatValuation.setComponentAlignment(btnDynamicFlatValuation, Alignment.TOP_RIGHT);
    layoutFlatValuation.addComponent(layoutFlatValuation1);

    // for details of plan approval
    layoutPlanApproval1.setColumns(4);
    formLand.addComponent(slLandandBuilding);
    formLand.addComponent(tfLandandBuilding);
    formBuilding.addComponent(slBuilding);
    formBuilding.addComponent(tfBuilding);

    layoutPlanApproval1.addComponent(formLand);
    layoutPlanApproval1.addComponent(formBuilding);
    layoutPlanApproval1.addComponent(tfPlanApprovedBy);
    layoutPlanApproval1.addComponent(dfLicenseFrom);
    layoutPlanApproval1.addComponent(slIsLicenceForced);
    layoutPlanApproval1.addComponent(slAllApprovalRecved);
    layoutPlanApproval1.addComponent(slConstAsperAppPlan);
    layoutPlanApproval1.addComponent(tfDynamicPlanApproval1);
    layoutPlanApproval1.addComponent(tfDynamicPlanApproval2);

    tfDynamicPlanApproval1.setVisible(false);
    tfDynamicPlanApproval2.setVisible(false);
    layoutPlanApproval1.setSpacing(true);
    layoutPlanApproval1.setMargin(true);
    layoutPlanApproval.addComponent(btnDynamicPlanApproval);
    layoutPlanApproval.setComponentAlignment(btnDynamicPlanApproval, Alignment.TOP_RIGHT);
    layoutPlanApproval.addComponent(layoutPlanApproval1);

    // for Build Specification
    panelBuildSpecfication.addComponent(btnAddBuildSpec);
    panelBuildSpecfication.setComponentAlignment(btnAddBuildSpec, Alignment.BOTTOM_RIGHT);
    panelBuildSpecfication.addComponent(new ComponentIterBuildingSpecfication(null, true, true, true));
    panelBuildSpecfication.setWidth("100%");

    // for
    layoutApartmentBuilding.addComponent(btnDynamicApartment);
    layoutApartmentBuilding.setComponentAlignment(btnDynamicApartment, Alignment.TOP_RIGHT);
    layoutApartmentBuilding.addComponent(layoutApartmentBuilding1);

    // valuation of land
    layoutValuationConst.setSpacing(true);
    layoutValuationConst1.setSpacing(true);
    layoutValuationConst1.addComponent(tfUndividedShare);
    layoutValuationConst1.addComponent(tfSuperBuiltupArea);
    layoutValuationConst1.addComponent(tfCostofApartment);
    layoutValuationConst1.addComponent(tfRateofApartment);
    layoutValuationConst1.addComponent(slIsRateReasonable);
    layoutValuationConst1.addComponent(tfStageOfConstruction);
    layoutValuationConst1.addComponent(tfCostOfConstAsAtSite);
    layoutValuationConst1.addComponent(tfCostOfConstAsPerAgree);

    layoutValuationConst1.addComponent(tfDynamicConstValuation1);
    layoutValuationConst1.addComponent(tfDynamicConstValuation2);
    tfDynamicConstValuation1.setVisible(false);
    tfDynamicConstValuation2.setVisible(false);

    layoutValuationConst.addComponent(btnDynamicConstValuation);
    layoutValuationConst.setComponentAlignment(btnDynamicConstValuation, Alignment.TOP_RIGHT);
    layoutValuationConst.addComponent(layoutValuationConst1);
    layoutValuationConst1.setMargin(true);

    // add components in main panel
    accordion.setWidth("100%");
    layoutEvaluationDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutEvaluationDetails), "Evaluation Details");
    layoutOwnerDetails.setStyleName("bluebar");
    layoutAssetDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutAssetOwner), "Owner Details/Asset Details");
    layoutNormalLegal.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutNormalLegal), "Document Details");
    panelAdjoinProperties.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(panelAdjoinProperties), "Adjoining Properties");
    panelDimension.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(panelDimension), "Dimensions");
    layoutmachingBoundary.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutmachingBoundary),
            "Matching of Boundaries And Tenure/Occupancy Details");
    layoutNoofRooms.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutNoofRooms), "No. of Rooms/No. of Floors");
    layoutAreaDetails.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutAreaDetails), "Area Details of the Property");
    layoutApartmentBuilding.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutApartmentBuilding),
            "Details of Apartment Building-Under Construction");
    layoutFlatValuation.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutFlatValuation), "Flat Under Valuation");
    layoutPlanApproval.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutPlanApproval), "Details of Plan Approval");
    panelBuildSpecfication.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(panelBuildSpecfication), "Specification");
    layoutValuationConst.setStyleName("bluebar");
    accordion.addTab(PanelGenerator.createPanel(layoutValuationConst), "Valuation of under construction");

    layoutMainForm.addComponent(PanelGenerator.createPanel(accordion));

    layoutMainForm.setMargin(true);
    layoutMainForm.setSpacing(true);
    // for main panel
    layoutButton2.setSpacing(true);
    btnSave.setStyleName("savebt");
    btnCancel.setStyleName("cancelbt");
    //   saveExcel.addStyleName("downloadbt");
    btnSubmit.setStyleName("submitbt");
    layoutButton2.addComponent(btnSave);
    layoutButton2.addComponent(btnSubmit);
    //layoutButton2.addComponent(saveExcel);
    layoutButton2.addComponent(btnCancel);

    excelexporter.setTableToBeExported(tblEvalDetails);
    excelexporter.setCaption("Microsoft Excel (XLS)");
    excelexporter.setStyleName("borderless");

    csvexporter.setTableToBeExported(tblEvalDetails);
    csvexporter.setCaption("Comma Dilimited (CSV)");
    csvexporter.setStyleName("borderless");

    pdfexporter.setTableToBeExported(tblEvalDetails);
    pdfexporter.setCaption("Acrobat Document (PDF)");
    pdfexporter.setStyleName("borderless");

    btnSave.setVisible(false);
    btnCancel.setVisible(false);
    btnSubmit.setVisible(false);
    //saveExcel.setVisible(false);
    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);

    // Initaited the Label Function here by Hohul
    lblTableTitle = new Label();
    lblSaveNotification = new Label();
    lblSaveNotification.setContentMode(ContentMode.HTML);
    lblNotificationIcon = new Label();
    lblTableTitle.setValue("<B>&nbsp;&nbsp;Action:</B>");
    lblTableTitle.setContentMode(ContentMode.HTML);
    lblFormTittle = new Label();
    lblFormTittle.setContentMode(ContentMode.HTML);
    lblFormTittle.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;Home");
    lblFormTitle1 = new Label();
    lblFormTitle1.setContentMode(ContentMode.HTML);
    lblFormTitle1.setValue("&nbsp;&nbsp;<b>" + screenName + "</b>&nbsp;::&nbsp;");
    lblAddEdit = new Label();
    lblAddEdit.setContentMode(ContentMode.HTML);

    // Button Back declaration by Hohul
    btnBack = new Button("Home", this);
    btnBack.setStyleName("link");

    // Bread Scrumbs initiated here by Hohul

    hlBreadCrumbs = new HorizontalLayout();
    hlBreadCrumbs.addComponent(lblFormTitle1);
    hlBreadCrumbs.addComponent(btnBack);
    hlBreadCrumbs.setComponentAlignment(btnBack, Alignment.TOP_CENTER);
    hlBreadCrumbs.addComponent(lblAddEdit);
    hlBreadCrumbs.setComponentAlignment(lblAddEdit, Alignment.MIDDLE_CENTER);
    hlBreadCrumbs.setVisible(false);

    mainPanel.addComponent(layoutMainForm);
    mainPanel.setVisible(false);

    // for search panel
    // for search panel
    // Added by Hohul ----->  For Search Panel Layouts
    FormLayout flSearchEvalNumber = new FormLayout();
    flSearchEvalNumber.addComponent(tfSearchEvalNumber);

    FormLayout flSearchBankbranch = new FormLayout();
    flSearchBankbranch.addComponent(tfSearchBankBranch);

    FormLayout flSearchCustomer = new FormLayout();
    flSearchCustomer.addComponent(tfSearchCustomer);

    HorizontalLayout hlSearchComponentLayout = new HorizontalLayout();
    hlSearchComponentLayout.addComponent(flSearchEvalNumber);
    hlSearchComponentLayout.addComponent(flSearchBankbranch);
    hlSearchComponentLayout.addComponent(flSearchCustomer);
    hlSearchComponentLayout.setSpacing(true);
    hlSearchComponentLayout.setMargin(true);

    //Initialization and properties for btnDownload      
    btnDownload = new Button("Download");
    //btnDownload.setDescription("Download");
    btnDownload.addStyleName("downloadbt");
    btnDownload.addClickListener(new ClickListener() {
        /**
        * 
        */
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            //  UI.getCurrent()..clearDashboardButtonBadge();
            event.getButton().removeStyleName("unread");
            if (notifications != null && notifications.getUI() != null)
                notifications.close();
            else {
                buildNotifications(event);
                UI.getCurrent().addWindow(notifications);
                notifications.focus();
                ((VerticalLayout) UI.getCurrent().getContent())
                        .addLayoutClickListener(new LayoutClickListener() {
                            /**
                            * 
                            */
                            private static final long serialVersionUID = 1L;

                            @Override
                            public void layoutClick(LayoutClickEvent event) {
                                notifications.close();
                                ((VerticalLayout) UI.getCurrent().getContent()).removeLayoutClickListener(this);
                            }
                        });
            }

        }
    });

    hlFileDownloadLayout = new HorizontalLayout();
    hlFileDownloadLayout.setSpacing(true);
    hlFileDownloadLayout.addComponent(btnDownload);
    hlFileDownloadLayout.setComponentAlignment(btnDownload, Alignment.MIDDLE_CENTER);

    VerticalLayout vlSearchandResetButtonLAyout = new VerticalLayout();
    vlSearchandResetButtonLAyout.setSpacing(true);
    vlSearchandResetButtonLAyout.addComponent(btnReset);
    vlSearchandResetButtonLAyout.setWidth("100");
    vlSearchandResetButtonLAyout.addStyleName("topbarthree");
    vlSearchandResetButtonLAyout.setMargin(true);

    HorizontalLayout hlSearchComponentandButtonLayout = new HorizontalLayout();
    hlSearchComponentandButtonLayout.setSizeFull();
    hlSearchComponentandButtonLayout.setSpacing(true);
    hlSearchComponentandButtonLayout.addComponent(hlSearchComponentLayout);
    hlSearchComponentandButtonLayout.setComponentAlignment(hlSearchComponentLayout, Alignment.MIDDLE_LEFT);
    hlSearchComponentandButtonLayout.addComponent(vlSearchandResetButtonLAyout);
    hlSearchComponentandButtonLayout.setComponentAlignment(vlSearchandResetButtonLAyout,
            Alignment.MIDDLE_RIGHT);
    hlSearchComponentandButtonLayout.setExpandRatio(vlSearchandResetButtonLAyout, 1);
    final VerticalLayout vlSearchComponentandButtonLayout = new VerticalLayout();
    vlSearchComponentandButtonLayout.setSpacing(true);
    vlSearchComponentandButtonLayout.setSizeFull();
    vlSearchComponentandButtonLayout.addComponent(hlSearchComponentandButtonLayout);

    /*layoutSearch.addComponent(tfSearchEvalNumber);
    layoutSearch.addComponent(tfSearchBankBranch);
    layoutSearch.addComponent(tfSearchCustomer);
    layoutSearch.addComponent(btnReset);
    layoutSearch.setComponentAlignment(btnReset, Alignment.BOTTOM_LEFT);*/
    btnReset.addStyleName("resetbt");

    tfSearchCustomer.setImmediate(true);
    tfSearchCustomer.addListener(new TextChangeListener() {
        private static final long serialVersionUID = 1L;
        SimpleStringFilter filter = null;

        public void textChange(TextChangeEvent event) {
            Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
            if (filter != null)
                f.removeContainerFilter(filter);

            filter = new SimpleStringFilter("custName", event.getText(), true, false);

            f.addContainerFilter(filter);
            total = f.size();
            tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
        }
    });
    tfSearchEvalNumber.setImmediate(true);
    tfSearchEvalNumber.addListener(new TextChangeListener() {
        private static final long serialVersionUID = 1L;
        SimpleStringFilter filter = null;

        public void textChange(TextChangeEvent event) {
            Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
            if (filter != null)
                f.removeContainerFilter(filter);
            filter = new SimpleStringFilter("evalNo", event.getText(), true, false);

            f.addContainerFilter(filter);
            total = f.size();
            tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
        }
    });

    tfSearchBankBranch.setImmediate(true);
    tfSearchBankBranch.addValueChangeListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = 1L;
        Filter filter = null;

        @Override
        public void valueChange(ValueChangeEvent event) {
            // TODO Auto-generated method stub

            try {
                String strBankBranch = tfSearchBankBranch.getValue().toString();
                Filterable f = (Filterable) tblEvalDetails.getContainerDataSource();
                if (filter != null)
                    f.removeContainerFilter(filter);

                filter = new Compare.Equal("bankBranch", strBankBranch);
                f.addContainerFilter(filter);
                total = f.size();
                tblEvalDetails.setColumnFooter("lastUpdateDt", "No. of Records:" + total);
                f.addContainerFilter(filter);
            } catch (Exception e) {
            }
        }

    });
    searchPanel.addComponent(PanelGenerator.createPanel(vlSearchComponentandButtonLayout));
    searchPanel.setMargin(true);
    // Add Layout table panel by Hohul

    HorizontalLayout flTableCaption = new HorizontalLayout();
    flTableCaption.addComponent(lblTableTitle);
    flTableCaption.setComponentAlignment(lblTableTitle, Alignment.MIDDLE_CENTER);
    flTableCaption.addStyleName("lightgray");
    flTableCaption.setHeight("25px");
    flTableCaption.setWidth("60px");
    lblNoofRecords = new Label(" ", ContentMode.HTML);
    lblNoofRecords.addStyleName("lblfooter");

    HorizontalLayout hlTableTittleLayout = new HorizontalLayout();
    hlTableTittleLayout.addComponent(flTableCaption);
    hlTableTittleLayout.addComponent(btnAdd);
    hlTableTittleLayout.addComponent(btnEdit);
    hlTableTittleLayout.addComponent(btnView);
    hlTableTittleLayout.setHeight("25px");
    hlTableTittleLayout.setSpacing(true);

    HorizontalLayout hlTableTitleandCaptionLayout = new HorizontalLayout();
    hlTableTitleandCaptionLayout.addStyleName("topbarthree");
    hlTableTitleandCaptionLayout.setWidth("100%");
    hlTableTitleandCaptionLayout.addComponent(hlTableTittleLayout);
    hlTableTitleandCaptionLayout.addComponent(hlFileDownloadLayout);
    hlTableTitleandCaptionLayout.setComponentAlignment(hlFileDownloadLayout, Alignment.MIDDLE_RIGHT);
    hlTableTitleandCaptionLayout.setHeight("28px");

    // for table panel
    btnAdd.addStyleName("add");
    btnEdit.addStyleName("editbt");
    btnView.addStyleName("view");
    btnView.setEnabled(false);

    hlAddEditLayout.addStyleName("topbarthree");
    hlAddEditLayout.setWidth("100%");
    hlAddEditLayout.addComponent(hlTableTitleandCaptionLayout);
    hlAddEditLayout.setHeight("28px");
    // Added Action Label to Table

    layoutTable.addComponent(hlAddEditLayout);
    layoutTable.setComponentAlignment(hlAddEditLayout, Alignment.TOP_LEFT);
    layoutTable.addComponent(tblEvalDetails);

    tablePanel.addComponent(layoutTable);
    tablePanel.setWidth("100%");
    tablePanel.setMargin(true);

    layoutPage.addComponent(mainPanel);
    layoutPage.addComponent(searchPanel);
    layoutPage.addComponent(tablePanel);

    // Added labels and titles to respective Location by Hohul

    HorizontalLayout hlNotificationLayout = new HorizontalLayout();
    hlNotificationLayout.addComponent(lblNotificationIcon);
    hlNotificationLayout.setComponentAlignment(lblNotificationIcon, Alignment.MIDDLE_CENTER);
    hlNotificationLayout.addComponent(lblSaveNotification);
    hlNotificationLayout.setComponentAlignment(lblSaveNotification, Alignment.MIDDLE_CENTER);
    hlHeaderLayout.addComponent(lblFormTittle);
    hlHeaderLayout.setComponentAlignment(lblFormTittle, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(hlBreadCrumbs);
    hlHeaderLayout.setComponentAlignment(hlBreadCrumbs, Alignment.MIDDLE_LEFT);
    hlHeaderLayout.addComponent(hlNotificationLayout);
    hlHeaderLayout.setComponentAlignment(hlNotificationLayout, Alignment.MIDDLE_CENTER);
    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.MIDDLE_RIGHT);

    hlHeaderLayout.addComponent(layoutButton2);
    hlHeaderLayout.setComponentAlignment(layoutButton2, Alignment.BOTTOM_RIGHT);

    // load Component list values
    loadComponentListValues();

    //setTableProperties();
    populateAndConfig(false);
}

From source file:com.grimesco.gcocentralapp.MainApplication.java

private void initLayout() {

    setContent(rootLayout);//from   w  w  w  .  jav a  2 s .  c o  m

    rootLayout.setMargin(true);
    rootLayout.setSizeFull();

    titleLabel.addStyleName(Runo.LABEL_H1);
    titleLabel.setSizeUndefined();
    sloganLabel.addStyleName(Runo.LABEL_SMALL);
    sloganLabel.setSizeUndefined();

    rootLayout.addComponent(titleLabel);
    rootLayout.setComponentAlignment(titleLabel, Alignment.TOP_CENTER);
    rootLayout.addComponent(sloganLabel);
    rootLayout.setComponentAlignment(sloganLabel, Alignment.TOP_CENTER);

    spacer.setHeight("20px");
    rootLayout.addComponent(spacer);

    splitPanel.setStyleName(Runo.SPLITPANEL_REDUCED);
    splitPanel.setSplitPosition(25, Unit.PERCENTAGE);
    splitPanel.setLocked(false);

    rootLayout.addComponent(splitPanel);
    rootLayout.setExpandRatio(splitPanel, 1);

    leftPanel.setSizeFull();
    splitPanel.setFirstComponent(leftPanel);

    accordion.setSizeFull();
    leftPanel.setContent(accordion);

    //-- add custodian menus
    this.custodianMenuLayout.setMargin(true); // Have margin on all sides around the layout
    this.custodianMenuLayout.setSpacing(true); // add spacing
    this.custodianMenuLayout.addComponent(TDbutton);
    this.custodianMenuLayout.addComponent(Schwabbutton);
    this.custodianMenuLayout.addComponent(Fidelitybutton);
    this.custodianMenuLayout.addComponent(Resourcebutton);

    //-- add database sync menus
    this.databaseMenuLayout.setMargin(true); // Have margin on all sides around the layout
    this.databaseMenuLayout.setSpacing(true); // add spacing
    this.databaseMenuLayout.addComponent(Axysbutton);
    this.databaseMenuLayout.addComponent(Salenticabutton);

    //-- add chart menus
    this.chartMenuLayout.setMargin(true); // Have margin on all sides around the layout
    this.chartMenuLayout.setSpacing(true); // add spacing
    this.chartMenuLayout.addComponent(Chart1button);
    this.chartMenuLayout.addComponent(AccountViewbutton);

    accordion.addTab(this.databaseMenuLayout, "Database Sync", null);
    accordion.addTab(this.custodianMenuLayout, "Transactions by Custodian", null);
    accordion.addTab(this.chartMenuLayout, "Charts", null);
    accordion.addTab(new Label(""), "Preferences", null);
    accordion.addTab(new Label(""), "Quick Search", null);

    splitPanel.setSecondComponent(rightLayout);
    splitPanel.setLocked(false);

}