Page 2 of 4
Let's first prepare the JSP page in which we are going to use the Javascript objects; for simplicity I'll assume that the reader knows the meaning of the HTML tags and taglib used in this example.
<!--
HTML container element, where will be rendered the
button which will open the dialog to select the file
-->
<div id="<portlet:namespace/>fileSelector"></div>
<!--
This is the (usually) hidden field in which the Javascript object
Liferay.DLUtil.FileSelector will automatically fill in the document UUID
after being selected; if this field is missing, nothing will be filled in
-->
<aui:input name="uuid" disabled="true" />
<!--
This is only a sample field, to view all the informations provided by
the Javascript object
-->
<aui:input name="fileArea" type="textarea" />
Since the AlloyUI module also provides an object to select a folder, let's add in the sample JSP page the elements to manage this second chance.
<!--
HTML container element, where will be rendered the
button which will open the dialog to select the folder
-->
<div id="<portlet:namespace/>folderSelector"></div>
<!--
This is the (usually) hidden field in which the Javascript object
Liferay.DLUtil.FolderSelector will automatically fill in the folderId
after being selected; if this field is missing, nothing will be filled in
-->
<aui:input name="folderId" disabled="true" />
<!--
This is only a sample field, to view all the informations provided by
the Javascript object
-->
<aui:input name="folderArea" type="textarea" />