Wednesday, 28 May 2014

Setting the Initial Text of Liferay UI Input Editor

Include the below line at the top of the page to access the liferay-ui elements.
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
The below line adds the Text Editor to the page.
<liferay-ui:input-editor initmethod="initDefaultMessage" name="textEditor" ></liferay-ui:input-editor>
This code adds content that as soon as the editor is initialized.
Note the <portlet:namespace /> tag in the function name.
<script type="text/javascript">
function <portlet:namespace />initDefaultMessage() {
    return 'Text to test';
}
</script>

No comments :

Post a Comment