Oracle WebCenter Interaction Web Service Development Guide

     Previous Next  Open TOC in new window   View as PDF - New Window  Get Adobe Reader - New Window
Content starts here

Using In-Place Refresh

To refresh pagelet/portlet content in place, without affecting other content on the page, use the Oracle WebCenter Interaction Scripting Framework to implement in-place refresh.

Many pagelets/portlets display data that is time sensitive. In some cases, users should be able to navigate across links within a pagelet/portlet without changing or refreshing the rest of the portal page. You can refresh pagelet/portlet content on command, associate the refresh action with an event (refreshOnEvent), or program the pagelet/portlet to refresh at a set interval (setRefreshInterval). The Oracle WebCenter Interaction Scripting Framework also contains methods for expanding and collapsing pagelets/portlets.

In the simplified example below, the refresh portlet displays a "Refresh Portlet" button. Clicking the button updates the date and time displayed in the portlet. (The refresh button in the portlet header is an optional feature available in Oracle WebCenter Interaction only, configured on the Advanced Settings page of the Web Service editor.)

The in-place refresh is executed by calling the refresh() method on the portlet object instance. The portlet reference can be retrieved by GUID, ID or name, available via the Oracle WebCenter Interaction Development Kit (IDK) IPortletRequest interface. You can also set a new URL to be displayed within the portlet upon refresh by using setRefreshURL or passing in a new URL when you call refresh. (The title bar cannot be altered on refresh.)

<div style="padding:10px;" align="center">
<p><button onclick="refresh_portlet()">Refresh Portlet</button></p>
<p><b>Current time is:</b><br> <span id="refreshTimeSpan"></span></p>
<pt:namespace pt:token="$PORTLET_ID$" xmlns:pt=''/>

<script type="text/javascript"> 
function refresh_portlet()
var refreshPortlet = PTPortlet.getPortletByID($PORTLET_ID$);
if (!refreshPortlet)
  refresh_debug('Could not locate PTPortlet object which corresponds to <b>Refresh Portlet</b> on page.');
refresh_debug('<b>Refresh Portlet</b> calling refresh() method.');

function refresh_debug(str)
if (window.PTDebugUtil) 

var t = new Date();
document.getElementById('refreshTimeSpan').innerHTML = t;

  Back to Top      Previous Next