Child pages
  • JSProgressMonitor

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
{div:style=display:none} DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING. THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR{div} {div:id=description}{div}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[Boolean]{td}{td}[#cancel]\() Cancels the transfer process.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getCurrentBytesToTransfer]\() Returns the number of bytes to transfer for the current file.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getCurrentFileIndex]\() Returns the index of the current file being transferred.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getCurrentTransferredBytes]\() Returns the number of bytes already transferred for the current file.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getCurrentTransferredFileName]\() Returns the name of the current file being transferred.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getTotalBytesToTransfer]\() Returns the total bytes to transfer to or from the server (sum of all the files size){td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getTotalFilesToTransfer]\() Returns the total number of files to transfer.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getTotalTransferredBytes]\() Returns the total bytes already transferred (for all files){td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#isCanceled]\() Returns true if the process was canceled.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#isFinished]\() Returns true if the process is finished.{td}{tr}{tbody}{tbody}{tr}{td}[JSProgressMonitor]{td}{td}[#setProgressCallBack]\(function, interval) Sets a method to be called repeatedly at the given interval (in seconds), the method will receive an instance of this JSProgressMonitor updated with the latest values.{td}{tr}{tbody}{tbody}{tr}{td}[JSProgressMonitor]{td}{td}[#setProgressCallBack]\(function, interval, delay) Sets a method to be called repeatedly at the given interval (in seconds), the method will receive an instance of this JSProgressMonitor updated with the latest values.{td}{tr}{tbody}{table}\\ {table:id=function|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=cancel}{tr:id=name}{td}h6.cancel{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}cancel{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} monitor.cancel(); {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getCurrentBytesToTransfer}{tr:id=name}{td}h6.getCurrentBytesToTransfer{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}getCurrentBytesToTransfer{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} application.output('total transferred: ' + monitor.getTotalTransferredBytes() + ' / ' + monitor.getTotalBytesToTransfer()); application.output('current file: ' + monitor.getCurrentTransferredFileName() + ' ( ' + monitor.getCurrentFileIndex() + ' / ' + monitor.getTotalFilesToTransfer() + ' )'); application.output('current bytes transferred: '+monitor.getCurrentTransferredBytes() + ' / ' + monitor.getCurrentBytesToTransfer()); if (monitor.isCanceled()) { application.output('canceled!') } if (monitor.isFinished()) { application.output('finished!') } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getCurrentFileIndex}{tr:id=name}{td}h6.getCurrentFileIndex{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}getCurrentFileIndex{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} application.output('total transferred: ' + monitor.getTotalTransferredBytes() + ' / ' + monitor.getTotalBytesToTransfer()); application.output('current file: ' + monitor.getCurrentTransferredFileName() + ' ( ' + monitor.getCurrentFileIndex() + ' / ' + monitor.getTotalFilesToTransfer() + ' )'); application.output('current bytes transferred: '+monitor.getCurrentTransferredBytes() + ' / ' + monitor.getCurrentBytesToTransfer()); if (monitor.isCanceled()) { application.output('canceled!') } if (monitor.isFinished()) { application.output('finished!') } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getCurrentTransferredBytes}{tr:id=name}{td}h6.getCurrentTransferredBytes{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}getCurrentTransferredBytes{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} application.output('total transferred: ' + monitor.getTotalTransferredBytes() + ' / ' + monitor.getTotalBytesToTransfer()); application.output('current file: ' + monitor.getCurrentTransferredFileName() + ' ( ' + monitor.getCurrentFileIndex() + ' / ' + monitor.getTotalFilesToTransfer() + ' )'); application.output('current bytes transferred: '+monitor.getCurrentTransferredBytes() + ' / ' + monitor.getCurrentBytesToTransfer()); if (monitor.isCanceled()) { application.output('canceled!') } if (monitor.isFinished()) { application.output('finished!') } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getCurrentTransferredFileName}{tr:id=name}{td}h6.getCurrentTransferredFileName{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}getCurrentTransferredFileName{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} application.output('total transferred: ' + monitor.getTotalTransferredBytes() + ' / ' + monitor.getTotalBytesToTransfer()); application.output('current file: ' + monitor.getCurrentTransferredFileName() + ' ( ' + monitor.getCurrentFileIndex() + ' / ' + monitor.getTotalFilesToTransfer() + ' )'); application.output('current bytes transferred: '+monitor.getCurrentTransferredBytes() + ' / ' + monitor.getCurrentBytesToTransfer()); if (monitor.isCanceled()) { application.output('canceled!') } if (monitor.isFinished()) { application.output('finished!') } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getTotalBytesToTransfer}{tr:id=name}{td}h6.getTotalBytesToTransfer{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}getTotalBytesToTransfer{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} application.output('total transferred: ' + monitor.getTotalTransferredBytes() + ' / ' + monitor.getTotalBytesToTransfer()); application.output('current file: ' + monitor.getCurrentTransferredFileName() + ' ( ' + monitor.getCurrentFileIndex() + ' / ' + monitor.getTotalFilesToTransfer() + ' )'); application.output('current bytes transferred: '+monitor.getCurrentTransferredBytes() + ' / ' + monitor.getCurrentBytesToTransfer()); if (monitor.isCanceled()) { application.output('canceled!') } if (monitor.isFinished()) { application.output('finished!') } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getTotalFilesToTransfer}{tr:id=name}{td}h6.getTotalFilesToTransfer{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}getTotalFilesToTransfer{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} application.output('total transferred: ' + monitor.getTotalTransferredBytes() + ' / ' + monitor.getTotalBytesToTransfer()); application.output('current file: ' + monitor.getCurrentTransferredFileName() + ' ( ' + monitor.getCurrentFileIndex() + ' / ' + monitor.getTotalFilesToTransfer() + ' )'); application.output('current bytes transferred: '+monitor.getCurrentTransferredBytes() + ' / ' + monitor.getCurrentBytesToTransfer()); if (monitor.isCanceled()) { application.output('canceled!') } if (monitor.isFinished()) { application.output('finished!') } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getTotalTransferredBytes}{tr:id=name}{td}h6.getTotalTransferredBytes{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}getTotalTransferredBytes{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} application.output('total transferred: ' + monitor.getTotalTransferredBytes() + ' / ' + monitor.getTotalBytesToTransfer()); application.output('current file: ' + monitor.getCurrentTransferredFileName() + ' ( ' + monitor.getCurrentFileIndex() + ' / ' + monitor.getTotalFilesToTransfer() + ' )'); application.output('current bytes transferred: '+monitor.getCurrentTransferredBytes() + ' / ' + monitor.getCurrentBytesToTransfer()); if (monitor.isCanceled()) { application.output('canceled!') } if (monitor.isFinished()) { application.output('finished!') } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=isCanceled}{tr:id=name}{td}h6.isCanceled{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}isCanceled{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} application.output('total transferred: ' + monitor.getTotalTransferredBytes() + ' / ' + monitor.getTotalBytesToTransfer()); application.output('current file: ' + monitor.getCurrentTransferredFileName() + ' ( ' + monitor.getCurrentFileIndex() + ' / ' + monitor.getTotalFilesToTransfer() + ' )'); application.output('current bytes transferred: '+monitor.getCurrentTransferredBytes() + ' / ' + monitor.getCurrentBytesToTransfer()); if (monitor.isCanceled()) { application.output('canceled!') } if (monitor.isFinished()) { application.output('finished!') } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=isFinished}{tr:id=name}{td}h6.isFinished{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}isFinished{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} application.output('total transferred: ' + monitor.getTotalTransferredBytes() + ' / ' + monitor.getTotalBytesToTransfer()); application.output('current file: ' + monitor.getCurrentTransferredFileName() + ' ( ' + monitor.getCurrentFileIndex() + ' / ' + monitor.getTotalFilesToTransfer() + ' )'); application.output('current bytes transferred: '+monitor.getCurrentTransferredBytes() + ' / ' + monitor.getCurrentBytesToTransfer()); if (monitor.isCanceled()) { application.output('canceled!') } if (monitor.isFinished()) { application.output('finished!') } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setProgressCallBack-Function_Number}{tr:id=name}{td}h6.setProgressCallBack{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[JSProgressMonitor]{span}{span:style=font-weight: bold;}setProgressCallBack{span}{span}\(function, interval){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Function]} function -- the Function to call back at the specified interval \{[Number]} interval -- the interval (in seconds) to use {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[JSProgressMonitor] -- this for chaining{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} // call the progressCallbackFuntion every 2 and a half seconds (with a delay of 200ms in developer): monitor.setProgressCallBack(progressCallbackFunction, 2.5, (application.isInDeveloper() ? 200 : 0)); {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=setProgressCallBack-Function_Number_Number}{tr:id=name}{td}h6.setProgressCallBack{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[JSProgressMonitor]{span}{span:style=font-weight: bold;}setProgressCallBack{span}{span}\(function, interval, delay){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Function]} function -- the Function to call back at the specified interval \{[Number]} interval -- the interval (in seconds) to use \{[Number]} delay -- adds a delay for testing purpose in Developer {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[JSProgressMonitor] -- this for chaining{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} // call the progressCallbackFuntion every 2 and a half seconds (with a delay of 200ms in developer): monitor.setProgressCallBack(progressCallbackFunction, 2.5, (application.isInDeveloper() ? 200 : 0)); {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Wiki Markup
Cache
indextrue
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy sSummary12%30%58%height: 30px;3Methods SummaryCancels the transfer process.Returns the number of bytes to transfer for the current file.Returns the index of the current file being transferred.Returns the number of bytes already transferred for the current file.Returns the name of the current file being transferred.Returns the total bytes to transfer to or from the server (sum of all the files size)Returns the total number of files to transfer.Returns the total bytes already transferred (for all files)Returns true if the process was canceled.Returns true if the process is finished.Sets a method to be called repeatedly at the given interval (in seconds), the method will receive an instance of this JSProgressMonitor updated with the latest values.Sets a method to be called repeatedly at the given interval (in seconds), the method will receive an instance of this JSProgressMonitor updated with the latest values.

functionservoy sDetail2100%height:30px2Methods Detailscancelname

cancel()

dessIndent
Cancels the transfer process.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowgetCurrentBytesToTransfername

getCurrentBytesToTransfer()

dessIndent
Returns the number of bytes to transfer for the current file.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getCurrentFileIndexname

getCurrentFileIndex()

dessIndent
Returns the index of the current file being transferred.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getCurrentTransferredBytesname

getCurrentTransferredBytes()

dessIndent
Returns the number of bytes already transferred for the current file.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getCurrentTransferredFileNamename

getCurrentTransferredFileName()

dessIndent
Returns the name of the current file being transferred.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getTotalBytesToTransfername

getTotalBytesToTransfer()

dessIndent
Returns the total bytes to transfer to or from the server (sum of all the files size)
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getTotalFilesToTransfername

getTotalFilesToTransfer()

dessIndent
Returns the total number of files to transfer.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getTotalTransferredBytesname

getTotalTransferredBytes()

dessIndent
Returns the total bytes already transferred (for all files)
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
isCanceledname

isCanceled()

dessIndent
Returns true if the process was canceled.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
isFinishedname

isFinished()

dessIndent
Returns true if the process is finished.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
setProgressCallBackname

setProgressCallBack(function, interval)

dessIndent
Sets a method to be called repeatedly at the given interval (in seconds), the method will receive an instance of this JSProgressMonitor updated with the latest values. Can use an optional delay (for testing purpose in developer).
prs

Parameters

sIndentfunctionthe Function to call back at the specified intervalintervalthe interval (in seconds) to use
ret

Returns

sIndent this for chaining
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
setProgressCallBackname

setProgressCallBack(function, interval, delay)

dessIndent
Sets a method to be called repeatedly at the given interval (in seconds), the method will receive an instance of this JSProgressMonitor updated with the latest values. Can use an optional delay (for testing purpose in developer).
prs

Parameters

sIndentfunctionthe Function to call back at the specified intervalintervalthe interval (in seconds) to usedelayadds a delay for testing purpose in Developer
ret

Returns

sIndent this for chaining
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow