Child pages
  • History

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}History is a stack of form names that were visible on the screen ordered by appearance. The first/oldest item is stored in position/index 1. Each container (the main application window or dialogs showing forms) has its own history stack. When the History object is accessed from within scripting, the methods of the History object will work with the history stack for the active container. Only main forms ( [currentcontroller|Globals#currentcontroller]) will be stored in History, so not forms displayed in tabpanels or splitpanes. The history has a maximum size of 10 entries. When the maximum size is reached, the oldest entries are automatically removed to make place for new entries.{div}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}[Boolean]{td}{td}[#buttonsEnabled]
Wiki Markup
Cache
indextrue
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientsWordListMobileClient

servoy sSummary12%30%58%height: 30px;3Property SummarySet/Get the history buttons enabled.

servoy sSummary12%30%58%height: 30px;3Methods SummaryvoidNavigates back in the history stack; shows the previous form (if present).voidClear the entire history stack.voidNavigates forward in the history stack; shows the next form (if present).Get the current absolute index in the history stack.Get the form name based on the specified absolute index in the history stack location.voidNavigates to the relative index based on current position in the history.Removes the named form item from the history stack (and from memory) if not currently shown.Removes an absolute index based history stack form item.Returns the total size of the history stack.

propertyservoy sDetail2100%height:30px2Property DetailsbuttonsEnabledname

buttonsEnabled

dessIndent
Set/Get the history buttons enabled.
{td}{tr}{tbody}{table}\\ {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}void{td}{td}[#back]\()
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow

functionservoy sDetail2100%height:30px2Methods Detailsbackname

back()

dessIndent
Navigates back in the history stack; shows the previous form (if present).
{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#clear]\()
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRowclearname

clear()

dessIndent
Clear the entire history stack.
{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#forward]\()
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRowforwardname

forward()

dessIndent
Navigates forward in the history stack; shows the next form (if present).
{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getCurrentIndex]\()
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRowgetCurrentIndexname

getCurrentIndex()

dessIndent
Get the current absolute index in the history stack.
{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getFormName]\(i)
ret

Returns

sIndent the current absolute index
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRowgetFormNamename

getFormName(i)

dessIndent
Get the form name based on the specified absolute index in the history stack location.
{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#go]\(i)
prs

Parameters

sIndentithe absolute index
ret

Returns

sIndent the formName
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRowgoname

go(i)

dessIndent
Navigates to the relative index based on current position in the history.
{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#removeForm]\(formName)
prs

Parameters

sIndentithe relative index
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRowremoveFormname

removeForm(formName)

dessIndent
Removes the named form item from the history stack (and from memory) if not currently shown.
{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#removeIndex]\(index) Removes an absolute index based history stack form item.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#size]\() Returns the total size of the history stack.{td}{tr}{tbody}{table}\\ {table:id=property|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=buttonsEnabled}{tr:id=name}{td}h6.buttonsEnabled{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} history.buttonsEnabled = true; var status = history.buttonsEnabled; {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{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=back}{tr:id=name}{td}h6.back{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}back{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} history.back(); {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=clear}{tr:id=name}{td}h6.clear{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}clear{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} history.clear(); {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=forward}{tr:id=name}{td}h6.forward{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}forward{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} history.forward(); {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getCurrentIndex}{tr:id=name}{td}h6.getCurrentIndex{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}getCurrentIndex{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number] -- the current absolute index{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var abs_index = history.getCurrentIndex(); {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getFormName-Number}{tr:id=name}{td}h6.getFormName{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}getFormName{span}{span}\(i){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Number]} i -- the absolute index {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String] -- the formName{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var name = history.getFormName(history.getCurrentIndex()); {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=go-Number}{tr:id=name}{td}h6.go{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}go{span}{span}\(i){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Number]} i -- the relative index {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} history.go(-3); {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=removeForm-String}{tr:id=name}{td}h6.removeForm{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}removeForm{span}{span}\(formName){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} formName -- the name of the form to remove. {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean] -- true if successful{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var done = history.removeForm('mypreviousform'); {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=removeIndex-Number}{tr:id=name}{td}h6.removeIndex{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}removeIndex{span}{span}\(index){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Number]} index -- the index of the form to remove. {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean] -- true if successful{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var done = history.removeIndex(history.getCurrentIndex()+1); {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=size}{tr:id=name}{td}h6.size{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Number]{span}{span:style=font-weight: bold;}size{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Number] -- the size{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var size = history.size(); {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}

Will return false when the form can't be removed, this can happen in certain situations:
1> The form is visible,
2> The form is executing a function (is actively used),
3> There are references to this form by a global variable/array,
4> If the form has a separate foundset with edited records that can't be saved (for example autosave is false)
prs

Parameters

sIndentformNamethe name of the form to remove.
ret

Returns

sIndent true if successful
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
removeIndexname

removeIndex(index)

dessIndent
Removes an absolute index based history stack form item.
prs

Parameters

sIndentindexthe index of the form to remove.
ret

Returns

sIndent true if successful
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
sizename

size()

dessIndent
Returns the total size of the history stack.
ret

Returns

sIndent the size
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow