Interface RichPageWidgetActionContext
- All Superinterfaces:
RichPageContext
,RichPageParametersContext
,RichPageRenderingContext
,RichPageWidgetCommonContext
,RichPageWidgetContext
Context used in
RichPageWidget.executeAction(RichPageWidgetActionContext)
- Since:
- 3.9.2
-
Method Summary
Modifier and TypeMethodDescriptionactionId()
Action ID - The data-action-id (RichPageWidget.ATTRIBUTE_ACTION_ID
) attribute value of the HTML element that the user clicks on.void
executeJavaScript
(String script) Calling this method means that the given script should be executed on the client side after the action finishes and the optionalmessage(String)
is displayed, but beforereplaceWithHtml(String)
orrefresh(boolean)
.void
Sets the message that will be shown to users after the action on the server is executed.void
refresh
(boolean widget) Calling this method means that the widget or whole page should be refreshed after the action. It usually does not make sense to use this method together withreplaceWithHtml(String)
.void
replaceWithHtml
(String html) Calling this method means that the content of the widget should be replaced by the given html. This is mainly meant for widgets that need to display data based on the action, but do not write any data to persistence.Methods inherited from interface com.polarion.alm.shared.api.model.rp.widget.RichPageContext
getDisplayedReference, getDisplayedScope, getSelectedWorkItems, localization, sharedContext
Methods inherited from interface com.polarion.alm.shared.api.model.rp.widget.RichPageParametersContext
pageParameters, urlParameters
Methods inherited from interface com.polarion.alm.shared.api.model.rp.widget.RichPageRenderingContext
createChartBuilder, createCustomHighchartBuilder, createHighchartBuilder, createHtmlFragmentBuilder, createJsActionsBuilder, generateUniqueElementId, object, page, plan, renderError, renderInfo, renderWarning, target, testRun
Methods inherited from interface com.polarion.alm.shared.api.model.rp.widget.RichPageWidgetCommonContext
columnWidth, parameter, propertiesSidebarConfiguration
Methods inherited from interface com.polarion.alm.shared.api.model.rp.widget.RichPageWidgetContext
resourceUrl
-
Method Details
-
actionId
Action ID - The data-action-id (RichPageWidget.ATTRIBUTE_ACTION_ID
) attribute value of the HTML element that the user clicks on. Or the value passed to the executeWidgetAction JavaScript function. SeePublicJS.executeWidgetAction(Node, boolean, String)
for details. -
transaction
- Specified by:
transaction
in interfaceRichPageContext
-
message
Sets the message that will be shown to users after the action on the server is executed. (But before any of the other operations likeexecuteJavaScript(String)
,replaceWithHtml(String)
orrefresh(boolean)
).- Parameters:
message
- - No message will be shown when null or an empty string is used.
-
executeJavaScript
Calling this method means that the given script should be executed on the client side after the action finishes and the optionalmessage(String)
is displayed, but beforereplaceWithHtml(String)
orrefresh(boolean)
. -
replaceWithHtml
Calling this method means that the content of the widget should be replaced by the given html. This is mainly meant for widgets that need to display data based on the action, but do not write any data to persistence. Widgets that write data should instead userefresh(boolean)
with a "true" value, because then the rendering of the widget is executed in a new a transaction. (Needed for all indexes to update by committing the write transaction where the action was executed). It usually does not make sense to use this method together withrefresh(boolean)
. -
refresh
void refresh(boolean widget) Calling this method means that the widget or whole page should be refreshed after the action. It usually does not make sense to use this method together withreplaceWithHtml(String)
.- Parameters:
widget
- - "true" to refresh the widget, "false" to refresh the whole page.
-