Wiring Portlets with Preferences
Portlet wiring connects one portlet to another portlet to enable the exchange of data. Typically, a portlet contains data stored as a preference. Through wiring, the portlet pushes the preference to another portlet, resulting in the exchange of the stored data.
You can test your portlet on My webMethods Server by selecting an available portlet and wiring the preference property from the first or source portlet to the destination portlet.
For more information about wiring the property of a portlet to the property of another, see Administering My webMethods Server.
To use a preference to wire a value from one portlet to another
1. Open a portlet and create a preference with an internal value. For more information about creating portlet preferences, see Creating a Portlet Preference. Be sure to clear the Hidden check box to make the preference available as a portlet property. For example, create a preference named Postal Code, and for the value type a valid postal code, such as 90210.
2. With a portlet view open in the editor, locate the preference the Bindings view and drag the preference to the design canvas. A Basic Text Output control is added to the interface.
3. Select the Basic Text Output control in the editor and then click the Value tab in the Properties view. Observe that the Value field contains a binding expression to the preference you created.
For example:
#{Portlet1DefaultviewView.portlet1.postalCode}
4. Publish the portlet to My webMethods Server and add the portlet to a server page. For information about adding a portlet to a server page, see Administering My webMethods Server.
When you view the page, the portlet should display the value you defined when you created the preference (in this case, the postal code 90210).
5. Locate a portlet that requires a postal code as an input (such as the Yahoo! Weather portlet), and add it to the page.
6. On the new portlet, click Tools > Wiring.
7. On the portlet wiring page, locate the property for the zip code value. For the Yahoo! Weather portlet, the property name is Zip Code.
a. In the Source Portlet column, click the drop-down list and select the portlet that contains the preference you created in Step 1.
b. In the Source Property column, click Browse, click the name of the preference you created in Step 1 (in this case, Postal Code), and then click Select.
8. Click Submit.
You have now wired the preference value you created in your original portlet in Step 1 to a property of the second portlet (in this case, the Zip Code property of the Yahoo! Weather portlet). When you view the server page that contains the portlets, the postal code value you specified in the first portlet should be used to render the results displayed in the second portlet.
To change the preference value in the first portlet, click Tools > Properties, and in the Portlet Preferences area, type a new value for the preference and click Apply. When you return to the server page, the new value should be used to render the results displayed in the second portlet.