Exemplo n.º 1
0
  /**
   * Get datas from beans and apply to widget
   *
   * @param paramsLineRuleBean
   */
  public void applyDatas(final ListKeyValueBean listKeyValueBean, boolean clearWidget) {

    if (clearWidget) {
      this._listKeyValue.clear();
      this._main.clear();
    }

    for (KeyValueBean keyValueBean : listKeyValueBean) {
      log.config("create widget");
      final KeyValueWidget keyValueWidget = this.createKeyValue(keyValueBean.getKeyName(), true);
      keyValueWidget.applyDatas(keyValueBean);
    }
  }
Exemplo n.º 2
0
  /** Get datas from widget and populate Beans */
  public void populate(
      final IListKeyValuesBean paramKeyValuesBean, final Integer viewId, boolean clearList) {

    if (clearList) {
      paramKeyValuesBean.clearList();
    }
    for (int i = 0; i < _listKeyValue.size(); i++) {
      final KeyValueWidget keyValueWidget = this._listKeyValue.get(i);

      final KeyValueBean keyValueBean = new KeyValueBean(keyValueWidget.getKeyName());
      if (viewId != null) {
        keyValueBean.setViewId(viewId);
      }

      keyValueWidget.populate(keyValueBean);
      log.config("KeyValuePanel > add KeyValueBean : " + keyValueBean.getKeyValue());
      paramKeyValuesBean.addKeyValue(keyValueBean);
    }
  }