예제 #1
0
  public DeliveryOrderLayout(final User currentUser) {
    // Tab reviseTab = new Tab("ข้อมูลใบแจ้งหนี้", "icons/16/search-good-icon.png");
    // VLayout reviseLayout = new VLayout();
    // reviseLayout.
    setWidth(750);
    // reviseLayout.
    setHeight100();

    HLayout searchLayout = new HLayout();
    searchLayout.setHeight(20);

    final DynamicForm searchForm = new DynamicForm();
    searchForm.setWidth(450);
    searchForm.setHeight(30);
    searchForm.setMargin(5);
    searchForm.setNumCols(4);
    searchForm.setCellPadding(2);
    searchForm.setAutoFocus(true);
    searchForm.setSelectOnFocus(true);
    searchForm.setIsGroup(true);
    searchForm.setDataSource(DeliveryDS.getInstance());
    searchForm.setUseAllDataSourceFields(false);
    searchForm.setGroupTitle("ค้นหารายการนำส่งสินค้า");

    final TextItem deliveryText = new TextItem("delivery_id", "รหัสรายการนำส่งสินค้า");
    deliveryText.setWrapTitle(false);
    deliveryText.setOperator(OperatorId.REGEXP);
    final TextItem saleText = new TextItem("sale_id", "รหัสรายการขาย");
    saleText.setWrapTitle(false);
    saleText.setOperator(OperatorId.REGEXP);
    final SelectItem statusSelected = new SelectItem("issued_status", "สถานะ");
    statusSelected.setWrapTitle(false);
    // statusSelected.setValueMap("กำลังนำส่ง", "นำส่งแล้ว");
    statusSelected.setValueMap(DeliveryStatus.getIssueValueMap());
    statusSelected.setAllowEmptyValue(true);
    statusSelected.setEmptyDisplayValue("ทั้งหมด");
    statusSelected.setOperator(OperatorId.EQUALS);
    final TextItem cidText = new TextItem("cid", "รหัสลูกค้า");
    cidText.setWrapTitle(false);
    cidText.setOperator(OperatorId.REGEXP);

    final DynamicForm dateForm = new DynamicForm();
    dateForm.setWidth(300);
    dateForm.setHeight(30);
    dateForm.setMargin(5);
    dateForm.setNumCols(2);
    dateForm.setCellPadding(2);
    dateForm.setSelectOnFocus(true);
    dateForm.setIsGroup(true);
    // dateForm.setGroupTitle("วันที่นำส่งสินค้า");
    dateForm.setGroupTitle("วันที่ออกใบนำส่งสินค้า");
    DateRange dateRange = new DateRange();
    dateRange.setRelativeStartDate(new RelativeDate("-7d"));
    dateRange.setRelativeEndDate(RelativeDate.TODAY);
    // final DateItem from = new DateItem("delivery_from" , "ตั้งแต่");
    // final DateItem to = new DateItem("delivery_to" , "ถึง");
    final DateItem from = new DateItem("created_from", "ตั้งแต่");
    final DateItem to = new DateItem("created_to", "ถึง");
    from.setDefaultChooserDate(dateRange.getStartDate());
    from.setDefaultValue(dateRange.getStartDate());
    from.setUseTextField(true);
    to.setDefaultChooserDate(dateRange.getEndDate());
    to.setDefaultValue(dateRange.getEndDate());
    to.setUseTextField(true);

    FromToValidate.addValidator(from, to);
    searchForm.setItems(deliveryText, statusSelected, saleText, cidText);
    // searchForm.setItems(Text, cidText, cnameText);
    dateForm.setItems(from, to);

    // final ListGrid deliveryListGrid = new EditorListGrid(new RequestViewWindow(), currentUser);
    final ListGrid deliveryListGrid = new ListGrid();

    deliveryListGrid.setAutoFetchData(true);
    deliveryListGrid.setCanMultiSort(true);
    // deliveryListGrid.setCriteria(new Criterion("status", OperatorId.NOT_EQUAL, "ยกเลิก"));

    deliveryListGrid.setDataSource(DeliveryDS.getInstance());
    deliveryListGrid.setInitialSort(
        new SortSpecifier[] {
          new SortSpecifier("issued_status", SortDirection.ASCENDING),
          new SortSpecifier("delivery", SortDirection.DESCENDING)
        });
    deliveryListGrid.setUseAllDataSourceFields(false);
    deliveryListGrid.setGroupByField("issued_status");
    deliveryListGrid.setGroupStartOpen(GroupStartOpen.ALL);

    ListGridField delivery_id = new ListGridField("delivery_id", 120);
    ListGridField sale_id = new ListGridField("sale_id", 100);
    // ListGridField quote_id = new ListGridField("quote_id" , 90);
    ListGridField cus_name = new ListGridField("cus_name", 180);
    ListGridField status = new ListGridField("issued_status");
    //		LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();
    //		valueMap.put("3_approved", "approved");
    //		status.setValueMap(valueMap);
    ListGridField total_amount = new ListGridField("total_amount", 120);
    total_amount.setCellFormatter(FieldFormatter.getIntegerFormat());
    total_amount.setAlign(Alignment.RIGHT);
    //		ListGridField netInclusive = new ListGridField("netInclusive", 125);
    //		netInclusive.setCellFormatter(FieldFormatter.getPriceFormat());
    //		netInclusive.setAlign(Alignment.RIGHT);
    ListGridField delivery_date = new ListGridField("delivery", 120);
    //		created_date.setType(ListGridFieldType.DATE);
    //		created_date.setCellFormatter(new CellFormatter() {
    //
    //			@Override
    //			public String format(Object arg0, ListGridRecord arg1, int arg2, int arg3) {
    //			DateTimeFormat fmt = DateTimeFormat.getFormat("MM/dd/yyyy");
    //			return fmt.format(arg1.getAttributeAsDate("created_date"));
    //			}
    //		});

    //		ListGridField iconField = new ListGridField("viewDeliveryField", "เรียกดูรายการ", 80);

    deliveryListGrid.setFields(status, delivery_id, sale_id, cus_name, total_amount, delivery_date);

    searchLayout.addMembers(searchForm, dateForm);
    // reviseLayout.
    addMember(searchLayout);

    HLayout buttonLayout = new HLayout();
    buttonLayout.setMargin(10);
    buttonLayout.setMembersMargin(5);
    buttonLayout.setHeight(30);
    IButton searchButton = new IButton("ค้นหารายการนำส่งสินค้า");
    searchButton.setIcon("icons/16/icon_view.png");
    searchButton.setWidth(150);
    searchButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            Criterion search = new Criterion();
            search.addCriteria(searchForm.getValuesAsCriteria());
            AdvancedCriteria criteria =
                new AdvancedCriteria(
                    OperatorId.AND,
                    new Criterion[] {
                      // new Criterion("delivery", OperatorId.BETWEEN_INCLUSIVE,
                      // from.getValueAsDate(), to.getValueAsDate()),
                      new Criterion(
                          "created_date",
                          OperatorId.BETWEEN_INCLUSIVE,
                          from.getValueAsDate(),
                          to.getValueAsDate()),
                      search
                    });
            deliveryListGrid.fetchData(criteria);
            deliveryListGrid.deselectAllRecords();
          }
        });

    IButton listAllButton = new IButton("แสดงรายการทั้งหมด");
    listAllButton.setIcon("[SKIN]actions/refresh.png");
    listAllButton.setWidth(150);
    listAllButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            AdvancedCriteria criteria =
                new AdvancedCriteria(
                    OperatorId.AND,
                    new Criterion[] {
                      // new Criterion("delivery", OperatorId.BETWEEN_INCLUSIVE,
                      // from.getValueAsDate(), to.getValueAsDate())
                      new Criterion(
                          "created_date",
                          OperatorId.BETWEEN_INCLUSIVE,
                          from.getValueAsDate(),
                          to.getValueAsDate())
                    });
            searchForm.reset();
            deliveryListGrid.fetchData(criteria);
            deliveryListGrid.deselectAllRecords();
          }
        });

    HLayout empty = new HLayout();
    empty.setWidth("*");
    IButton viewButton = new IButton("เรียกดูรายการ");
    viewButton.setIcon("icons/16/icon_view.png");
    viewButton.setWidth(150);
    viewButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            ListGridRecord selected = deliveryListGrid.getSelectedRecord();
            if (selected == null) {
              SC.warn("กรุณาเลือกรายการเบิกสินค้า");
              return;
            }
            RequestViewWindow deliveryWindow = new RequestViewWindow();
            deliveryWindow.show(selected, false, currentUser, 1);
          }
        });

    IButton receiveOrderButton = new IButton("เบิกจ่ายสินค้า");
    receiveOrderButton.setIcon("icons/16/actions-receive-icon.png");
    receiveOrderButton.setWidth(100);
    receiveOrderButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            ListGridRecord selected = deliveryListGrid.getSelectedRecord();
            if (selected == null) {
              SC.warn("กรุณาเลือกรายการเบิกสินค้า");
              return;
            }

            if (selected
                .getAttributeAsString("issued_status")
                .equalsIgnoreCase("0_product_request")) {
              RequestViewWindow deliveryWindow = new RequestViewWindow();
              deliveryWindow.show(selected, true, currentUser, 2);
            } else {
              SC.warn("จ่ายสินค้าแล้ว");
            }
          }
        });

    buttonLayout.addMembers(searchButton, listAllButton, empty, viewButton, receiveOrderButton);
    // buttonLayout.addMembers(searchButton, listAllButton);
    // reviseLayout.
    addMember(buttonLayout);

    VLayout gridLayout = new VLayout();
    gridLayout.setWidth100();
    gridLayout.setHeight(355);

    gridLayout.addMember(deliveryListGrid);
    // reviseLayout.
    addMember(gridLayout);

    // reviseTab.setPane(reviseLayout);
    // return reviseTab;
  }
