Used to determine the sap.ui.core.routing.HistoryDirection of the current or a future navigation, done with a sap.ui.core.routing.Router or sap.ui.core.routing.HashChanger.
ATTENTION: this class will not be accurate if someone does hash-replacement without the named classes above. If you are manipulating the hash directly, this class is not supported anymore.
new sap.ui.core.routing.History(oHashChanger)
Param | Type | Default Value | Description |
---|---|---|---|
oHashChanger | sap.ui.core.routing.HashChanger | required, without a HashChanger this class cannot work. The class needs to be aware of the hash-changes. |
Method | Description |
---|---|
getDirection |
Determines what the navigation direction for a newly given hash would be It will say Unknown if there is a history foo - bar (current history) - foo If you now ask for the direction of the hash "foo" you get Unknown because it might be backwards or forwards. For hash replacements, the history stack will be replaced at this position for the history. |
getHistoryStateOffset |
Returns the length difference between the history state stored in browser's pushState and the state maintained in this class. The function returns
Once the "hashChange" event is processed by this class, this method always returns 0. However, before a "hashChange" event reaches this class, it returns the offset between the new hash and the previous one within the history state. |
sap.ui.core.routing.History.getInstance | |
getPreviousHash |
gets the previous hash in the history - if the last direction was Unknown or there was no navigation yet, undefined will be returned |
Determines what the navigation direction for a newly given hash would be It will say Unknown if there is a history foo - bar (current history) - foo If you now ask for the direction of the hash "foo" you get Unknown because it might be backwards or forwards. For hash replacements, the history stack will be replaced at this position for the history.
Param | Type | DefaultValue | Description |
---|---|---|---|
sNewHash | string |
optional, if this parameter is not passed the last hashChange is taken. |
Returns the length difference between the history state stored in browser's pushState and the state maintained in this class.
The function returns undefined
when
Once the "hashChange" event is processed by this class, this method always returns 0. However, before a "hashChange" event reaches this class, it returns the offset between the new hash and the previous one within the history state.