public abstract class MenuItemWidget extends Widget
Constructor and Description |
---|
MenuItemWidget() |
Modifier and Type | Method and Description |
---|---|
String |
getAfterShowScript(RestRequest req)
Optional Javascript to execute immediately after a menu item is shown.
|
String |
getBeforeShowScript(RestRequest req)
Optional Javascript to execute immediately before a menu item is shown.
|
abstract Object |
getContent(RestRequest req)
The content of the popup.
|
String |
getHtml(RestRequest req)
Resolves the HTML content for this widget.
|
abstract String |
getLabel(RestRequest req)
The label for the menu item as it's rendered in the menu bar.
|
String |
getScript(RestRequest req)
Returns the Javascript needed for the show and hide actions of the menu item.
|
String |
getStyle(RestRequest req)
Defines a
getHtml(RestRequest) method. |
getClasspathResourceAsString, getClasspathResourceAsString, getName, loadHtml, loadHtmlWithVars, loadScript, loadScriptWithVars, loadStyle, loadStyleWithVars
public MenuItemWidget()
public String getScript(RestRequest req) throws Exception
public String getBeforeShowScript(RestRequest req) throws Exception
For example, the following shows how the method could be used to make an AJAX call back to the REST interface to populate a SELECT element in the contents of the popup dialog:
Note that it's often easier (and cleaner) to use the Widget.loadScript(String)
method and read the Javascript from
your classpath:
req
- The current request.Exception
public String getAfterShowScript(RestRequest req) throws Exception
Same as getBeforeShowScript(RestRequest)
except this Javascript gets executed after the popup dialog has become visible.
req
- The current request.Exception
public String getStyle(RestRequest req) throws Exception
getHtml(RestRequest)
method.public String getHtml(RestRequest req) throws Exception
Widget
A returned value of
public abstract String getLabel(RestRequest req) throws Exception
req
- The HTTP request object.Exception
public abstract Object getContent(RestRequest req) throws Exception
req
- The HTTP request object.Reader
- Serialized directly to the output.
CharSequence
- Serialized directly to the output.
HtmlSerializer.DEFAULT
.
org.apache.juneau.dto.html5
beans.
Exception
Copyright © 2018 Apache. All rights reserved.