cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 complex binding

0 Kudos

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

    Accepted Solutions (1)

    Accepted Solutions (1)

    former_member227918
    Active Contributor
    ,

    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

    Answers (0)