Button/Link
Data
Input
Miscellaneous
Multimedia
Output
Panel
Select
JSTL
Faces Core
Facelets
Extensions

alloy:outputScript

OutputScript is a UIOutput component that renders a <script> element with type="text/javascript". It supports all the features of h:outputScript and adds the use attribute which provides the ability to specify AlloyUI or YUI modules as dependencies.

Resource Usage

A JavaScript resource can be added to the page by specifying the library and name attributes.
A script has called exampleNamespace.exampleFunction(id) which resides in the JavaScript resouce file named example.js.

Source Code

<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:alloy="http://liferay.com/faces/alloy"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<!-- This script calls a JavaScript function that is defined in the external JavaScript -->
<!-- resource named example.js -->
<span id="example:text"></span>
<alloy:outputScript>
exampleNamespace.exampleFunction('example:text');
</alloy:outputScript>
<alloy:outputScript library="js" name="example.js" target="head" />
</ui:composition>
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
var exampleNamespace = {
exampleFunction : function(id) {
document.getElementById(id).innerHTML = 'A script has called <code>exampleNamespace.exampleFunction(id)</code> '
+ 'which resides in the JavaScript resouce file named <code>example.js</code>.';
}
};
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Liferay Faces Alloy 4.1.1 + Liferay Faces Bridge Implementation 5.0.0 + Showcase Common 4.0.0 + Liferay Faces Util 3.4.1 + Mojarra 2.2.20