on 06-18-2021 7:09 AM
Hi Imen,
Please, try below solution.
In "onSelectTab" method in controller, add below code:
var key = oEvent.getSource().getSelectedKey();
if(key === "key1"){
this.getRouter().getTargets().display("subview1");
}
else if(key === "key2"){
this.getRouter().getTargets().display("subview2");
}
else{
this.getRouter().getTargets().display("subview3");
}
Make sure to add key attribute to <IconTabFilter>.
manifest.json:
Add below code in targets section
"targets": {
"TargetView1": {
"viewType": "XML",
"transition": "slide",
"clearControlAggregation": false,
"viewId": "MainView",
"viewName": "MainView",
"viewLevel": 1
},
"subview1": {
"viewType": "XML",
"viewId": "subView1",
"viewName": "View1",
"clearControlAggregation": false,
"parent": "TargetView1",
"controlId": "page"
"controlAggregation": "content"
"viewLevel": 2
},
"subview2": {
"viewType": "XML",
"viewName": "View2",
"parent": "TargetView1",
"controlId": "page"
"controlAggregation": "content"
"viewLevel": 2
},
"subview3": {
"viewType": "XML",
"viewName": "View3",
"viewId": "subView3",
"clearControlAggregation": false,
"parent": "TargetView1",
"controlId": "page"
"controlAggregation": "content"
"viewLevel": 2
}
}
In manifest, we specified that parent View would be TargetView1 and controlid is "page" and controlAggregation is "content". Now, when the user selects a tab controller searches for the control with ID "page" and <content> control inside it.
Please, keep in mind that Toolheader view should not contain Page or pages control as this would overlap the subviews. Also, You need to clear the contents of the subView container control as we are loading different views each time user any tab. to do this you can either set "clearControlAggregation": true in manifest file or clear the contents manually in mainView's controller.
Regards,
Venkatesh.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
74 | |
8 | |
8 | |
8 | |
7 | |
6 | |
5 | |
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.