コード例 #1
0
 @Override
 protected void addDetails() {
   logger.info(
       "Company ID : "
           + companyid
           + " | User Name : "
           + username
           + " > "
           + "Adding new record...");
   // remove the components in the search layout and input controls in the same container
   hlUserInputLayout.removeAllComponents();
   hlUserIPContainer.addComponent(GERPPanelGenerator.createPanel(hlUserInputLayout));
   assembleInputUserLayout();
   // reset the input controls to default value
   tblMstScrSrchRslt.setVisible(false);
   hlCmdBtnLayout.setVisible(false);
   btnaddSpec.setCaption("Add");
   tblSmsEnqDtl.setVisible(true);
   cbBranch.setRequired(true);
   lsVendorName.setRequired(true);
   tfEnqNo.setReadOnly(true);
   lsProduct.setRequired(true);
   lsProduct.setComponentError(null);
   dfEnqDate.setComponentError(null);
   cbUom.setRequired(true);
   loadPurDtl();
   resetFields();
   tfEnqNo.setReadOnly(true);
   try {
     tfEnqNo.setReadOnly(false);
     SlnoGenDM slnoObj =
         serviceSlnogen.getSequenceNumber(companyid, branchId, moduleId, "SM_ENQRYNO ").get(0);
     if (slnoObj.getAutoGenYN().equals("Y")) {
       tfEnqNo.setValue(slnoObj.getKeyDesc());
       tfEnqNo.setReadOnly(true);
     } else {
       tfEnqNo.setReadOnly(false);
     }
   } catch (Exception e) {
     logger.info(e.getMessage());
   }
   comments =
       new SmsComments(
           vlTableForm,
           null,
           companyid,
           null,
           null,
           null,
           null,
           null,
           null,
           null,
           null,
           null,
           null,
           null);
 }
コード例 #2
0
 @Override
 protected void editDetails() {
   hlUserInputLayout.removeAllComponents();
   hlUserIPContainer.addComponent(GERPPanelGenerator.createPanel(hlUserInputLayout));
   assembleInputUserLayout();
   tblMstScrSrchRslt.setVisible(false);
   hlCmdBtnLayout.setVisible(false);
   tblSmsEnqDtl.setVisible(true);
   if (tfEnqNo.getValue() == null || tfEnqNo.getValue().trim().length() == 0) {
     tfEnqNo.setReadOnly(false);
   }
   cbBranch.setRequired(true);
   lsVendorName.setRequired(true);
   resetFields();
   editPurHdr();
   editSmsPurDetail();
   lsProduct.setRequired(true);
   cbUom.setRequired(true);
 }
