The Web Dock portlet can send events to other portlets on the same page using client side eventing.
The client side eventing method uses the OpenAjax.hub.publish(name, publisherData)
method. The name
parameter is the topic to which the event is published. The publisherData
parameter is the data that is passed as an argument to the handler function, which is handling this event. See the OpenAjax.hub.publish(name, publisherData) related link for additional information.
To enable the Web Dock portlet to publish a client side event, set the Publish event preference in the Edit Shared Settings
mode to true
. The Web Dock portlet always sends the source element in the form of a Document Object Model (DOM) node as the publisherData
. The source element is the element where the user did some action which resulted in the publishing of the event. The type of event source element preference is used to specify the type of elements (a comma separated list like button, a
) which can result in the publishing of an event. The Type of event captured preference is used to specify the type of events (a comma separated list like onclick, onchange) that need to be captured from inside the iframe of the Web Dock portlet. Only the events that are captured from inside the iframe of the Web Dock portlet will result in the publishing of an event. By default, the Web Dock portlet publishes to the global topic, which is com.ibm.vwat.event
. However, using the Publish event topic preference, you can set the publish topic to whatever is needed. The value in the Publish event topic preference is appended to the "com.ibm.vwat.event
" to form the new topic. For example, if Publish event topic is set to "myTopic.subTopic1.subTopic2
", then the queue where the Web Dock portlet publishes the event is "com.ibm.vwat.event.myTopic.subTopic1.subTopic2
Parent topic: Supporting Inter Portlet Communication in the web application bridge