Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SAPUI - XML View - complex type information


I have some issues to express my type information in XML views.

The JS view would look like:

new sap.m.Text({

     text: {


          type: new sap.ui.model.type.Integer({groupingEnabled: true, groupingSeparator: '.'})



My current XML view looks like this:

<Text text="{path:'/number', type:'sap.ui.model.type.Integer', constraints:{groupingEnabled: true, groupingSeparator: '.'}}" />


<Text text="{path:'/number', type:'sap.ui.model.type.Integer({groupingEnabled: true, groupingSeparator: '.'})'}" />

or several other ideas, e.g. escpaing of the additional '.

But nothing worked. And I could not find any documentation of how it might work.

The diagnostic tool translates JS to XML, yes, but it ignores the complicated case. :-(

I could use a formatter to group myself, but there are several cases, where I need such complicated XML views.

E.g. if I want to use multiply paths as an array.

In my index.html I added data-sap-ui-xx-bindingSyntax="complex".

Hope you can help me out.

Thanks and bests



Hi Ben,

          This should work

<!DOCTYPE html>


  <meta http-equiv='X-UA-Compatible' content='IE=edge' />

  <meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>

  <title>Mobile App with XML View with JSON Data</title>

<script id='sap-ui-bootstrap' type='text/javascript'





  <script id="myXml" type="text/xmldata">

   <mvc:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" controllerName="myController" displayBlock="true">


  <Page title="Hello">

  <Text text="{path:'/1/r', type:'sap.ui.model.type.Integer', formatOptions:{groupingEnabled: true , groupingSeperator : '.'}}" />

  <Button text="{/1/name}" press= "doSomething"/>






  sap.ui.controller("myController", {

  onInit: function() {

  var model = new sap.ui.model.json.JSONModel();


  {lastName: "Dente", name: "Al", r  : 1232323.221212,checked: true, linkText: "", href: "", rating: 4},

  {lastName: "Friese", name: "Andy", r  : 111222.221212, checked: true, linkText: "", href: "", rating: 2},

  {lastName: "Mann", name: "Anita",  r  : 1.221212,checked: false, linkText: "", href: "", rating: 3}




  doSomething: function() {

  alert("Hello World!");



  sap.ui.view({ viewContent: jQuery('#myXml').html(), type:sap.ui.core.mvc.ViewType.XML }).placeAt("content")



   <body class='sapUiBody'>

   <div id='content'></div>



Thank you.



0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question