Please disable your adblock and script blockers to view this page

Search this blog

Showing posts with label poll listener. Show all posts
Showing posts with label poll listener. Show all posts

Monday 15 February 2016

Show live progress of a long running task using af:progressIndicator in Oracle ADF

This post is about using af:progressIndicator to show live status of a particular task
af:progressIndicator state is tracked and maintained by it's value property that supports org.apache.myfaces.trinidad.model.BoundedRangeModel
This class has two methods

public abstract long getMaximum() { }
returns Maximum value for Model

public abstract long getValue() { }
returns value for Model (current state)

Now to see live progress on page we have to refresh progressIndicator component periodically and this can be achieved using af:poll component , poll component delivers poll events to server periodically and we can ppr (refresh) progress indicator after a particular interval

Saturday 27 April 2013

Auto dismiss popup component with dialog- Oracle ADF

af:popup is container component for noteWindow, dialog, panelWinow, contextMenus, when we use popup with af:noteWindow, there is property autoDismissalTimeout is responsible for closing poup after some specific time.
But if we are using af:dialog in af:popup , how to close popup in this situation ?

Steps to do-

  • Create a fragment in bounded taskFlow and drag a button on which we have to open popup.
  • Drag a popup in page and showPopupBehavior inside button, pass id of popup and set trigger type to action to open poup on button click
af:popup in Oracle ADF
  •  Now drag a af:poll  component inside af:dialog
poll component delivers poll event to server at  fixed intervals, so we can use this property to fulfil our requirement .
  
Drop poll component inside popup

  • Select poll component in structure window and go to propertyInspector ,create poll listener  in managed bean and set Interval and Timeout to 4000 & 4001 (Timeout slightly greater than Interval time)-It means poll event delivers to server after 4000 ms or 4second




Create a poll listener in managed bean to deliver poll event at fixed interval

  • Now bind popup component to your managed bean, inorder to control poup properties
Create Component Binding for popup in managed bean
  • Close poup in pollListener(), means when after 4sec when poll event invoke server, it will close popup dialog automatically.

Sample ADF Application- Download