Class 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:
    
     <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>
     
    xml data available for xsl rendering:
    
     <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:
    
     <control:lum_script>
     		<script src="lumis/tool/jquery/jquery.js" type="text/javascript" charset="UTF-8" key="jquery.js"></script>
     </control:lum_script>
     
    xml data available for xsl rendering:
    
     <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) $