java.lang.Object
org.apache.struts2.components.Component
org.apache.struts2.components.UIBean
org.apache.struts2.components.ClosingUIBean
com.jgeppert.struts2.jquery.components.AbstractTopicsBean
com.jgeppert.struts2.jquery.components.Menu

public class Menu extends AbstractTopicsBean

Renders a menu.

Examples

Menu with Items

        <sj:menu id="menuWithItems" cssStyle="width:50%">
 <sj:menuItem title="Struts2" href="http://struts.apache.org/2.x/index.html"/>
 <sj:menuItem title="Struts2 jQuery News" href="https://www.jgeppert.com/category/java/struts2-jquery/"/>
 <sj:menuItem title="Struts2 Plugins">
 <sj:menu id="subMenuPlugins">
 <sj:menuItem title="Struts2 Plugins" href="https://cwiki.apache.org/S2PLUGINS/home.html"/>
 <sj:menuItem title="Struts2 jQuery Plugin" href="http://code.google.com/p/struts2-jquery/"/>
 <sj:menuItem title="Struts2 Bootstrap Plugin" href="http://code.google.com/p/struts2-jquery/"/>
 </sj:menu>
 </sj:menuItem>

 <sj:menuItem title="Struts2 @ Social Media">
 <sj:menu id="subMenuSocialMedia">
 <sj:menuItem title="Struts2 @ Twitter" href="https://twitter.com/TheApacheStruts"/>
 <sj:menuItem title="Struts2 @ Google+" href="https://www.google.com/+ApacheStruts"/>
 <sj:menuItem title="Struts2 @ Facebook" href="http://www.facebook.com/struts2"/>
 </sj:menu>
 </sj:menuItem>
 <sj:menuItem title="AJAX">
 <sj:menu id="subMenuAjax">
 <s:url var="ajax1" value="/ajax1.action"/>
 <sj:menuItem title="Ajax 1" href="%{ajax1}" targets="result"/>
 <s:url var="ajax2" value="/ajax2.action"/>
 <sj:menuItem title="Ajax 2" href="%{ajax2}" targets="result" effect="highlight" effectDuration="2500"/>
 <s:url var="ajax3" value="/ajax3.action"/>
 <sj:menuItem title="Ajax 3" href="%{ajax3}" targets="result" onBeforeTopics="beforeLink" onCompleteTopics="completeLink"/>
 <s:url var="ajax4" value="/ajax4.action"/>
 <sj:menuItem title="Ajax 4" href="%{ajax4}" targets="result" effect="bounce" effectDuration="1000"/>
 </sj:menu>
 </sj:menuItem>
 </sj:menu>

 <br/>
 <strong>Result Div :</strong>
 <div id="result" class="result ui-widget-content ui-corner-all">Click on the AJAX Links above.</div>

 
Author:
Johannes Geppert
  • Field Details

    • JQUERYACTION

      public static final String JQUERYACTION
      See Also:
    • TEMPLATE

      public static final String TEMPLATE
      See Also:
    • TEMPLATE_CLOSE

      public static final String TEMPLATE_CLOSE
      See Also:
    • COMPONENT_NAME

      public static final String COMPONENT_NAME
    • throwExceptionOnNullValueAttribute

      protected boolean throwExceptionOnNullValueAttribute
    • disabled

      protected String disabled
    • targets

      protected String targets
    • href

      protected String href
    • paramName

      protected String paramName
    • list

      protected Object list
    • listKey

      protected String listKey
    • listValue

      protected String listValue
  • Constructor Details

    • Menu

      public Menu(com.opensymphony.xwork2.util.ValueStack stack, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
  • Method Details

    • getDefaultOpenTemplate

      public String getDefaultOpenTemplate()
      Specified by:
      getDefaultOpenTemplate in class org.apache.struts2.components.ClosingUIBean
    • getDefaultTemplate

      protected String getDefaultTemplate()
      Specified by:
      getDefaultTemplate in class org.apache.struts2.components.UIBean
    • evaluateExtraParams

      public void evaluateExtraParams()
      Overrides:
      evaluateExtraParams in class AbstractTopicsBean
    • setTheme

      public void setTheme(String theme)
      Overrides:
      setTheme in class org.apache.struts2.components.UIBean
    • getTheme

      public String getTheme()
      Overrides:
      getTheme in class org.apache.struts2.components.UIBean
    • setDisabled

      public void setDisabled(String disabled)
      Overrides:
      setDisabled in class org.apache.struts2.components.UIBean
    • setTargets

      public void setTargets(String targets)
    • setList

      public void setList(Object list)
    • setListKey

      public void setListKey(String listKey)
    • setListValue

      public void setListValue(String listValue)
    • setHref

      public void setHref(String href)
    • setParamName

      public void setParamName(String paramName)