private void createChart(final DOM container, final HttpServletRequest request)
        throws SQLException {
      Label l = container().label();
      l.img(new URL("/images/payslip_small.png")).setAttr(Image.CLASS, "icon");
      l.text(t8("select.year")).style(CSS.WIDTH, "24%");
      container().br();

      yearField = container().<Integer>select();
      loadSlips();
      yearField.selectIndex(0).style(CSS.WIDTH, "24%");

      Div d = container().div();
      d.style(CSS.FLOAT, "right").style(CSS.MARGIN_TOP, "10px");

      d.label()
          .text(t8("paycost"))
          .style(CSS.COLOR, "white")
          .style(CSS.BACKGROUND_COLOR, "rgba(151,187,187, 1)");

      d.label(cx.t8("max.paybuffer"))
          .style(CSS.COLOR, "white")
          .style(CSS.BACKGROUND_COLOR, "rgba(151,205,187,1)")
          .style(CSS.MARGIN_LEFT, "10px");

      d.label()
          .text(t8("paybuffer"))
          .style(CSS.COLOR, "white")
          .style(CSS.BACKGROUND_COLOR, "rgba(151,187,205,1)")
          .style(CSS.MARGIN_LEFT, "10px");

      d.label()
          .text(t8("vacation.deduction"))
          .style(CSS.COLOR, "white")
          .style(CSS.BACKGROUND_COLOR, "rgba(205,187,151,1)")
          .style(CSS.MARGIN_LEFT, "10px");

      d.label()
          .text(t8("other.costs"))
          .style(CSS.COLOR, "white")
          .style(CSS.BACKGROUND_COLOR, "rgba(205,151,151, 1)")
          .style(CSS.MARGIN_LEFT, "10px");

      container().br().br().br();

      final String year = request.getParameter("year");
      if (year != null) {
        yearField.selectValue(year);
      }

      yearField.onChange(
          new Callback(Method.POST) {
            @Override
            public void onEvent() throws SQLException {
              redirect(new URL("/statistics/money-year?year=%s", yearField.selectedValue()));
            }
          });

      createCanvas(container);
    }
Example #2
0
    @Override
    protected void createSearchBox(final DOM box) throws SQLException {
      Div showDiv = box.div();
      showDiv.style(CSS.FLOAT, "right");
      showDiv.label(cx().t8("show"));
      showDiv.br().br();

      Div showTypeDiv = showDiv.div();
      showTypeDiv.style(CSS.DISPLAY, "inline-block").style(CSS.MARGIN_RIGHT, "10px");

      showFixedBox = showTypeDiv.checkBox();
      showFixedBox.setChecked(true).setAttr(CheckBox.NAME, "show.type");
      showTypeDiv.label(t8("employmentType.FIXED"));
      showTypeDiv.br();

      showCommissionableBox = showTypeDiv.checkBox();
      showCommissionableBox.setChecked(true).setAttr(CheckBox.NAME, "show.type");
      showTypeDiv.label(t8("employmentType.COMMISSIONABLE"));
      showTypeDiv.br();

      showSubconsultantBox = showTypeDiv.checkBox();
      showSubconsultantBox.setChecked(true).setAttr(CheckBox.NAME, "show.type");
      showTypeDiv.label(t8("employmentType.SUBCONSULTANT"));

      Div showStateDiv = showDiv.div();
      showStateDiv.style(CSS.DISPLAY, "inline-block");

      showAvailableBox = showStateDiv.checkBox();
      showAvailableBox.setChecked(true).setAttr(CheckBox.NAME, "show.state");
      showStateDiv.label(t8("show.available"));
      showStateDiv.br();

      showBusyBox = showStateDiv.checkBox();
      showBusyBox.setChecked(true).setAttr(CheckBox.NAME, "show.state");
      showStateDiv.label(t8("show.busy"));
      showStateDiv.br();

      showInactiveBox = showStateDiv.checkBox();
      showInactiveBox.setAttr(CheckBox.NAME, "show.state");
      showStateDiv.label(t8("show.inactive"));

      box.iconLabel(url("/images/employee_small.png"), t8("employees.contact"))
          .style(CSS.MARGIN_RIGHT, "1%")
          .style(CSS.WIDTH, "24%");
      box.br();

      contactField = box.<Employee>select();
      contactField.style(CSS.WIDTH, "24%").style(CSS.MARGIN_RIGHT, "1%");
      loadContacts();
      contactField.selectValue("");

      box.br().br().br().br().br();
      contactField.setFocus();
    }