Exemple #1
0
 /**
  * This method returns whether or not the component is visible. If it is not visible, no HTML will
  * be generated.
  *
  * @param checkParents A boolean value, true mean that this component is considered visible if it
  *     and all it's parents are visible. A false value only checks the component itself.
  */
 public boolean getVisible(boolean checkParents) {
   if (!_visible) return false;
   boolean bVisible = _visible;
   if (checkParents) {
     HtmlComponent hc = getParent();
     while (hc != null) {
       if (hc.getVisible() == false) {
         bVisible = false;
         break;
       }
       hc = hc.getParent();
     }
   }
   return bVisible;
 }
Exemple #2
0
  public String getFormString() {
    if (_form != null) return _form;
    HtmlComponent comp = getParent();

    while (comp != null) {
      if (comp instanceof JspForm) {
        _form = "document.forms['" + getPortletNameSpace() + comp.getName() + "'].";
        break;
      }
      comp = comp.getParent();
    }
    if (_form == null)
      if (_formNo == -1) _form = "document.forms[0].";
      else _form = "document.forms[" + _formNo + "].";
    return _form;
  }
Exemple #3
0
  /**
   * This will return the full name of the component. The full name is the name of the component
   * appended to the names of its parent components and seperated by underscores. For example if
   * this is a button named "button1" inside a table named "table1" the full name for this component
   * would be "table1_button1".
   */
  public String getFullName() {
    if (_fullName == null) {
      HtmlComponent parent = _parent;
      String name = _name;
      // no need to create a new string for every time through the loop
      String parentName = null;
      //
      while (parent != null) {
        parentName = parent.getName();
        if (parentName != null) {
          if (parentName != "") {
            name = parentName + "_" + name;
          }
        }
        parent = parent.getParent();
      }
      _fullName = getPortletNameSpace() + name;
    }

    return _fullName;
  }