In Liferay, you can call the Edit Request widget by creating the portlet and specifying the source code. Review the following steps for producing the earlier Edit Request widget example. Follow them as a model to configure the display and behavior of the Edit Request widget in your implementation.
Follow these steps:
The New Web Content window appears.
The new portlet gets added to Liferay.
The portlet Settings appears.
The Source container opens for editing.
Source and Key Parameters
The source for the Edit Request widget example follows:
<script type="text/javascript" src="http://hostname:portnumber/usm/gwt/fdRenderer/fdRenderer.nocache.js"></script>
<script type="text/javascript" language="javascript" src="http://hostname:8080/usm/explorer/scripts/edit.request.widget.js">
<script> CA_Catalog.buildWidget({ type: 'edit.request', renderTo: 'targetDiv', login credentials, businessUnit:"London222", rootId: -1, linkColor: 'inherit', borderColor: 'darkGreen', layout:'layout-8', openIn:'_self'}); </script>
<div align="left" id="targetDiv" style="margin-bottom: 10px;"> </div>
The first line references the form renderer required for the Edit Request widget.
The second line references the JavaScript file for the Edit Request widget.
The third line specifies the JavaScript with configuration parameters for the Edit Request widget.
Note: Separate parameters with a comma, but do not specify a comma after the last parameter.
The fourth line specifies the DOM element in which the Edit Request widget is rendered.
Key parameters and explanations follow for the CA_Catalog.buildWidget function call in the Edit Request widget example.
login credentials
We recommend single-sign-on for widgets. However, if you require login credentials for this widget, specify them in this function call. Use the following format:
username: 'username', password: 'password'
Specifies that the widget is an Edit Request widget.
Specifies that the widget is rendered into the DOM element whose ID is targetDiv.
Specifies the business unit that catalog users can access while utilizing this Edit Request widget. Users can edit requests in all folders in this business unit.
For example, if you specify the root business unit, users can edit requests in all folders in all business units, including the root business unit. Conversely, if you specify the lowest level business unit, users can edit requests from that business unit only.
If you do not specify a value, the Catalog system uses the default business unit of the user accessing the widget.
Specifies that when the Request List widget opens initially, it displays nothing.
As soon as the user clicks an option on the Status widget, the Request List widget displays the matching item: the cart, open requests, completed requests, or requests pending action.
Note: If you specify a request, it must exist in a business unit that the user can access, as explained in the businessUnit parameter.
Copyright © 2013 CA.
All rights reserved.
|
|