This wiki does not contain official documentation and is currently deprecated and read only. Please try reading the documentation on the Liferay Developer Network, the new site dedicated to Liferay documentation. DISCOVER Build your web site, collaborate with your colleagues, manage your content, and more. DEVELOP Build applications that run inside Liferay, extend the features provided out of the box with Liferay's APIs. DISTRIBUTE Let the world know about your app by publishing it in Liferay's marketplace. PARTICIPATE Become a part of Liferay's community, meet other Liferay users, and get involved in the open source project. « Retour - Development
Portlet namespace
Table of Contents [-]
Introduction #
Namespacing ensures that the given name is uniquely associated with this portlet and avoids name conflicts with other elements on the portal page or with other portlets on the page.
To use it you must import standard portlet library
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
This tag produces a unique value for the current portlet:
<portlet:namespace/>.
Here is an example how to use it in the code:
<script>
function <portlet:namespace />myFunction() {
alert("<portlet:namespace />myButton was clicked" );
}
</script>
<input type="button" id="<portlet:namespace />myButton" onclick="<portlet:namespace />myFunction();"> 67527 vues