コード例 #3
0
  private void buildView() {
    logger.info(
        "Company ID : "
            + companyId
            + " | User Name : "
            + userName
            + " > "
            + "Painting Attendance Process UI");
    // Material Components Definition
    btnsaveAttenProc.setVisible(false);
    cbPayPeried = new GERPComboBox("Pay Period");
    cbPayPeried.setImmediate(true);
    cbPayPeried.setNullSelectionAllowed(false);
    cbPayPeried.setWidth("130");
    cbPayPeried.setItemCaptionPropertyId("periodName");
    cbPayPeried.addValueChangeListener(
        new Property.ValueChangeListener() {
          private static final long serialVersionUID = 1L;

          @Override
          public void valueChange(ValueChangeEvent event) {
            Object itemId = event.getProperty().getValue();
            if (itemId != null) {
              BeanItem<?> item = (BeanItem<?>) cbPayPeried.getItem(itemId);
              payPeriodList = (PayPeriodDM) item.getBean();
              payPeriodId = payPeriodList.getPayPeriodId();
              loadStartandEndDates();
            }
          }
        });
    btnsaveAttenProc.setCaption("Save");
    tblMstScrSrchRslt.addItemClickListener(
        new ItemClickListener() {
          private static final long serialVersionUID = 1L;

          @Override
          public void itemClick(ItemClickEvent event) {
            if (tblMstScrSrchRslt.isSelected(event.getItemId())) {
              tblMstScrSrchRslt.setImmediate(true);
              btnsaveAttenProc.setStyleName("savebt");
              resetFields();
            } else {
              ((AbstractSelect) event.getSource()).select(event.getItemId());
              btnsaveAttenProc.setStyleName("savebt");
              readonlyfalse();
              editAttenProc();
              readonlytrue();
            }
          }
        });
    hlPageHdrContainter.addComponent(btnsaveAttenProc);
    hlPageHdrContainter.setComponentAlignment(btnsaveAttenProc, Alignment.MIDDLE_RIGHT);
    tfProcessPeriod = new GERPTextField("Process Period");
    tfProcessPeriod.setWidth("170");
    tfProcessPeriod.setReadOnly(true);
    cbBranch = new GERPComboBox("Branch");
    cbBranch.setWidth("170");
    cbBranch.setNullSelectionAllowed(false);
    cbBranch.setItemCaptionPropertyId("branchName");
    cbBranch.setImmediate(true);
    cbBranch.setValue(0L);
    cbBranch.addValueChangeListener(
        new Property.ValueChangeListener() {
          private static final long serialVersionUID = 1L;

          @Override
          public void valueChange(ValueChangeEvent event) {
            Object itemId = event.getProperty().getValue();
            if (itemId != null) {
              loadEmployeeList();
            }
          }
        });
    btnsaveAttenProc.addClickListener(
        new ClickListener() {
          // Click Listener for Add and Update
          private static final long serialVersionUID = 6551953728534136363L;

          @Override
          public void buttonClick(ClickEvent event) {
            saveattapprove();
          }
        });
    cbEmployeeName = new GERPComboBox("Employee Name");
    cbEmployeeName.setItemCaptionPropertyId("firstname");
    cbEmployeeName.setWidth("200");
    cbEmployeeName.setImmediate(true);
    cbEmployeeName.setNullSelectionAllowed(false);
    btnSearchStaff = new GERPButton("Search Employee", "searchbt", this);
    btnAttendanceProc = new GERPButton("Run Attendance Process", "savebt", this);
    btnAttendanceProc.addClickListener(
        new ClickListener() {
          private static final long serialVersionUID = 1L;

          @Override
          public void buttonClick(ClickEvent event) {
            // TODO Auto-generated method stub
            loadAttendenceProcess();
            // new AttendenceApprove();
          }
        });
    btnSearch.setVisible(false);
    hlSearchLayout = new GERPAddEditHLayout();
    assembleSearchLayout();
    hlSrchContainer.addComponent(GERPPanelGenerator.createPanel(hlSearchLayout));
    resetFields();
    loadAttendanceProcessBranchList();
    loadPayPeriod();
    loadSrchRslt();
  }
