I have a problem in dealing with the XML model, I can't retrieve the model data in the XML view and I can't get any property from the controller.
Here is the XML document retrieved from the URL:
<GetUsersResponsexmlns="http://tempuri.org/">
</GetUsersResponse>
Here is the Code:
var oModel=new sap.ui.model.xml.XMLModel();
var aData = jQuery.ajax({
type : "GET",
contentType : "text/xml; charset=\"utf-8\"",
url : "http://localhost:8745/UsersService/users",
dataType : "text",
async: false,
success : function(data,textStatus, jqXHR) {
oModel.setXML(data);
}
});
The XML was set to the Model correctly but I can't deal with it I also used oModel.loadData("http://localhost:8745/UsersService/users","",false); but it didn't work. I was trying to get a property using oModel.getProperty("/User/Name"); also tried "/User/Name/text()" but neither of them worked.
I tried to bind the model data in to a list in the XML view using the following code:
<List id="list" mode="{device>/listMode}" select="handleListSelect" items="{/User}" >
<ObjectListItem type="{device>/listItemType}" press="handleListItemPress" title="{Name}" >
</ObjectListItem>
</List>
I also tried "{Name/text()}", but also it didn't worked for me.
I would be grateful if anyone could help me to get this done.
Regards,
Ahmed ElManawy,