data binding - SAPUI5 / OpenUI5 Databinding for Custom Controls -


i'm working sapui5 , openui5. i'ved developed custom controls never used 2-way databinding controls...i've tried

omycontrol.bindproperty("somevalue", "omodel>/testbindingvalue")

what i've seen is: when watching model in debugger field abindings have 1 entry:

spath: "/testbindingvalue"  sinternaltype: "int" 

and correct sinternaltype of controls property type (in case "int").

but when i'm watching array omodel.odata empty , omodel.getproperty("/testbindingvalue") returning undefined...but control has value "somevalue"...so, have idea?

thanks, alex

update:

here see workflow:

first creating model:

    var omodel = new sap.ui.model.json.jsonmodel();     sap.ui.getcore().setmodel(omodel, 'omodel'); 

then initializing control:

var omycontrol = new mycontrol({     somevalue: "test value of control" }); omycontrol.bindproperty("somevalue", "omodel>/testvalue"); 

now, when i'm doing:

alert(omodel.getproperty("/testvalue")); 

i "undefined".

so, normal controls working, "value", "text", "visible" or "enabled" , on..

i'm guessing there in custom control making not work correctly. have created example of understand doing (http://jsbin.com/kiwoza/2/edit?html,console,output) , seems work i'd expect. if example somehow different you're trying accomplish please update question details why it's not quite right.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -