Skip to Content

SAPUI5 complex binding

Hi all,

I face a binding problem, means no data is shown. My view contains a sap.m.table. One of the columns is type of sap.m.MultiComboBox and defined this way

var selectOwners= new sap.m.MultiComboBox("ownersTmpl-Group",{ selectedKeys: "{table>owner_id}", enabled: "{table>edit}", templateShareable : true, items:{ path:'table>owner_name', templateShareable: true, template: new sap.ui.core.Item({ key: "{id}", text: "{short} ( {long} )" }) } });

the model instance "table" is is type of json containg an array of object entries of this structure

  1. as_rights:true
  2. id:144
  3. is_owner:true
  4. member_id:Array[1]
    1. 0:95
    2. length:1
    3. __proto__:Array[0]
  5. member_name:Array[1]
    1. 0:Object
    1. id:95
    2. long:"Peter Ruppert"
    3. short:"d039587"
    4. __proto__:Object
  6. length:1
  7. __proto__:Array[0]
  • name:"analysis.aad_maint"
  • owner_id:Array[1]
    1. 0:95
    2. length:1
    3. __proto__:Array[0]
  • owner_name:Array[1]
    1. 0:Object
    1. id:95
    2. long:"Peter Ruppert"
    3. short:"d039587"
    4. __proto__:Object
  • length:1
  • __proto__:Array[0]
  • __proto__:Object
  • Obviously the binding is wrong since the entries of the drop down box are existing but containing no text.

    How solve this?

    Any help is appreciated.

    best regards

    Wolfgang

    Add comment
    10|10000 characters needed characters exceeded

    • Get RSS Feed

    1 Answer

    • Best Answer
      Oct 18, 2016 at 11:47 AM
      ,

      try this,

      var selectOwners = new sap.m.MultiComboBox("ownersTmpl-Group", {
          selectedKeys: "{table>owner_id}",
          enabled: "{table>edit}",
          templateShareable: true,
          items: {
              path: 'table>owner_name',
              templateShareable: true,
              template: new sap.ui.core.Item({
                  key: "{table>id}",
                  text: "{table>short} ( {table>long} )"
              })
          }
      });

      Regards,

      Akhilesh

      Add comment
      10|10000 characters needed characters exceeded