Time for action – publishing an event and subscribing it
Use the following steps to publish and subscribe an event:
Select the component that is raising the
REFRESH
event.Go to the property inspector and create a contextual event.
In the Publish Contextual Event dialog, select the Create New Event option and provide the name
REFRESH
in the text field provided.In the Payload section, select the Pass Custom Value from: option and then the String Literal option. You are provided with other options such as Page Data and Managed Bean method return. Please note that we can refresh the page without any payload value. The payload example provided here is only for you to learn how to pass the values.
You can set a condition to raise the event in the Raise Condition section of the dialog.
Click on the OK button. Now go to the page definition, and you can see the
REFRESH
event added to the Contextual Event section, as shown in the following screenshot:Now go to the page where you want to subscribe...