No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
Applying Ajax Behavior to Events on Any Component
Using command links and buttons to implement a partial page update is relatively simple, but suppose you want to have the same page update occur just by hovering the mouse over a contact's name?
To do this with the contact list example, remove the <apex:commandLink> tag from the
data table and wrap the contact name in an <apex:outputPanel> tag instead.
Within this output panel, add an <apex:actionSupport> element as a sibling of the contact's name:
- The <apex:outputPanel> tag defines the area over in which we want the specialized behavior.
- The <apex:actionSupport> tag defines the partial page update behavior that was implemented
previously by the command link.
- The event attribute specifies the DOM event that should trigger the update. Whereas <apex:commandLink> only executes during the “onclick” event, <apex:actionSupport> can execute on any valid event such as “onclick”, “ondblclick”, or, for this example, “onmouseover”.
- The reRender attribute specifies which part of the page should refresh.
- The <apex:param> tag sets the value of the cid query string parameter when the specified event occurs.
The resulting markup looks like this:
After saving the page, move the mouse over any contact and notice that the detail area refreshes appropriately without clicking on it.