Child pages
  • History

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
{div:style=}
Wiki Markup
Div
styledisplay: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.

\\ \\ Enter additional information related to this



Enter additional information related to this 'class'

inside

the

\

{div}

macro

with

'id=description'

{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] 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]\() Navigates back in the history stack; shows the previous form (if present).{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#clear]\() Clear the entire history stack.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#forward]\() Navigates forward in the history stack; shows the next form (if present).{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getCurrentIndex]\() Get the current absolute index in the history stack.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getFormName]\(i) 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) Navigates to the relative index based on current position in the history.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#removeForm]\(formName) 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=des}{td}{div:class=sIndent}Set/Get the history buttons enabled.{div}{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}

Div
iddescription

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) 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.


HTML Table
id
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#buttonsEnabled
Set/Get the history buttons enabled.

HTML Table
id
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#back()
Navigates back in the history stack; shows the previous form (if present).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#clear()
Clear the entire history stack.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#forward()
Navigates forward in the history stack; shows the next form (if present).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#getCurrentIndex()
Get the current absolute index in the history stack.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getFormName(i)
Get the form name based on the specified absolute index in the history stack location.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#go(i)
Navigates to the relative index based on current position in the history.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#removeForm(formName)
Removes the named form item from the history stack (and from memory) if not currently shown.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#removeIndex(index)
Removes an absolute index based history stack form item.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Number
Table Cell (td)
#size()
Returns the total size of the history stack.

HTML Table
idproperty
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Property Details
Table Body (tbody)
idbuttonsEnabled
Table Row (tr)
idname
Table Cell (td)
buttonsEnabled
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Set/Get the history buttons enabled.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

history.buttonsEnabled = true;
var status = history.buttonsEnabled;

...

Table Row (tr)
classlastDetailRow
Table Cell (td)


HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details
Table Body (tbody)
idback
Table Row (tr)
idname
Table Cell (td)
back
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
back
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Navigates back in the history stack; shows the previous form (if present).
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

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=des}{td}{div:class=sIndent}Clear the entire history stack.{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}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idclear
Table Row (tr)
idname
Table Cell (td)
clear
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
clear
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Clear the entire history stack.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

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=des}{td}{div:class=sIndent}Navigates forward in the history stack; shows the next form (if present).{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}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idforward
Table Row (tr)
idname
Table Cell (td)
forward
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
forward
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Navigates forward in the history stack; shows the next form (if present).
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

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=des}{td}{div:class=sIndent}Get the current absolute index in the history stack.{div}{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}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetCurrentIndex
Table Row (tr)
idname
Table Cell (td)
getCurrentIndex
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
getCurrentIndex
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the current absolute index in the history stack.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number – the current absolute index
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

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=des}{td}{div:class=sIndent}Get the form name based on the specified absolute index in the history stack location.{div}{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}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetFormName-Number
Table Row (tr)
idname
Table Cell (td)
getFormName
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getFormName
Span
(i)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the form name based on the specified absolute index in the history stack location.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Number} i – the absolute index
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
String – the formName
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

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=des}{td}{div:class=sIndent}Navigates to the relative index based on current position in the history.{div}{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}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgo-Number
Table Row (tr)
idname
Table Cell (td)
go
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
go
Span
(i)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Navigates to the relative index based on current position in the history.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Number} i – the relative index
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

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=des}{td}{div:class=sIndent}Removes the named form item from the history stack (and from memory) if not currently shown. 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){div}{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}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idremoveForm-String
Table Row (tr)
idname
Table Cell (td)
removeForm
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
removeForm
Span
(formName)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Removes the named form item from the history stack (and from memory) if not currently shown.
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)
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} formName – the name of the form to remove.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean – true if successful
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

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=des}{td}{div:class=sIndent}Removes an absolute index based history stack form item.{div}{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}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idremoveIndex-Number
Table Row (tr)
idname
Table Cell (td)
removeIndex
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
removeIndex
Span
(index)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Removes an absolute index based history stack form item.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Number} index – the index of the form to remove.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Boolean – true if successful
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

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=des}{td}{div:class=sIndent}Returns the total size of the history stack.{div}{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}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsize
Table Row (tr)
idname
Table Cell (td)
size
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Number
Span
stylefont-weight: bold;
size
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the total size of the history stack.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Number – the size
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var size = history.size();
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Table Row (tr)
classlastDetailRow
Table Cell (td)