Class TextTag

  • All Implemented Interfaces:
    javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.SimpleTag

    public class TextTag
    extends javax.servlet.jsp.tagext.SimpleTagSupport
    Implements the wmedit:text tag. This tag looks up the value of label edit_language objects. If the var attribute is set, the result is bound to the var in the pagecontext, else the result of the lookup is printed.
            <wmedit:text var="mayEdit" label="pagemodel.may_edit" />
     
    This will lookup the proper text for pagemodel.may_edit and binds it to the mayEdit variable in the page context. The mayEdit variable may later be used to, for example, set a button text.
    Author:
    bartk
    • Constructor Summary

      Constructors 
      Constructor Description
      TextTag()  
    • Constructor Detail

      • TextTag

        public TextTag()
    • Method Detail

      • setVar

        public void setVar​(String var)
        Setter for the optional var attribute.
        Parameters:
        var - name of the variable to which the text will be assigned.
      • getVar

        protected String getVar()
        Return name of the variable to which the text will be assigned or null.
        Returns:
        name of the variable to which the text will be assigned or null if not set.
      • setLabel

        public void setLabel​(String label)
        Setter for the required label attribute.
        Parameters:
        label - name of the language label.
      • getLabel

        protected String getLabel()
        Return the language label.
        Returns:
        the language label.
      • setContainerId

        public void setContainerId​(int containerid)
        Sets the Siteworks id of a HtmlObject on the myContainer field. If this is set the tag will use this object as a base to get the correct language label from.
        Parameters:
        containerid - HtmlObject which can be used as a base to get the correct language label from.
      • getContainerId

        public int getContainerId()
        Returns the Siteworks id of the HtmlObject which is passed on as a parameter to the tag, or -1 if it is not set.
        Returns:
        The Siteworks id of the HtmlObject which is passed on as a parameter to the tag, or -1 if it is not set.
      • doTag

        public void doTag()
                   throws javax.servlet.jsp.JspException
        Specified by:
        doTag in interface javax.servlet.jsp.tagext.SimpleTag
        Overrides:
        doTag in class javax.servlet.jsp.tagext.SimpleTagSupport
        Throws:
        javax.servlet.jsp.JspException