예제 #2
0
  public ReportReceiveLayout_2(final User currentUser) {
    setWidth(950);
    setHeight100();

    HLayout searchLayout = new HLayout();
    searchLayout.setHeight(20);

    final DynamicForm searchForm = new DynamicForm();
    searchForm.setWidth(450);
    searchForm.setHeight(30);
    searchForm.setMargin(5);
    searchForm.setNumCols(4);
    searchForm.setCellPadding(2);
    searchForm.setAutoFocus(true);
    searchForm.setSelectOnFocus(true);
    searchForm.setIsGroup(true);
    searchForm.setDataSource(TransferDS.getInstance());
    searchForm.setUseAllDataSourceFields(false);
    searchForm.setGroupTitle("ตัวกรอง");

    final SelectItem statusSelected = new SelectItem("status", "สถานะ");
    statusSelected.setWrapTitle(false);
    // statusSelected.setValueMap("รอแก้ไข", "รออนุมัติ", "อนุมัติแล้ว");
    statusSelected.setValueMap(TransferStatus.getValueMap());
    statusSelected.setAllowEmptyValue(true);
    statusSelected.setEmptyDisplayValue("ทั้งหมด");
    statusSelected.setOperator(OperatorId.EQUALS);
    final TextItem jidText = new TextItem("plan_id", "รหัสแผนการผลิต");
    jidText.setWrapTitle(false);
    jidText.setOperator(OperatorId.REGEXP);
    //		final TextItem smidText = new TextItem("smid", "รหัสช่าง");
    //		smidText.setWrapTitle(false);
    //		smidText.setOperator(OperatorId.REGEXP);

    //		final DynamicForm dateForm = new DynamicForm();
    //		dateForm.setWidth(300);
    //		dateForm.setHeight(30);
    //		dateForm.setMargin(5);
    //		dateForm.setNumCols(2);
    //		dateForm.setCellPadding(2);
    //		dateForm.setSelectOnFocus(true);
    //		dateForm.setIsGroup(true);
    //		dateForm.setGroupTitle("วันที่ขอโอนสินค้า");
    DateRange dateRange = new DateRange();
    dateRange.setRelativeStartDate(new RelativeDate("-1w"));
    dateRange.setRelativeEndDate(RelativeDate.TODAY);
    final DateItem from = new DateItem("create_from", "ตั้งแต่");
    final DateItem to = new DateItem("create_to", "ถึง");
    from.setDefaultChooserDate(dateRange.getStartDate());
    from.setDefaultValue(dateRange.getStartDate());
    from.setUseTextField(true);
    to.setDefaultChooserDate(dateRange.getEndDate());
    to.setDefaultValue(dateRange.getEndDate());
    to.setUseTextField(true);

    searchForm.setItems(jidText, statusSelected, from, to);
    // searchForm.setItems(planText, jidText);
    //        dateForm.setItems(from, to);

    final ListGrid orderListGrid = new ListGrid();

    orderListGrid.setAutoFetchData(true);
    orderListGrid.setCanMultiSort(true);
    orderListGrid.setShowRowNumbers(true);
    orderListGrid.setShowGridSummary(true);

    AdvancedCriteria criteria =
        new AdvancedCriteria(
            OperatorId.AND,
            new Criterion[] {
              // new Criterion("status", OperatorId.NOT_EQUAL, "3_to_next_process"),
              // new Criterion("created_date", OperatorId.BETWEEN_INCLUSIVE, from.getValueAsDate(),
              // to.getValueAsDate())
              new Criterion(
                  "created_date",
                  OperatorId.BETWEEN_INCLUSIVE,
                  dateRange.getStartDate(),
                  dateRange.getEndDate())
            });
    orderListGrid.setCriteria(criteria);

    orderListGrid.setDataSource(TransferDS.getInstance());
    orderListGrid.setInitialSort(
        new SortSpecifier[] {
          new SortSpecifier("status", SortDirection.DESCENDING),
          new SortSpecifier("created_date", SortDirection.DESCENDING)
        });
    orderListGrid.setUseAllDataSourceFields(false);
    orderListGrid.setSelectionType(SelectionStyle.NONE);

    ListGridField transfer_id = new ListGridField("transfer_id", 100);
    transfer_id.setSummaryFunction(
        new SummaryFunction() {
          public Object getSummaryValue(Record[] records, ListGridField field) {
            return records.length + " รายการ";
          }
        });
    transfer_id.setShowGridSummary(true);

    ListGridField status = new ListGridField("status", 120);
    ListGridField plan_id = new ListGridField("plan_id", 100);
    ListGridField transfer_by = new ListGridField("transfer_by");
    ListGridField transfer_date = new ListGridField("transfer_date", 150);

    ListGridField total_weight = new ListGridField("total_sent_weight", 120);
    total_weight.setCellFormatter(FieldFormatter.getNumberFormat());
    total_weight.setAlign(Alignment.RIGHT);
    total_weight.setSummaryFunction(SummaryFunctionType.SUM);
    total_weight.setShowGridSummary(true);

    ListGridField total_amount = new ListGridField("total_sent_amount", 120);
    total_amount.setCellFormatter(FieldFormatter.getNumberFormat());
    total_amount.setAlign(Alignment.RIGHT);
    total_amount.setSummaryFunction(SummaryFunctionType.SUM);
    total_amount.setShowGridSummary(true);

    orderListGrid.setFields(
        transfer_date, transfer_id, status, plan_id, transfer_by, total_weight, total_amount);

    // orderListGrid.hideField("status");

    HLayout buttonLayout = new HLayout();
    buttonLayout.setMargin(10);
    buttonLayout.setMembersMargin(5);
    buttonLayout.setHeight(30);
    IButton searchButton = new IButton("ค้นหาคำขอโอนสินค้า");
    searchButton.setIcon("icons/16/reports-icon.png");
    searchButton.setWidth(170);
    searchButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            Criterion search = new Criterion();
            search.addCriteria(searchForm.getValuesAsCriteria());
            AdvancedCriteria criteria =
                new AdvancedCriteria(
                    OperatorId.AND,
                    new Criterion[] {
                      new Criterion(
                          "created_date",
                          OperatorId.BETWEEN_INCLUSIVE,
                          from.getValueAsDate(),
                          to.getValueAsDate()),
                      search
                    });
            reportDate.setContents(
                "ตั้งแต่วันที่ "
                    + DateTimeFormat.getFormat("d-M-yyyy").format(from.getValueAsDate())
                    + " ถึงวันที่ "
                    + DateTimeFormat.getFormat("d-M-yyyy").format(to.getValueAsDate()));
            orderListGrid.fetchData(criteria);
            orderListGrid.deselectAllRecords();
          }
        });

    IButton listAllButton = new IButton("ล้างรายการค้นหา");
    listAllButton.setIcon("[SKIN]actions/refresh.png");
    listAllButton.setWidth(150);
    listAllButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            AdvancedCriteria criteria =
                new AdvancedCriteria(
                    OperatorId.AND,
                    new Criterion[] {
                      new Criterion(
                          "created_date",
                          OperatorId.BETWEEN_INCLUSIVE,
                          from.getValueAsDate(),
                          to.getValueAsDate())
                    });
            searchForm.reset();
            reportDate.setContents(
                "ตั้งแต่วันที่ "
                    + DateTimeFormat.getFormat("d-M-yyyy").format(from.getValueAsDate())
                    + " ถึงวันที่ "
                    + DateTimeFormat.getFormat("d-M-yyyy").format(to.getValueAsDate()));
            orderListGrid.fetchData(criteria);
            orderListGrid.deselectAllRecords();
          }
        });

    IButton printButton = new IButton("พิมพ์รายงาน");
    printButton.setIcon("icons/16/print.png");
    printButton.setWidth(120);

    buttonLayout.addMembers(searchButton, listAllButton, printButton);

    searchLayout.addMembers(searchForm);
    // reviseLayout.
    addMember(searchLayout);

    // reviseLayout.
    addMember(buttonLayout);

    final VLayout gridLayout = new VLayout();
    gridLayout.setWidth100();
    gridLayout.setHeight(500);
    Label text = new Label();
    text.setContents("รายงานการโอนสินค้าเข้าคลังสินค้า");
    text.setAlign(Alignment.CENTER);
    text.setHeight(10);
    text.setStyleName("printTitle");
    reportDate = new Label();
    reportDate.setContents(
        "ตั้งแต่วันที่ "
            + DateTimeFormat.getFormat("d-M-yyyy").format(from.getValueAsDate())
            + " ถึงวันที่ "
            + DateTimeFormat.getFormat("d-M-yyyy").format(to.getValueAsDate()));
    reportDate.setAlign(Alignment.CENTER);
    reportDate.setHeight(10);
    reportDate.setStyleName("printDetails");

    gridLayout.addMember(text);
    gridLayout.addMember(reportDate);
    gridLayout.addMember(orderListGrid);
    addMember(gridLayout);

    printButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            Canvas.showPrintPreview(gridLayout);
          }
        });
  }
예제 #3
0
  private void initNewWindow() {

    this.setAutoSize(true);
    this.setTitle("新书入库");
    this.setCanDragReposition(true);
    this.setCanDragResize(false);
    this.setAutoCenter(true);
    this.setSize(WINDOW_WIDTH, WINDOW_HEIGHT);

    VLayout vLayout;
    HLayout hLayout;
    HLayout buttonLayout;

    vLayout = new VLayout();
    vLayout.setWidth(WINDOW_WIDTH);
    vLayout.setHeight(WINDOW_HEIGHT);
    vLayout.setBorder("2px solid #7598C7");
    vLayout.setMargin(12);
    vLayout.setPadding(14);

    hLayout = new HLayout();
    hLayout.setWidth(WINDOW_WIDTH);

    // HLayout
    // ---------------------------------------------------------------------------------------
    imgVLayout = new VLayout();
    imgVLayout.setWidth(IMG_WIDTH);
    bookPicUrlItem = new Img("/images/upload/" + strBookPicUrl, IMG_WIDTH, IMG_HEIGHT);
    //		bookPicUrlItem = new Img(strBookPicUrl, IMG_WIDTH, IMG_HEIGHT);
    //		bookPicUrlItem.setPrefix("/images/upload/");

    uploadPicButton = new IButton("上传封面");
    uploadPicButton.setIcon("actions/plus.png");
    uploadPicButton.setWidth(IMG_WIDTH);

    imgVLayout.setMembers(bookPicUrlItem, uploadPicButton);
    imgVLayout.setMembersMargin(10);

    // Form
    // 1-----------------------------------------------------------------------------------------

    bookForm1 = new DynamicForm();
    bookForm1.setNumCols(4);
    bookForm1.setWidth("*");
    bookForm1.setColWidths(100, "*", 100, "*");
    bookForm1.setCellPadding(5);

    TextItem bookNameItem = new TextItem("bookName", "书名");
    bookNameItem.setColSpan(4);
    bookNameItem.setWidth("100%");
    bookNameItem.setTitleStyle("alex_bookdisplaywindow_form_text_title");
    bookNameItem.setTextBoxStyle("alex_bookdisplaywindow_form_text_content");

    TextItem bookAuthorItem = new TextItem("bookAuthor", "作者");
    bookAuthorItem.setColSpan(4);
    bookAuthorItem.setWidth("100%");
    bookAuthorItem.setTitleStyle("alex_bookdisplaywindow_form_text_title");
    bookAuthorItem.setTextBoxStyle("alex_bookdisplaywindow_form_text_content");

    TextItem bookISBNItem = new TextItem("bookISBN", "ISBN");
    bookISBNItem.setColSpan(4);
    bookISBNItem.setWidth("100%");
    bookISBNItem.setTitleStyle("alex_bookdisplaywindow_form_text_title");
    bookISBNItem.setTextBoxStyle("alex_bookdisplaywindow_form_text_content");

    bookISBNItem.setShowIcons(true);
    FormItemIcon fetchBookInfoBut = new FormItemIcon();
    fetchBookInfoBut.setSrc("/images/actions/approve.png");
    bookISBNItem.setIcons(fetchBookInfoBut);
    bookISBNItem.addKeyPressHandler(
        new KeyPressHandler() {
          @Override
          public void onKeyPress(KeyPressEvent event) {
            if (event.getKeyName().equals("Enter")) {
              fetchDataFromDouban();
            }
          }
        });
    fetchBookInfoBut.addFormItemClickHandler(
        new FormItemClickHandler() {

          @Override
          public void onFormItemClick(FormItemIconClickEvent event) {
            fetchDataFromDouban();
          }
        });
    bookISBNItem.setIconPrompt("从豆瓣获取书籍信息");

    TextItem bookPublisherItem = new TextItem("bookPublisher", "出版社");
    bookPublisherItem.setTitleStyle("alex_bookdisplaywindow_form_text_title");
    bookPublisherItem.setTextBoxStyle("alex_bookdisplaywindow_form_text_content");

    DateItem bookPublishDateItem = new DateItem("bookPublishDate", "出版日期");
    bookPublishDateItem.setTitleStyle("alex_bookdisplaywindow_form_text_title");
    bookPublishDateItem.setTextBoxStyle("alex_bookdisplaywindow_form_text_content");
    bookPublishDateItem.setUseTextField(true);
    bookPublishDateItem.setDefaultChooserDate(new Date());

    SelectItem bookClassItem = new SelectItem("bookClass", "类别");
    bookClassItem.setTitleStyle("alex_bookdisplaywindow_form_text_title");
    bookClassItem.setTextBoxStyle("alex_bookdisplaywindow_form_text_content");
    bookClassItem.setValueMap(
        "计算机/网络", "小说/文学", "哲学/文化", "经济/管理", "政治/军事", "励志/成长", "儿童/育儿", "心理", "法律", "历史", "其他");
    bookClassItem.setDefaultToFirstOption(true);

    SelectItem bookLanguageItem = new SelectItem("bookLanguage", "语言");
    bookLanguageItem.setTitleStyle("alex_bookdisplaywindow_form_text_title");
    bookLanguageItem.setTextBoxStyle("alex_bookdisplaywindow_form_text_content");
    bookLanguageItem.setValueMap("中文", "英语", "法语", "德语", "日语", "俄语", "韩语");
    bookLanguageItem.setDefaultToFirstOption(true);

    TextItem bookContributorItem = new TextItem("bookContributor", "贡献者");
    bookContributorItem.setTitleStyle("alex_bookdisplaywindow_form_text_title");
    bookContributorItem.setTextBoxStyle("alex_bookdisplaywindow_form_text_content");

    TextItem bookPriceItem = new TextItem("bookPrice", "价格");
    bookPriceItem.setTitleStyle("alex_bookdisplaywindow_form_text_title");
    bookPriceItem.setTextBoxStyle("alex_bookdisplaywindow_form_text_content");

    bookForm1.setFields(
        bookNameItem,
        bookAuthorItem,
        bookISBNItem,
        bookPublisherItem,
        bookPublishDateItem,
        bookClassItem,
        bookLanguageItem,
        bookContributorItem,
        bookPriceItem);

    // Form
    // 2-----------------------------------------------------------------------------------------
    bookForm2 = new DynamicForm();
    bookForm2.setNumCols(3);
    bookForm2.setWidth(WINDOW_WIDTH);
    bookForm2.setColWidths("*", "*", "*");
    bookForm2.setCellPadding(3);
    bookForm2.setCellBorder(1);
    bookForm2.setTitleOrientation(TitleOrientation.TOP);

    StaticTextItem bookTotalQuantityItemTitle = new StaticTextItem("bookTotalQuantityTitle", "");
    bookTotalQuantityItemTitle.setTextBoxStyle("alex_bookdisplaywindow_form_header");
    bookTotalQuantityItemTitle.setShowTitle(false);

    StaticTextItem bookInStoreQuantityitemTitle =
        new StaticTextItem("bookInStoreQuantityTitle", "");
    bookInStoreQuantityitemTitle.setTextBoxStyle("alex_bookdisplaywindow_form_header");
    bookInStoreQuantityitemTitle.setShowTitle(false);

    StaticTextItem bookAvailableQuantityItemTitle =
        new StaticTextItem("bookAvailableQuantityTitle", "");
    bookAvailableQuantityItemTitle.setTextBoxStyle("alex_bookdisplaywindow_form_header");
    bookAvailableQuantityItemTitle.setShowTitle(false);

    TextItem bookTotalQuantityItem = new TextItem("bookTotalQuantity", "");
    bookTotalQuantityItem.setTextBoxStyle("alex_bookdisplaywindow_form_text_content");
    bookTotalQuantityItem.setShowTitle(false);

    TextItem bookInStoreQuantityitem = new TextItem("bookInStoreQuantity", "");
    bookInStoreQuantityitem.setTextBoxStyle("alex_bookdisplaywindow_form_text_content");
    bookInStoreQuantityitem.setShowTitle(false);

    TextItem bookAvailableQuantityItem = new TextItem("bookAvailableQuantity", "");
    bookAvailableQuantityItem.setTextBoxStyle("alex_bookdisplaywindow_form_text_content");
    bookAvailableQuantityItem.setShowTitle(false);

    bookForm2.setFields(
        bookTotalQuantityItemTitle,
        bookInStoreQuantityitemTitle,
        bookAvailableQuantityItemTitle,
        bookTotalQuantityItem,
        bookInStoreQuantityitem,
        bookAvailableQuantityItem);

    // Form
    // 3-----------------------------------------------------------------------------------------
    bookForm3 = new DynamicForm();
    bookForm3.setWidth(WINDOW_WIDTH);
    bookForm3.setCellPadding(3);
    // bookForm2.setNumCols(2);
    bookForm3.setTitleOrientation(TitleOrientation.TOP);

    StaticTextItem bookIntroItemTitle = new StaticTextItem("bookIntroTitle", "");
    bookIntroItemTitle.setTextBoxStyle("alex_bookdisplaywindow_form_text_title");
    bookIntroItemTitle.setShowTitle(false);

    TextAreaItem bookIntroItem = new TextAreaItem("bookIntro", "");
    bookIntroItem.setTextBoxStyle("alex_bookdisplaywindow_form_intro_content");
    bookIntroItem.setShowTitle(false);
    bookIntroItem.setColSpan(2);
    bookIntroItem.setWidth("100%");

    bookForm3.setFields(bookIntroItemTitle, bookIntroItem);

    // buttonLayout
    // --------------------------------------------------------------------------------------
    buttonLayout = new HLayout();
    newButton = new IButton("添加图书");
    newButton.setIcon("actions/approve.png");
    buttonLayout.setMembers(newButton);
    buttonLayout.setAlign(Alignment.RIGHT);

    hLayout.setMembers(imgVLayout, bookForm1);
    vLayout.setMembers(hLayout, bookForm2, bookForm3, buttonLayout);
    vLayout.setMembersMargin(20);

    bookForm1.setValue("bookPublishDate", new Date());
    bookForm1.setValue("bookClass", "计算机/网络");
    bookForm1.setValue("bookLanguage", "中文");
    bookForm1.setValue("bookPrice", "0.00");
    bookForm1.setValue("bookContributor", "公司采购");

    bookForm2.setValue("bookTotalQuantity", "1");
    bookForm2.setValue("bookInStoreQuantity", "1");
    bookForm2.setValue("bookAvailableQuantity", "1");

    bookForm2.setValue("bookTotalQuantityTitle", "总数");
    bookForm2.setValue("bookInStoreQuantityTitle", "库中数量");
    bookForm2.setValue("bookAvailableQuantityTitle", "可借数量");
    bookForm3.setValue("bookIntroTitle", "简介:");

    this.addItem(vLayout);

    bind();
  }