on 02-12-2014 10:51 AM
I am trying to a component on ComponentContainer but just cant get it to work...
The following code works well with no errors but I can only see the two buttons in the display and not the ComponentContainer
Please help.
Code:
sap.ui.commons.layout.HorizontalLayout.extend("customcontrols.MyContainer", {
metadata : {
properties : {
"value" : "string"
},
aggregations: {
"_btn" : {type : "sap.ui.commons.Button", multiple : false, visibility: "hidden"},
"_btn2" : {type : "sap.ui.commons.Button", multiple : false, visibility: "hidden"},
"_sourceComponent": {type : "sap.ui.core.ComponentContainer", multiple : false, visibility: "hidden"}
},
events: {
"search" : {}
}
},
init: function() {
this.setAggregation("_btn", new sap.ui.commons.Button({
text: "Search",
press: function(){
//that.fireSearch();
}
}));
this.setAggregation("_btn2", new sap.ui.commons.Button({
text: "Search",
press: function(){
// that.fireSearch();
}
}));
this.setAggregation("_sourceComponent", new sap.ui.core.ComponentContainer({
id : "id", // sap.ui.core.ID
name : undefined, // string
url : undefined, // sap.ui.core.URI
settings : undefined, // object
propagateModel : false, // boolean
width : undefined, // sap.ui.core.CSSSize
height : undefined, // sap.ui.core.CSSSize
tooltip : undefined, // sap.ui.core.TooltipBase
customData : [ new sap.ui.core.CustomData({
id : "id1", // sap.ui.core.ID
key : undefined, // string
value : undefined, // any
writeToDom : false, // boolean, since 1.9.0
tooltip : undefined, // sap.ui.core.TooltipBase
customData : []
// sap.ui.core.CustomData
}) ], // sap.ui.core.CustomData
//component : undefined
// sap.ui.core.UIComponent
}));
var oButton = new sap.ui.commons.Button({
text: "Amjad",
press: function(){
//that.fireSearch();
}
});
var _sourceComponent = this.getAggregation("_sourceComponent");
_sourceComponent.setComponent(oButton);
},
setValue: function(sValue){
this.setProperty("value", sValue, true);
this.getAggregation("_tf").setValue(sValue);
return this;
},
renderer : function(oRm, oControl) {
oRm.write("<div");
oRm.writeControlData(oControl);
oRm.addClass("mySearchField");
oRm.writeClasses();
oRm.write(">");
oRm.renderControl(oControl.getAggregation("_btn2"));
oRm.renderControl(oControl.getAggregation("_btn2"));
oRm.renderControl(oControl.getAggregation("_sourceComponent"));
oRm.write("</div>");
}
});
No body?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am trying to set* a component
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.