This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Jun 30, 2011, 12:42 PM
261 Posts

Re: dijit.ProgressBar and dijit.Dialog

  • Category: Dojo and Client Side JavaScript
  • Platform: All
  • Release: 8.5.3
  • Role:
  • Tags:
  • Replies: 2
Hello Stacey,
 
Doing a partial refresh to show a dialog with a partial bar and running an agent should work. I did use the same construction. Below is a simple sample XPage that shows how I did it.
 
Note that I've set the indeterminate property of the progress bar to true, since I cannot give feedback to the user what progress the agent has made. I only know that it is running until the refresh is complete. When the agent is finished, the code in the onComplete event is called to hide the progress dialog.

Good luck,
Mark


<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" dojoTheme="true">

    <xp:this.resources>
        <xp:dojoModule name="dijit.Dialog"></xp:dojoModule>
        <xp:dojoModule name="dijit.ProgressBar"></xp:dojoModule>
    </xp:this.resources>
   
    <xp:button value="Start server agent" id="button1">
        <xp:eventHandler event="onclick" submit="true"
            refreshMode="partial" refreshId="computedField1">
            <xp:this.script><![CDATA[var progressBar = new dijit.ProgressBar({indeterminate:true, layoutAlign: "left"});

progressDlg = new dijit.Dialog( {
    title:"Please wait...", 
    content: progressBar,
     style: "width: 150px"
     });
progressDlg.show();]]></xp:this.script>
            <xp:this.onComplete><![CDATA[progressDlg.hide();]]></xp:this.onComplete>

            <xp:this.action><![CDATA[#{javascript:var agent = database.getAgent("MyAgent");
agent.run();}]]></xp:this.action>
        </xp:eventHandler>
    </xp:button>
   
    <br /><br />
    Current (server) time in milliseconds (will be refreshed/ updated when agent is finished):&#160;
    <xp:text escape="true" id="computedField1"
        value="#{javascript:new Date().getTime();}">
        <xp:this.converter>
            <xp:convertNumber type="number" integerOnly="true"></xp:convertNumber>
        </xp:this.converter>
    </xp:text>

</xp:view>
Jul 5, 2011, 10:11 PM
35 Posts
Re: dijit.ProgressBar and dijit.Dialog
 Works Great!! Thanks so much!!

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal