Class sap.ui2.srvc.Page
Defined in: page.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
sap.ui2.srvc.Page(oFactory, vPageData)
Constructs a new representation (wrapper) of the page with the given ID
or the given page data to be loaded from the given factory's page building
service.
|
| Method Attributes | Method Name and Description |
|---|---|
|
addChipInstance(vTemplate, fnSuccess, fnFailure, bPartially)
Adds a new instance for the given CHIP to this page and loads that CHIP
instance completely unless requested otherwise.
|
|
|
addChipInstanceReference(oOriginal, fnSuccess, fnFailure)
Adds a new CHIP instance to this page which refers to the given original CHIP instance and
loads the reference completely if and only if the original is not a stub anymore.
|
|
|
exit()
Releases all resources associated with this page.
|
|
|
Returns this page's collection of all catalogs, which might still be a stub.
|
|
|
getBag(sBagId)
Returns the property bag with given ID attached to this page.
|
|
|
Returns an array of bag IDs attached to this page.
|
|
|
Returns this page's catalog, which might still be a stub.
|
|
|
Returns this page's CHIP instances.
|
|
|
getId()
Returns this page's ID.
|
|
|
Returns the layout for this page.
|
|
|
Returns this page's original language (in which the page has been created) as BCP-47.
|
|
|
getScope()
Returns this page's scope.
|
|
|
getTitle()
Returns this page's title.
|
|
|
Tells whether this page is a catalog page (see sap.ui2.srvc.Catalog#getCatalogPage
and sap.ui2.srvc.Factory#createNewPageBasedCatalog).
|
|
|
Tells whether this page is marked as outdated.
|
|
|
Tells whether this page can be altered on Personalization scope or not.
|
|
|
Tells whether this page was originally read from 'PERSONALIZATION' scope or was modified in
a way that had copied the page to that scope.
|
|
|
Tells whether this page is read-only.
|
|
|
isStub()
Tells whether this page is still only a stub and does not yet know its properties or related
objects, for example layout, title, catalog, or CHIP instances.
|
|
|
load(fnSuccess, fnFailure, bPartially)
Loads the current page including its layout, title, (stub) catalog, and CHIP instances (see
bPartially parameter). |
|
|
loadBag(sBagId)
Asynchronously get the property bag with given ID attached to this page.
|
|
|
remove(fnSuccess, fnFailure)
Removes (in other words, deletes) this page from the page building service.
|
|
|
removeChipInstance(oChipInstance, fnSuccess, fnFailure)
Removes the given page CHIP instance from this page's collection of CHIP instances, calls
the instance's
remove() method and returns true. |
|
|
setLayout(sLayout, fnSuccess, fnFailure)
Sets the layout (encoded as a string, for example in JSON) for this page and persists it.
|
|
|
setPersonalizationLocked(bIsPersLocked, fnSuccess, fnFailure)
Determines and persists the locking status of a page which determines if
a page can be altered on Personalization scope or not.
|
|
|
setTitle(sTitle, fnSuccess, fnFailure)
Sets the title for this page and persists it.
|
|
|
toString(bVerbose)
Returns this page's string representation.
|
Initially a stub is created, which can later load its properties and related objects asynchronously.
A page is a mutable object and changes can be persisted by the page building service.
- Parameters:
- {sap.ui2.srvc.Factory} oFactory
- the factory
- {string|object} vPageData
- the page's ID or its page data as loaded via page building service
- Since:
- 1.2.0
Note: Does not affect this page's layout.
- Parameters:
- {sap.ui2.srvc.Chip|sap.ui2.srvc.ChipInstance} vTemplate
- the CHIP (or stub) which is to be used; (since 1.11.0) alternatively a CHIP instance, in this case a new CHIP instance is created referring to the same CHIP and having the same title and configuration. The layout data will not be copied. It is up to the caller to update that value. No bags will be copied!
- {function (sap.ui2.srvc.ChipInstance)} fnSuccess
- success handler, taking the newly created CHIP instance which knows its page
- {function (string|[object])} fnFailure Optional
- error handler taking an error message and, since version 1.28.6, an
optional object containing the complete error information as delivered
by the ODataService. See fnFailure parameter of sap.ui2.srvc.ODataWrapper#onError
for more details.
If not given
sap.ui2.srvc.ODataService#getDefaultErrorHandleris used - {boolean} bPartially Optional, Default: false
- whether to create the new CHIP instance as a stub only
- Since:
- 1.2.0
- Throws:
- Error if the page is still a stub
Note: Does not affect this page's layout.
- Parameters:
- {sap.ui2.srvc.ChipInstance} oOriginal
- the CHIP instance (or stub) to refer to (which MUST know its page)
- {function (sap.ui2.srvc.ChipInstance)} fnSuccess
- success handler, taking the newly created reference which knows its page
- {function (string|[object])} fnFailure Optional
- error handler taking an error message and, since version 1.28.6, an
optional object containing the complete error information as delivered
by the ODataService. See fnFailure parameter of sap.ui2.srvc.ODataWrapper#onError
for more details.
If not given
sap.ui2.srvc.ODataService#getDefaultErrorHandleris used
- Since:
- 1.21.1
- Throws:
- Error if the page is still a stub
- Since:
- 1.2.0
Note: Returns undefined in case the JavaScript file for
sap.ui2.srvc.AllCatalogs has not been included!
- Since:
- 1.7.0
- Returns:
- {sap.ui2.srvc.AllCatalogs} this page's collection of all catalogs
If there is no bag with that ID an empty bag is returned.
- Parameters:
- {string} sBagId
- the bag ID
- Since:
- 1.3.0
- Returns:
- {sap.ui2.srvc.Bag} the page's bag for given ID
- Since:
- 1.3.0
- Returns:
- {string[]} array of bag IDs
- Since:
- 1.2.0
- Throws:
- Error if the page is still a stub
- Returns:
- {sap.ui2.srvc.Catalog} this page's catalog or
undefinedif the page has no catalog
- See:
- #isStub()
- Since:
- 1.2.0
- Throws:
- Error if the page is still a stub
- Returns:
- {sap.ui2.srvc.ChipInstance[]} this page's CHIP instances
- See:
- #isStub()
- Since:
- 1.2.0
- Returns:
- {string} this page's ID
- Since:
- 1.2.0
- Throws:
- Error if the page is still a stub
- Returns:
- {string} the layout for this page
- See:
- #isStub()
Note: Handling of translatable texts depends on the layer used. In some layers the original
language is important; in others it does not matter. In the latter case the empty string
("") is returned, which indicates that the user is allowed to edit the
translatable texts in any language.
The following code is a flexible way of checking the current situation without knowing the current language or layer:
if (oPage.getOriginalLanguage() === "" ||
oPage.getOriginalLanguage() === sap.ui.getCore().getConfiguration().getLanguage()) {
// create and modify the page's texts
}
This method is intended to be only called in a design time use case. Can only be called if the page is not a stub anymore.
- Since:
- 1.17.1
- Throws:
- Error if the page is still a stub
- Returns:
- {string} this page's original language (BCP-47) or
""
- See:
- #isStub()
- Since:
- 1.34.0
- Throws:
- Error if the page is still a stub
- Returns:
- {string} returns "PERSONALIZATION", "CUSTOMIZATION" or "CONFIGURATION".
- See:
- #isStub()
- #isPersonalized()
- Since:
- 1.2.0
- Throws:
- Error if the page is still a stub
- Returns:
- {string} this page's title
- See:
- #isStub()
- Since:
- 1.19.1
- Throws:
- Error if the page is still a stub
- Returns:
- {boolean} whether this page is a catalog page
- See:
- #isStub()
- Since:
- 1.7.0
- Throws:
- Error if the page is still a stub
- Returns:
- {boolean} whether this page is marked as outdated
- See:
- #isStub()
- Since:
- 1.25.0
- Throws:
- Error if the page is still a stub
- Returns:
- {boolean} true if this page is locked and false if not
- See:
- #isStub()
- Since:
- 1.16.1
- Throws:
- Error if the page is still a stub
- Returns:
- {boolean} whether this page is personalized
- See:
- #isStub()
- #addChipInstance()
- #removeChipInstance()
- #setLayout()
- #setTitle()
- Since:
- 1.32.0
- Throws:
- Error if the page is still a stub
- Returns:
- {boolean} true if this page is read-only
- See:
- #isStub()
- Since:
- 1.2.0
- Returns:
- {boolean} whether this page is still only a stub
- See:
- #load()
bPartially parameter). Notifies one of the given handlers. All CHIP instances
know their page, see sap.ui2.srvc.ChipInstance#getPage.
Note: Preferably, CHIP instances should be loaded individually as needed (e.g. as they become visible).
- Parameters:
- {function ()} fnSuccess
- no-args success handler
- {function (string|[object])} fnFailure Optional
- error handler taking an error message and, since version 1.28.6, an
optional object containing the complete error information as delivered
by the ODataService. See fnFailure parameter of sap.ui2.srvc.ODataWrapper#onError
for more details.
If not given
sap.ui2.srvc.ODataService#getDefaultErrorHandleris used - {boolean} bPartially Optional, Default: false
- whether to load the page only partially (instead of completely, including its CHIP instances)
- Since:
- 1.2.0
The done function will be called with a sap.ui2.srvc.Bag instance.
If there was no such bag an empty sap.ui2.srvc.Bag is passed.
- Parameters:
- {string} sBagId
- the bag ID
- Since:
- 1.11.0
- Returns:
- {object} jQuery.promise object
- Parameters:
- {function ()} fnSuccess
- no-args success handler
- {function (string|[object])} fnFailure Optional
- error handler taking an error message and, since version 1.28.6, an
optional object containing the complete error information as delivered
by the ODataService. See fnFailure parameter of sap.ui2.srvc.ODataWrapper#onError
for more details.
If not given
sap.ui2.srvc.ODataService#getDefaultErrorHandleris used
- Since:
- 1.2.0
remove() method and returns true.
If the given page CHIP instance does not belong to this page (any more), false
is returned and nothing else happens.
Can only be called if the page is not a stub anymore.
- Parameters:
- {sap.ui2.srvc.ChipInstance} oChipInstance
- the CHIP instance to remove from this page
- {function ()} fnSuccess Optional
- no-args success handler
- {function (string|[object])} fnFailure Optional
- error handler taking an error message and, since version 1.28.6, an
optional object containing the complete error information as delivered
by the ODataService. See fnFailure parameter of sap.ui2.srvc.ODataWrapper#onError
for more details.
If not given
sap.ui2.srvc.ODataService#getDefaultErrorHandleris used
- Since:
- 1.9.0
- Throws:
- Error if the page is still a stub
- Returns:
- {boolean}
trueiff. the given CHIP instance'sremove()method has been called
- Parameters:
- {string} sLayout
- the new layout
- {function ()} fnSuccess
- no-args success handler
- {function (string|[object])} fnFailure Optional
- error handler taking an error message and, since version 1.28.6, an
optional object containing the complete error information as delivered
by the ODataService. See fnFailure parameter of sap.ui2.srvc.ODataWrapper#onError
for more details.
If not given
sap.ui2.srvc.ODataService#getDefaultErrorHandleris used
- Since:
- 1.2.0
- Throws:
- Error if the page is still a stub
- See:
- #isStub()
- Parameters:
- {boolean} bIsPersLocked
- Desired locking status
- {function ()} fnSuccess
- no-args success handler
- {function (string|[object])} fnFailure Optional
- error handler taking an error message and, since version 1.28.6, an
optional object containing the complete error information as delivered
by the ODataService. See fnFailure parameter of sap.ui2.srvc.ODataWrapper#onError
for more details.
If not given
sap.ui2.srvc.ODataService#getDefaultErrorHandleris used
- Since:
- 1.25.0
- Throws:
- Error if the page is still a stub
- See:
- #isStub()
- Parameters:
- {string} sTitle
- the new title
- {function ()} fnSuccess
- no-args success handler
- {function (string|[object])} fnFailure Optional
- error handler taking an error message and, since version 1.28.6, an
optional object containing the complete error information as delivered
by the ODataService. See fnFailure parameter of sap.ui2.srvc.ODataWrapper#onError
for more details.
If not given
sap.ui2.srvc.ODataService#getDefaultErrorHandleris used
- Since:
- 1.2.0
- Throws:
- Error if the page is still a stub
- See:
- #getOriginalLanguage()
- #isStub()
- Parameters:
- {boolean} bVerbose Optional, Default: false
- flag whether to show all properties
- Since:
- 1.2.0
- Returns:
- {string} this page's string representation