i'm working in a project on a master/detail template, i created a button in my Master.view.xml, i'm still new to SAPUI5 and SAP Web IDE developement, when i click the button nothing happens actually, even thought when i debugg on chrome, i find no errors,here is my Master.view.xml
<sap.ui.layout:content>
<Button text="Ajouter" enabled="{appView>/addEnabled}" width="100px" id="addButton" icon="sap-icon://add" press="onAdd" activeIcon="sap-icon://accept"/>
</sap.ui.layout:content>
this is my Master Controller Method:
onAdd : function(){
this.getRouter().getTargets().display("create");
},
this is my Component.js routing
routing: {
config: {
routerClass: com.emi.MyRouter,
viewType: "XML",
viewPath: "com.emi.view",
targetAggregation: "detailPages",
// controlId: "idAppControl",
// targetControl: "idAppControl",
controlAggregation: "detailPages",
clearTarget: false
},
routes: [
{
pattern: "",
name: "main",
view: "Master",
targetAggregation: "masterPages",
targetControl: "idAppControl",
subroutes: [
{
pattern: "{entity}/:tab:",
name: "detail",
view: "Detail"
}
, {
pattern: "{entity}/:tab:/{item}",
name: "userDetails",
view: "UserDetails"
},
{
pattern: "create",
name: "createEntity",
view: "CreateEntity",
target: "create"
}
]
},
{
name: "catchallMaster",
view: "Master",
targetAggregation: "masterPages",
targetControl: "idAppControl",
subroutes: [
{
pattern: ":all*:",
name: "catchallDetail",
view: "NotFound",
transition: "show"
}
]
}
],
targets: {
master: {
viewName: "Master",
viewLevel: 1,
viewId: "master",
controlAggregation: "masterPages"
// controlId: "idAppControl"
},
object: {
viewName: "Detail",
viewId: "detail",
viewLevel: 2
},
create: {
// viewPath: "sap.ui.com.emi.view.CreateEntity",
viewName: "CreateEntity",
targetAggregation: "pages",
viewLevel: 1,
controlAggregation: "detailPages",
transition: "show",
controlId:"idAppControl"
}
}
}
},
and finaly this is my oninit method, in CreateEntity.Controller.js
onInit: function() {
var oRouter, oTarget;
oRouter = this.getRouter();
oTarget = oRouter.getTargets().getTarget("create");
},
but when i click the button, nothing happens, and when i debugg code i find there are no errors, which means my view is there but not displayed. i doubt there is a problem in my oninit function, can u help me please ? Thank YOU