Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8430

Binding Issue - sap.m.Dialog to buttons aggregation

$
0
0

Hi All,

 

I’m writing to you with a problem that’s annoying me since I found it and I cannot come up with a solution. So I was wondering, if someone can actually see the where the problem is hidden.

I'm somehow not able to bind the model to a factory function. Here you can find a very simple example of my problem.


This one works, but isn't what I'm actually looking for, since the aggregation should depend on the model:


var oDialog = new sap.m.Dialog({

title: '{i18n>sap.im.ui.datasource.browse.title}',

content: [

new sap.m.Text({

text: 'content'

})

    ],

    buttons: [

new sap.m.Button({

text: 'test1'

}),

new sap.m.Button({

text: 'test2'

})

    ]

});

oDialog.open();


This one never calls the factory (there's no aggregation at all):


var oDialog = new sap.m.Dialog({

    title: '{i18n>sap.im.ui.datasource.browse.title}',

    content: [

new sap.m.Text({

text: 'content'

})

    ],

    buttons: {

path: '/myPath',

factory: function (){

return [

new sap.m.Button({

text: 'test1'

}),

new sap.m.Button({

text: 'test2'

})

]

}

    }

});

oDialog.open();


And this one doesn't work either:


var oDialog = new sap.m.Dialog({

title: '{i18n>sap.im.ui.datasource.browse.title}',

content: [

new sap.m.Text({

text: 'content'

})

    ]

});

oDialog.bindAggregation('buttons', '/myPath', function(){console.log('res')});

 

oDialog.open();



Does anyone of you have an idea what's going on here?


Viewing all articles
Browse latest Browse all 8430

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>