Package lumis.doui.control.script
Class ScriptControl
- java.lang.Object
-
- lumis.doui.control.Control
-
- lumis.doui.control.script.ScriptControl
-
- All Implemented Interfaces:
VariableResolver
,IControl
- Direct Known Subclasses:
ExecuteScriptControl
,RenderActionOnLoadScriptControl
public class ScriptControl extends Control
Renders client side script. The script value is specified within a script node and may contain custom tags like <lum_formName/> to be replaced runtime with the curren form name, and <lum_translate>STR_XXXX<lum_translate/> to be localized to the users locale.
Example use with content within script tag:
xml data available for xsl rendering:<control:lum_script> <script> function chooseScheduleType(scheduleType) { var d = document; var choice = scheduleType.selectedIndex; switch(choice) { case 0: d.getElementById("divScheduleWeek").style.display = "none"; d.getElementById("divScheduleMonth").style.display = "none"; break; case 1: d.getElementById("divScheduleWeek").style.display = ""; d.getElementById("divScheduleMonth").style.display = "none"; break; case 2: d.getElementById("divScheduleWeek").style.display = "none"; d.getElementById("divScheduleMonth").style.display = ""; break; } } chooseScheduleType(document.getElementById("scheduleType")); </script> </control:lum_script>
<control id="8A488A031150E335011150ECC3C00118" type="lum_script"> <script>function chooseScheduleType(scheduleType) { var d = document; var choice = scheduleType.selectedIndex; switch(choice) { case 0: d.getElementById("divScheduleWeek").style.display = "none"; d.getElementById("divScheduleMonth").style.display = "none"; break; case 1: d.getElementById("divScheduleWeek").style.display = ""; d.getElementById("divScheduleMonth").style.display = "none"; break; case 2: d.getElementById("divScheduleWeek").style.display = "none"; d.getElementById("divScheduleMonth").style.display = ""; break; } } chooseScheduleType(document.getElementById("scheduleType"));</script> </control>
Example use with other configuration:
xml data available for xsl rendering:<control:lum_script> <script src="lumis/tool/jquery/jquery.js" type="text/javascript" charset="UTF-8" key="jquery.js"></script> </control:lum_script>
<control id="8A488A031150E335011150ECC3C00118" type="lum_script"> <script src="lumis/tool/jquery/jquery.js" type="text/javascript" charset="UTF-8" key="jquery.js"></script> </control>
- Since:
- 4.0.3
- Version:
- $Revision: 22315 $ $Date: 2019-01-25 18:30:16 -0200 (Fri, 25 Jan 2019) $
-
-
Field Summary
-
Fields inherited from class lumis.doui.control.Control
childControls, controlContainer, controlDefinitionNode, controlResource, douiContext, hasValidatorSubControls, isValid, locale, ON_EVENT_CLOSE_WINDOW, ON_EVENT_LINK, ON_EVENT_POPUP_LINK_OR_RUNTIME_INTERFACE, ON_EVENT_POPUP_RUNTIME_INTERFACE, ON_EVENT_PROCESS_ACTION, ON_EVENT_RENDER_ACTION, ON_EVENT_REPLACE_INTERFACE, ON_EVENT_SCRIPT, ON_EVENT_VALIDATE, onEventScripts, PARAMETER_TYPE_FIRST_SELECTED, PARAMETER_TYPE_GET_VALUE, parentControl, resources, type, VALIDATION_SELECTED_MANY, VALIDATION_SELECTED_ONE
-
-
Constructor Summary
Constructors Constructor Description ScriptControl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setRenderData()
-
Methods inherited from class lumis.doui.control.Control
appendSubControl, appendSubControls, applyOnEventScripts, buildSubControls, convertToStandardValue, createContainer, disconnect, fixedIdentifierRequired, generateControlId, generateControlIdPrefix, getAdditionalParameters, getAdditionalParameters, getAncestor, getChildControls, getClientEventHandlerScript, getControlResource, getId, getLocale, getName, getNamespace, getParentControl, getPrepareForReadScript, getRenderData, getResources, getRuntimeDefaultSource, getScriptActionValidation, getSourceContext, getStringsToLocalize, getType, getValidationScript, getWindowProperties, getWindowProperties, init, isRequired, isValid, localize, localizeStrings, processCustomTags, registerOnEventScript, removeChild, removeChildren, resolveVariable, setName, setRuntimeAttributes, setValid
-
-
-
-
Method Detail
-
setRenderData
public void setRenderData() throws PortalException
- Specified by:
setRenderData
in interfaceIControl
- Overrides:
setRenderData
in classControl
- Throws:
PortalException
-
-