Package de.odysseus.calyxo.forms.view

Examples of de.odysseus.calyxo.forms.view.GroupModel


  /**
   * Get checked attribute
   */
  protected String getCheckedAttribute() throws Exception {
    GroupModel model = groupTag.getGroupModel();
    boolean check = false;
    if (model.isSelected(getValueAttribute())) {
      check = true;
    } else if (!model.isSelectionAvailable() && checked != null) {
      check = true;
    }
    return check ? "checked" : null;
  }
View Full Code Here


   * (non-Javadoc)
   * @see de.odysseus.calyxo.base.taglib.html.AbstractTag#getBodyContent()
   */
  public String getBodyContent() throws Exception {
    ListModel listModel = selectTag.getListModel();
    GroupModel groupModel = selectTag.getGroupModel();

    int order = getListModelOrder();
    boolean descend = sort.startsWith("-");
    Locale locale = I18nSupport.getInstance(pageContext).getLocale(pageContext);
    Iterator values = listModel.getValues(order, descend, locale);

    StringBuffer s = new StringBuffer();
    while (values.hasNext()) {
      Object value = values.next();
      String key = listModel.getKey(value);
      s.append("<option");
      s.append(" value=\"");
      s.append(key);
      s.append("\"");
      if (groupModel.isSelected(key)) {
        s.append(" selected=\"selected\"");
      } else if (!groupModel.isSelectionAvailable()) {
        if (key.equals(this.key) || keys != null && keys.contains(key)) {
          s.append(" selected=\"selected\"");
        }
      }
      appendAttributes(s);
View Full Code Here

  /**
   * Get checked attribute
   */
  protected String getCheckedAttribute() throws Exception {
    if (getContext().isMultiple(this)) {
      GroupModel group = (GroupModel)getContext().getComponentData(this);
      if (group == null) {
        group = new DefaultGroupModel(getContext(), this);
        getContext().putComponentData(this, group);
      }
      if (group.isSelected(getValue())) {
        return "checked";
      } else if (!group.isSelectionAvailable() && getChecked() != null) {
        return "checked";
      }
      return null;
    } else {
      return super.getCheckedAttribute();
View Full Code Here

  /**
   * Get selected attribute
   */
  protected String getSelectedAttribute() throws Exception {
    boolean select = false;
    GroupModel model = selectTag.getGroupModel();
    if (model.isSelected(getValueAttribute())) {
      select = true;
    } else if (!model.isSelectionAvailable() && selected != null) {
      select = true;
    }
    return select ? "selected" : null;
  }
View Full Code Here

TOP

Related Classes of de.odysseus.calyxo.forms.view.GroupModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.