コード例 #4
0
 private void assembleInputUserLayout() {
   logger.info(
       "Company ID : "
           + companyid
           + " | User Name : "
           + username
           + " > "
           + "Assembling search layout");
   // Remove all components in search layout
   hlUserInputLayout.removeAllComponents();
   flSmsPurHdr1 = new FormLayout();
   flSmsPurHdr2 = new FormLayout();
   flSmsPurHdr3 = new FormLayout();
   flSmsPurHdr4 = new FormLayout();
   flSmsPurHdr1.addComponent(tfEnqNo);
   flSmsPurHdr1.addComponent(cbBranch);
   flSmsPurHdr2.addComponent(lsVendorName);
   cbEnqStatus.setWidth("130px");
   cbEnqStatus.setHeight("24px");
   flSmsPurHdr3.addComponent(dfEnqDate);
   flSmsPurHdr3.addComponent(dfDueDate);
   flSmsPurHdr3.addComponent(cbEnqStatus);
   flSmsPurHdr4.addComponent(taEnqRem);
   HorizontalLayout hlSmsEnqHDR = new HorizontalLayout();
   hlSmsEnqHDR.addComponent(flSmsPurHdr1);
   hlSmsEnqHDR.addComponent(flSmsPurHdr2);
   hlSmsEnqHDR.addComponent(flSmsPurHdr3);
   lbl = new Label(" ");
   hlSmsEnqHDR.addComponent(lbl);
   hlSmsEnqHDR.addComponent(flSmsPurHdr4);
   tfEnqNo.setReadOnly(true);
   hlSmsEnqHDR.setSpacing(true);
   hlSmsEnqHDR.setMargin(true);
   // Adding SmsEnqDtl components
   // Add components for User Input Layout
   flSmsPurDtl1 = new FormLayout();
   flSmsPurDtl2 = new FormLayout();
   flSmsPurDtl3 = new FormLayout();
   flSmsPurDtl4 = new FormLayout();
   flSmsPurDtl5 = new FormLayout();
   flSmsPurDtl6 = new FormLayout();
   flSmsPurDtl1.addComponent(lsProduct);
   HorizontalLayout hlQtyUom = new HorizontalLayout();
   hlQtyUom.addComponent(tfEnqQty);
   hlQtyUom.addComponent(cbUom);
   hlQtyUom.setCaption("Enquiry Qty");
   flSmsPurDtl2.addComponent(hlQtyUom);
   flSmsPurDtl2.setComponentAlignment(hlQtyUom, Alignment.TOP_LEFT);
   flSmsPurDtl4.addComponent(taEnqDtlRem);
   flSmsPurDtl5.addComponent(cbEnqDtlStatus);
   VerticalLayout btn = new VerticalLayout();
   btn.addComponent(btnaddSpec);
   btn.addComponent(btndelete);
   flSmsPurDtl5.addComponent(btn);
   HorizontalLayout hlSmsEnqdTL = new HorizontalLayout();
   hlSmsEnqdTL.addComponent(flSmsPurDtl1);
   hlSmsEnqdTL.addComponent(flSmsPurDtl2);
   hlSmsEnqdTL.addComponent(flSmsPurDtl3);
   hlSmsEnqdTL.addComponent(flSmsPurDtl4);
   hlSmsEnqdTL.addComponent(flSmsPurDtl5);
   hlSmsEnqdTL.addComponent(flSmsPurDtl6);
   hlSmsEnqdTL.setSpacing(true);
   hlSmsEnqdTL.setMargin(true);
   VerticalLayout vlSmsEnqHDR = new VerticalLayout();
   vlSmsEnqHDR = new VerticalLayout();
   vlSmsEnqHDR.addComponent(hlSmsEnqdTL);
   vlSmsEnqHDR.addComponent(tblSmsEnqDtl);
   vlSmsEnqHDR.setSpacing(true);
   TabSheet dtlTab = new TabSheet();
   dtlTab.addTab(vlSmsEnqHDR, "Purchase Enquiry Detail");
   dtlTab.addTab(vlTableForm, "Comments");
   VerticalLayout vlSmsEnqHdrdTL = new VerticalLayout();
   vlSmsEnqHdrdTL = new VerticalLayout();
   vlSmsEnqHdrdTL.addComponent(GERPPanelGenerator.createPanel(hlSmsEnqHDR));
   vlSmsEnqHdrdTL.addComponent(GERPPanelGenerator.createPanel(dtlTab));
   vlSmsEnqHdrdTL.setSpacing(true);
   vlSmsEnqHdrdTL.setWidth("100%");
   hlUserInputLayout.addComponent(vlSmsEnqHdrdTL);
   hlUserInputLayout.setSizeFull();
   hlUserInputLayout.setWidth("100%");
   hlUserInputLayout.setMargin(false);
   hlUserInputLayout.setSpacing(true);
 }
