java - how to update information on a popup window while the execution continues -
i have cancel popup custom ok button confirmation , i'd update progress information on execution goes on.
popup follows
<af:popup id="confirmationpopupsend" binding="#{pageflowscope.bean.confirmationpopup}" contentdelivery="immediate"> <af:dialog id="confirmationdialogsend" modal="true" title="confirmation" type="cancel"> <f:facet name="buttonbar"> <af:commandbutton id="confirmdialogbuttonsend" text="ok" action="#{pageflowscope.bean.submitaction}"/> </f:facet> <af:outputtext value="are sure? might take while."/> <af:outputtext visible="#{pageflowscope.bean.someprogress> 0}" value="#{pageflowscope.bean.someprogress}" /> </af:dialog> </af:popup>
my submitaction method follows
public string submitaction() { for(some condition){ //update variable someprogress refreshloadingpopup(); } }
and refresh method
public string refreshloadingpopup(){ facescontext context = facescontext.getcurrentinstance(); uiviewroot root = context.getviewroot(); uicomponent c = findcomponent(root, "confirmationdialogsend") adffacescontext.getcurrentinstance().addpartialtarget(c); }
the problem here refresh method works. checked putting test button on popup window , updates information when put refresh method inside submitaction method, nothing happens on popup window execution continues. once submitaction ends execution, popup closes anyway.
i want show progress user. other approach welcome, too.
thanks
you can't update popup calling refreshloadingpopup
method. following line marks component c
refreshed.
adffacescontext.getcurrentinstance().addpartialtarget(c);
while request being processed (the loop in submitaction
method executing) client not have response , component c
not refreshed.
you should continue update pageflowscope.bean.someprogress
property in loop , make client poll value i.e. every 0.5 seconds.
you can use af:poll component requirement. here example shows how use af:poll component: http://www.oracle.com/technetwork/developer-tools/adf/learnmore/42-progressbarcolor-169184.pdf
Comments
Post a Comment