public abstract class MenuItemWidget extends Widget
Constructor and Description |
---|
MenuItemWidget() |
Modifier and Type | Method and Description |
---|---|
String |
getAfterShowScript(RestRequest req,
RestResponse res)
Optional Javascript to execute immediately after a menu item is shown.
|
String |
getBeforeShowScript(RestRequest req,
RestResponse res)
Optional Javascript to execute immediately before a menu item is shown.
|
abstract Object |
getContent(RestRequest req,
RestResponse res)
The content of the popup.
|
String |
getHtml(RestRequest req,
RestResponse res)
Resolves the HTML content for this widget.
|
abstract String |
getLabel(RestRequest req,
RestResponse res)
The label for the menu item as it's rendered in the menu bar.
|
String |
getScript(RestRequest req,
RestResponse res)
Returns the Javascript needed for the show and hide actions of the menu item.
|
String |
getStyle(RestRequest req,
RestResponse res)
Defines a
getHtml(RestRequest,RestResponse) method. |
getClasspathResourceAsString, getClasspathResourceAsString, getHtml, getHtml, getName, getScript, getScript, getStyle, getStyle, loadHtml, loadHtmlWithVars, loadScript, loadScriptWithVars, loadStyle, loadStyleWithVars
public MenuItemWidget()
public String getScript(RestRequest req, RestResponse res) throws Exception
public String getBeforeShowScript(RestRequest req, RestResponse res) 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 HTTP request object.res
- The HTTP response object.Exception
- Error occurred.public String getAfterShowScript(RestRequest req, RestResponse res) throws Exception
Same as getBeforeShowScript(RestRequest,RestResponse)
except this Javascript gets executed after the popup dialog has become visible.
req
- The HTTP request object.res
- The HTTP response object.Exception
- Error occurred.public String getStyle(RestRequest req, RestResponse res) throws Exception
getHtml(RestRequest,RestResponse)
method.public String getHtml(RestRequest req, RestResponse res) throws Exception
Widget
A returned value of
public abstract String getLabel(RestRequest req, RestResponse res) throws Exception
req
- The HTTP request object.res
- The HTTP response object.Exception
- Error occurred.public abstract Object getContent(RestRequest req, RestResponse res) throws Exception
req
- The HTTP request object.res
- The HTTP response object.Reader
- Serialized directly to the output.
CharSequence
- Serialized directly to the output.
HtmlSerializer.DEFAULT
.
org.apache.juneau.dto.html5
beans.
Exception
- Error occurred.Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.