binding - SAPUI5: Example for a composit control? -


I'm looking for a good example of a composit control. My current problem is that I have a simple value (for example A string) that will be reused in another control within a joint control.

The following code does not look right:

metadata: {properties: {"head": {type: "string", defaultValue: ""}, ... },} Init: function () {... some control with content ... content: [new sap.m.Label ({text: this.getHead ()})] ...

My Composite Control plan looks like this: var oTemplate = New MyControl ({Head: "{Name}"}); For example, use the template in the list.

Another experiment (which will not work):

  jQuery.sap.declare ("StrangeControl"); Sap.m.HBox.extend ("StrangeControl", {Metadata: {Properties: {}, Aggregation: {Input: {type: "sap.m.Input", Multiple: Incorrect},}}, // will be called Init: Work () {sap.m.HBox.prototype.init.call (this); this.addItem (this.getAregregation ("Input"));}, Renderer: {}, Paradox: function during construction time ( ) {If (sap.m.HBox.prototype.onAfterRendering! == Undefined) {sap.m.HBox.prototype.onAfterRendering.call (this);}}});  

I imagine the use of control in this way:

  new weird control ({input: new sap.m.Input ({value: "Test"}}}  

but not defined during init input ( == null ). For example, "item" seems to be handled in a different way, but it is not clear how.

"post-text" itemprop = "text"> < P> A: Just add your internal controls to the Hidden Aggregation - it's automatic You will get all the data binding, you have to pair the properties of that control accordingly.

B: You can also override your external control's setters, which are then the values To promote, call the internal control satellites.

  setHead: function (oValue) {return.getAregregation ("myHiddenInnerControl") .setValue (oValue);}  < / Pre> 

To control the memory leak, control the internal control in one control. For Dne is still required (and you need to make sure that everything is clean exhaust method.


Comments