Пример #1
0
 public Object getValue() {
   if (!ValueUtil.isEmpty(expression)) {
     ExpressionResolver er = ClientContext.getCurrentContext().getExpressionResolver();
     return er.evaluate(binding.getBean(), expression);
   } else if (!ValueUtil.isEmpty(getName())) return UIControlUtil.getBeanValue(this);
   else return super.getText();
 }
Пример #2
0
  public void refresh() {
    try {
      Object value = null;
      if (!ValueUtil.isEmpty(expression)) {
        value = UIControlUtil.evaluateExpr(binding.getBean(), expression);
      } else if (!ValueUtil.isEmpty(getName())) {
        value = UIControlUtil.getBeanValue(this);
        if (value != null && format != null) {
          value = format.format(value);
        }
      } else {
        value = super.getText();
      }

      super.setText((value != null ? value + "" : ""));

    } catch (Exception e) {
      super.setText("");

      if (ClientContext.getCurrentContext().isDebugMode()) {
        e.printStackTrace();
      }
    }
  }