Class for manipulating and receiving changes of the relevant hash segment which belongs to a router. This Class doesn't change the browser hash directly, but informs its parent RouterHashChanger and finally changes the browser hash through the sap.ui.core.routing.HashChanger
Method | Description |
---|---|
sap.ui.core.routing.RouterHashChanger.extend |
Creates a new subclass of class sap.ui.core.routing.RouterHashChanger with name
|
fireHashChanged |
Save the given hash and potentially fires a "hashChanged" event; may be extended to modify the hash before firing the event. |
getHash |
Gets the current hash |
sap.ui.core.routing.RouterHashChanger.getMetadata |
Returns a metadata object for class sap.ui.core.routing.RouterHashChanger. |
replaceHash |
Replaces the hash with a certain value. When using the replace function, no browser history entry is written. If you want to have an entry in the browser history, please use the #setHash function. |
resetHash |
Reset the hash if the given router is the active router that is saved in this RouterHashChanger This is needed for allowing to fire the hashChanged event with the previous hash again after displaying a Target without involving a Router. |
setHash |
Sets the hash to a certain value. When using this function, a browser history entry is written. If you do not want to have an entry in the browser history, please use the #replaceHash function. |
Creates a new subclass of class sap.ui.core.routing.RouterHashChanger with name sClassName
and enriches it with the information contained in oClassInfo
.
oClassInfo
might contain the same kind of information as described in sap.ui.core.routing.HashChangerBase.extend.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |
Save the given hash and potentially fires a "hashChanged" event; may be extended to modify the hash before firing the event.
Param | Type | DefaultValue | Description |
---|---|---|---|
sHash | string |
the new hash of the browser |
|
oSubHashMap | object |
the prefixes and hashes for the child RouterHashChangers |
|
bUpdateHashOnly | boolean |
if this parameter is set to true, the given sHash is saved in the instance but no "hashChanged" event is fired. |
Returns a metadata object for class sap.ui.core.routing.RouterHashChanger.
Replaces the hash with a certain value. When using the replace function, no browser history entry is written. If you want to have an entry in the browser history, please use the #setHash function.
Param | Type | DefaultValue | Description |
---|---|---|---|
sHash | string |
New hash |
|
sDirection | sap.ui.core.routing.HistoryDirection |
The direction information for the hash replacement |
|
pNestedHashChange | Promise |
When this parameter is given, this RouterHashChanger switchs to collect mode and all hash changes from its children will be collected. When this promise resolves, this RouterHashChanger fires a "hashReplaced" event with its own hash and the hashes which are collected from the child RouterHashChanger(s). |
|
bSuppressActiveHashCollect | boolean | false |
Whether this RouterHashChanger shouldn't collect the prefixes from its active child RouterHashChanger(s) and forward them as delete prefixes within the next "hashReplaced" event |
Reset the hash if the given router is the active router that is saved in this RouterHashChanger
This is needed for allowing to fire the hashChanged event with the previous hash again after displaying a Target without involving a Router.
Param | Type | DefaultValue | Description |
---|---|---|---|
oRouter | sap.ui.core.routing.Router |
the router from which the resetHash is started |
Sets the hash to a certain value. When using this function, a browser history entry is written. If you do not want to have an entry in the browser history, please use the #replaceHash function.
Param | Type | DefaultValue | Description |
---|---|---|---|
sHash | string |
New hash |
|
pNestedHashChange | Promise |
When this parameter is given, this RouterHashChanger switchs to collect mode and all hash changes from its children will be collected. When this promise resolves, this RouterHashChanger fires a "hashSet" event with its own hash and the hashes which are collected from the child RouterHashChanger(s). |
|
bSuppressActiveHashCollect | boolean | false |
Whether this RouterHashChanger shouldn't collect the prefixes from its active child RouterHashChanger(s) and forward them as delete prefixes within the next "hashSet" event |