Skip to Content
0

SAPUI5 complex binding

Oct 18, 2016 at 08:46 AM

136

avatar image

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

    10 |10000 characters needed characters left characters exceeded
    * Please Login or Register to Answer, Follow or Comment.

    1 Answer

    Best Answer
    Akhilesh Upadhyay Oct 18, 2016 at 11:47 AM
    0
    ,

    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

    Share
    10 |10000 characters needed characters left characters exceeded