on ‎2015 Jul 01 4:20 AM
In SAPUI5 demokit, I found there is a full screen button for chartContainer. Also in a explored example, the detail header has a full screen button as well.
I would like to implement such a full screen button in header of my detail view. But How to implement it?
thanks,
Yang
Request clarification before answering.
Here is what I do to implement a FullScreen button:
this._fullScreen = false;
this._oFullScreenButton = new sap.m.Button({
icon: "sap-icon://full-screen",
type: sap.m.ButtonType.Transparent,
press: jQuery.proxy(this.toggleFullScreen, this)
});
// Add the fullScreen toggle button to view custom header
this.getView().byId("pageS3").getCustomHeader().addContentRight(this._oFullScreenButton);
toggleFullScreen: function() {
if (this._fullScreen) {
this._closeFullScreen();
this._fullScreen = false;
} else {
this._openFullScreen();
this._fullScreen = true;
}
var sIcon = (this._fullScreen ? "sap-icon://exit-full-screen" : "sap-icon://full-screen");
this._oFullScreenButton.setIcon(sIcon);
},
_openFullScreen: function() {
var s2Controller = this.oApplicationFacade.getApplicationModel("sharedData").getData().s2Controller;
var masterPage = s2Controller.byId("page").getParent().getParent().$();
masterPage.css({
display: "none"
});
},
_closeFullScreen: function() {
var s2Controller = this.oApplicationFacade.getApplicationModel("sharedData").getData().s2Controller;
var masterPage = s2Controller.byId("page").getParent().getParent().$();
masterPage.css({
display: ""
});
},
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I needed to implement the same toggle full screen button in my project, Maksim Rashchynski's answer helped me figure out a simpler way if anyone's interested:
button in XML view
<Button id="btnFullScreen" icon="sap-icon://full-screen" tooltip="Show in full screen mode" press="toggleFullScreen" />
function in controller
toggleFullScreen : function(oEvent) {
var id = oEvent.getSource().sId;
var cid = this.getView().byId(id);
var spapp = sap.ui.getCore().byId('appId');
if(spapp.getMode() == "ShowHideMode"){
spapp.setMode('HideMode');
cid.setIcon('sap-icon://exit-full-screen').setTooltip('Show in full screen mode');
}else{
spapp.setMode('ShowHideMode');
cid.setIcon('sap-icon://full-screen').setTooltip('Exit from full screen mode');
}
},
Ty.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Or put this in a simple way - how to implement a fullscreen toggle for a view, like detail view
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Yang,
in your example, the property showFullScreen seems to be specific to sap.suite.ui.commons.sample.ChartContainer.
I suppose you use a sap.m.SplitApp as you referred to a detail view which you want to display full screen. So one option for you would be implementing a button which toggles your SplitApp. See SAPUI5 SDK - Demo Kit - Split App for methods you can use.
You could use hideMaster() and showMaster() to toggle.
Regards
Dominik
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.