Interface MPPWebControl
@GwtCompatible
public interface MPPWebControl
FirstSpirit JavaScript MPP API, accessible via "MPP_API".
Example:
Example:
if ("MPP_API".isParameterized()
) { var gender = "MPP_API".getParameter("gender")
; var age = "MPP_API".getParameter("age")
; if (gender == "male" && age >= 18) { // ... } }
- Since:
- 5.2.28
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Listener for events about changes of the preview parametrization.static interface
Listener for events about changes of custom parameters.static interface
Listener for events about changes of date / time in MPP. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
JavaScript identifier for the instance of this MPP control object -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a listener to be informed when current preview parametrization is enabled/disabled by the user.void
Adds a listener to be informed when a custom preview parameter has changedvoid
Adds a listener to be informed when the time parameter has changed.@Nullable Object
getParameter
(@NotNull String name) Returns the current value of the specified preview parameter.@Nullable Object
Returns the current time the user has chosen using the preview timeline.boolean
Returns whether or not the current preview parametrization is enabled by the user.void
setParameter
(@NotNull String name, @Nullable Object value) Sets the current value of the specified preview parameter.void
setTimeParameter
(Object date) Set the time that should be used for preview.
-
Field Details
-
IDENTIFIER
JavaScript identifier for the instance of this MPP control object- Since:
- 5.2.28
- See Also:
-
-
Method Details
-
isParameterized
boolean isParameterized()Returns whether or not the current preview parametrization is enabled by the user.- Returns:
true
if preview has parameter,false
otherwise.- Since:
- 5.2.28
-
addParameterizedListener
Adds a listener to be informed when current preview parametrization is enabled/disabled by the user.
May be used only in WebEdit mode.
- Parameters:
listener
- the listener to add- Since:
- 5.2.190301
-
getParameter
Returns the current value of the specified preview parameter. The return value may benull
if there is no editor with the specified name, or if the editors value isnull
.- Parameters:
name
- name of the preview parameter to get the value for.- Returns:
- parameter value, or
null
for the above mentioned reasons. - Since:
- 5.2.28
-
setParameter
Sets the current value of the specified preview parameter.- Parameters:
name
- name of the preview parameter to set the value for.value
- parameter value, ornull
to clear the value.- Since:
- 5.2.28
-
addParameterListener
Adds a listener to be informed when a custom preview parameter has changed
May be used only in WebEdit mode.
- Parameters:
listener
- the listener to add- Since:
- 5.2.190301
-
getTimeParameter
Returns the current time the user has chosen using the preview timeline.- Returns:
- the current time (as javascript
Date
) object, ornull
- Since:
- 5.2.28
-
setTimeParameter
Set the time that should be used for preview.- Parameters:
date
- the time (as javascriptDate
) object, ornull
- Since:
- 5.2.28
-
addTimeParameterListener
Adds a listener to be informed when the time parameter has changed.
May be used only in WebEdit mode.
- Parameters:
listener
- the listener to add- Since:
- 5.2.190301
-