class sap.ui.model.xml.XMLModel

Control sample: sap.ui.model.xml.XMLModel
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/model/xml/XMLModel
Application Component: CA-UI5-COR

Model implementation for the XML format.

This model is not prepared to be inherited from.


Constructor

Constructor for a new XMLModel.

new sap.ui.model.xml.XMLModel(oData)
Param Type Default Value Description
oData object

either the URL where to load the XML from or an XML


Methods Overview

Method Description
sap.ui.model.xml.XMLModel.extend

Creates a new subclass of class sap.ui.model.xml.XMLModel 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.model.ClientModel.extend.

sap.ui.model.xml.XMLModel.getMetadata

Returns a metadata object for class sap.ui.model.xml.XMLModel.

getObject

Returns the object for the given path and context.

getProperty

Returns the value for the property with the given sPropertyName.

getXML

Serializes the current XML data of the model into a string.

loadData

Load XML-encoded data from the server using a GET HTTP request and store the resulting XML data in the model. Note: Due to browser security restrictions, most "Ajax" requests are subject to the same origin policy, the request can not successfully retrieve data from a different domain, subdomain, or protocol.

setData

Sets the provided XML encoded data object to the model

setNameSpace

Sets an XML namespace to use in the binding path

setProperty

Sets a new value for the given property sPropertyName in the model. If the model value changed all interested parties are informed.

setXML

Sets the specified XML formatted string text to the model

sap.ui.model.xml.XMLModel.extend

Creates a new subclass of class sap.ui.model.xml.XMLModel 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.model.ClientModel.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

sap.ui.model.xml.XMLModel.getMetadata

Returns a metadata object for class sap.ui.model.xml.XMLModel.

getObject

Returns the object for the given path and context.

Param Type DefaultValue Description
sPath string

The path to the object

oContext object

The context which will be used to retrieve the object

getProperty

Returns the value for the property with the given sPropertyName.

Param Type DefaultValue Description
sPath string

The path to the property

oContext object

The context which will be used to retrieve the property

getXML

Serializes the current XML data of the model into a string.

loadData

Load XML-encoded data from the server using a GET HTTP request and store the resulting XML data in the model. Note: Due to browser security restrictions, most "Ajax" requests are subject to the same origin policy, the request can not successfully retrieve data from a different domain, subdomain, or protocol.

Param Type DefaultValue Description
sURL string

A string containing the URL to which the request is sent

oParameters object string

A map of parameters or a single parameter string that is sent to the server with the request

bAsync boolean true

By default, all requests are sent asynchronous. Do not use bAsync=false because synchronous requests may temporarily lock the browser, disabling any actions while the request is active. Cross-domain requests do not support synchronous operation.

sType string GET

HTTP method of request

bCache string false

Force no caching if false

mHeaders object

An object of additional header key/value pairs to send along with the request

setData

Sets the provided XML encoded data object to the model

Param Type DefaultValue Description
oData object

the data to set to the model

setNameSpace

Sets an XML namespace to use in the binding path

Param Type DefaultValue Description
sNameSpace string

The namespace URI

sPrefix string

The prefix for the namespace

setProperty

Sets a new value for the given property sPropertyName in the model. If the model value changed all interested parties are informed.

Param Type DefaultValue Description
sPath string

Path of the property to set

oValue any

Value to set the property to

oContext object

The context which will be used to set the property

bAsyncUpdate boolean

Whether to update other bindings dependent on this property asynchronously

setXML

Sets the specified XML formatted string text to the model

Param Type DefaultValue Description
sXMLText string

the XML data as string