History Class Reference

This class enables to access the navigation history and overwrite the default history management.

History.redirect(func)

Interrupts the current page processing and redirect it to the new func function. Use this function when you do not want the current function call to be added to the history. func (string) must be a valid javascript function call.

This method is used when perform a insert query in the local database, to avoid reinserting a record in case of screen refresh.

function insertRecord() {
    var id = Query.insert("mytable", {date:Date.now(), owner:User.getName()});
    History.redirect("editRecord({id})");
}

function editRecord(id) {
    ...
}
Never execute anymore code afer History.redirect() has been called. This must be the last statement in your code.

History.back()

Performs a programmatic back navigation. Same as tapping the Back button on the UI

History.reload(func)

Reload the current history state. If func (string is not null, it replaces the current historyt state by func, then does a reload on this new state.