コード例 #5
0
  private void buildView() {
    logger.info(
        "Company ID : "
            + companyid
            + " | User Name : "
            + username
            + " > "
            + "Painting PurchaseEnquiry UI");
    // Initialization for Purchase Enquire Details user input components
    tfEnqNo = new TextField("Enquiry No");
    tfEnqNo.setMaxLength(40);
    tfEnqQty = new TextField();
    tfEnqQty.setValue("0");
    tfEnqQty.setWidth("90");
    dfDueDate = new GERPPopupDateField("Due Date");
    dfDueDate.setInputPrompt("Select Date");
    dfEnqDate = new GERPPopupDateField("Enquiry Date");
    dfEnqDate.setInputPrompt("Select Date");
    taEnqDtlRem = new TextArea("Remarks");
    taEnqDtlRem.setMaxLength(40);
    taEnqDtlRem.setWidth("150");
    taEnqDtlRem.setHeight("50");
    taEnqRem = new TextArea("Remarks");
    taEnqRem.setHeight("50");
    taEnqDtlRem.setMaxLength(100);
    cbBranch = new GERPComboBox("Branch Name");
    cbBranch.setItemCaptionPropertyId("branchName");
    loadBranchList();
    try {
      ApprovalSchemaDM obj =
          serviceSmsPurEnqHdr.getReviewerId(companyid, appScreenId, branchId, roleId).get(0);
      if (obj.getApprLevel().equals("Approver")) {
        cbEnqStatus =
            new GERPComboBox("Status", BASEConstants.T_SMS_P_ENQUIRY_HDR, BASEConstants.RP_STATUS);
      } else {
        cbEnqStatus =
            new GERPComboBox(
                "Status", BASEConstants.T_SMS_P_ENQUIRY_HDR, BASEConstants.PE_STATUS_RV);
      }
    } catch (Exception e) {
      logger.info(e.getMessage());
    }
    cbEnqStatus.setWidth("120");
    cbEnqDtlStatus =
        new GERPComboBox("Status", BASEConstants.M_GENERIC_TABLE, BASEConstants.M_GENERIC_COLUMN);
    lsProduct = new ListSelect("Product Name");
    lsProduct.setItemCaptionPropertyId("prodname");
    lsProduct.setMultiSelect(true);
    loadProduct();
    lsProduct.setImmediate(true);
    lsProduct.addValueChangeListener(
        new ValueChangeListener() {
          /** */
          private static final long serialVersionUID = 1L;

          @Override
          public void valueChange(ValueChangeEvent event) {
            String[] split =
                lsProduct
                    .getValue()
                    .toString()
                    .replaceAll("\\[", "")
                    .replaceAll("\\]", "")
                    .split(",");
            for (String obj : split) {
              if (obj.trim().length() > 0) {
                cbUom.setReadOnly(false);
                cbUom.setValue(
                    serviceProduct
                        .getProductList(
                            companyid, Long.valueOf(obj.trim()), null, null, null, null, null, "F")
                        .get(0)
                        .getUom());
                cbUom.setReadOnly(true);
              }
            }
          }
        });
    cbUom = new TextField();
    cbUom.setWidth("77");
    cbUom.setHeight("23");
    lsVendorName = new ListSelect("Vendor Name ");
    lsVendorName.setMultiSelect(true);
    lsVendorName.setItemCaptionPropertyId("vendorName");
    loadVendorList();
    lsVendorName.setWidth("150");
    lsVendorName.setHeight("75");
    hlSearchLayout = new GERPAddEditHLayout();
    assembleSearchLayout();
    hlSrchContainer.addComponent(GERPPanelGenerator.createPanel(hlSearchLayout));
    resetFields();
    loadSrchRslt();
    loadPurDtl();
    btnaddSpec.setStyleName("add");
    btnaddSpec.addClickListener(
        new ClickListener() {
          // Click Listener for Add and Update
          private static final long serialVersionUID = 6551953728534136363L;

          @Override
          public void buttonClick(ClickEvent event) {
            if (dtlValidation()) {
              saveEnqDtl();
            }
          }
        });
    btndelete.setEnabled(false);
    // ClickListener for Enquire Detail Tale
    tblSmsEnqDtl.addItemClickListener(
        new ItemClickListener() {
          private static final long serialVersionUID = 1L;

          @Override
          public void itemClick(ItemClickEvent event) {
            if (tblSmsEnqDtl.isSelected(event.getItemId())) {
              tblSmsEnqDtl.setImmediate(true);
              btnaddSpec.setCaption("Add");
              btnaddSpec.setStyleName("savebt");
              btndelete.setEnabled(false);
              enqDtlresetFields();
            } else {
              ((AbstractSelect) event.getSource()).select(event.getItemId());
              btnaddSpec.setCaption("Update");
              btnaddSpec.setStyleName("savebt");
              btndelete.setEnabled(true);
              editSmsPurDetail();
            }
          }
        });
    btndelete.addClickListener(
        new ClickListener() {
          // Click Listener for Add and Update
          private static final long serialVersionUID = 6551953728534136363L;

          @Override
          public void buttonClick(ClickEvent event) {
            if (btndelete == event.getButton()) {
              deleteDetails();
            }
          }
        });
  }
コード例 #6
0
ファイル: EmailLogger.java プロジェクト: anjijava16/grep-j-w
  // Build the UI components
  private void buildview() {
    logger.info(
        "Company ID : "
            + companyid
            + " | User Name : "
            + username
            + " > "
            + "Painting Email logger UI");
    btnAdd.setVisible(false);
    btnDownload.setVisible(false);
    btnEdit.setVisible(false);
    btnAuditRecords.setVisible(false);
    // Email-id text box
    tfemailid = new TextField("Email Id");
    // product combo box
    cbproduct = new GERPComboBox("Product Name");
    cbproduct.setItemCaptionPropertyId("prodname");
    loadProductList();
    // Email start date
    dfemailStartdate = new GERPPopupDateField("Log Start Dt");
    dfemailStartdate.setInputPrompt("Select Date");
    // Email End date
    dfemailEndDate = new GERPPopupDateField("Log End Dt");
    dfemailEndDate.setInputPrompt("Select Date");
    btndelete = new Button("Delete");
    btndelete.addStyleName("delete");
    btndelete.setEnabled(true);
    btndelete.setVisible(true);
    btndelete.addClickListener(
        new ClickListener() {
          private static final long serialVersionUID = 1L;

          @Override
          public void buttonClick(ClickEvent event) {
            btndelete.setEnabled(true);
            if (cockeckall.getValue().equals(true)) {
              for (EmailLoggerDM obj : emailList) {
                serviceemailLogger.delete(obj.getEmaillogId());
              }

            } else {
              delete();
            }

            loadSrchRslt();
            /*	btndelete.setEnabled(false);
            cockeckall.setValue(false);*/
          }
        });
    cockeckall = new CheckBox("Select All");
    cockeckall.addStyleName("delete");
    cockeckall.setEnabled(true);
    cockeckall.setVisible(true);
    setCheckBoxTable();
    cockeckall.setImmediate(true);
    cockeckall.addValueChangeListener(
        new Property.ValueChangeListener() {
          private static final long serialVersionUID = 1L;

          public void valueChange(ValueChangeEvent event) {
            if (event.getProperty().getValue().equals(true)) {
              loadSrchRslt();
              btndelete.setEnabled(true);
            } else {
              loadSrchRslt();
              btndelete.setEnabled(false);
            }
          }
        });
    hlCmdBtnLayout.addComponent(cockeckall);
    hlCmdBtnLayout.setSpacing(true);
    hlCmdBtnLayout.setComponentAlignment(cockeckall, Alignment.MIDDLE_RIGHT);
    hlCmdBtnLayout.addComponent(btndelete);
    hlCmdBtnLayout.setComponentAlignment(btndelete, Alignment.MIDDLE_RIGHT);
    hlCmdBtnLayout.setExpandRatio(btndelete, 1);
    // build search layout
    hlSearchLayout = new GERPAddEditHLayout();
    assembleSearchLayout();
    hlSrchContainer.addComponent(GERPPanelGenerator.createPanel(hlSearchLayout));
    resetFields();
    loadSrchRslt();
  }