diff --git a/tutorials/webgui/panel/server.cxx b/tutorials/webgui/panel/server.cxx index 33548bd3fa761135adcd350630758222396b11fd..1731ec78cebb398fca74fae25bf9e1adc0ad3956 100644 --- a/tutorials/webgui/panel/server.cxx +++ b/tutorials/webgui/panel/server.cxx @@ -74,10 +74,15 @@ void server() window = ROOT::Experimental::RWebWindow::Create(); // Important - defines name of openui5 widget - // "localapp" prefix indicates that all files located in current directory + // "localapp" prefix will be point on current directory, where script executed // "localapp.view.TestPanel" means file ./view/TestPanel.view.xml will be loaded window->SetPanelName("localapp.view.TestPanel"); + // Provide window client version to control browser cache + // When value changed, URL for JSROOT, UI5 and local files will differ + // Therefore web browser automatically reload all these files + // window->SetClientVersion("1.2"); + // these are different callbacks window->SetCallBacks(ProcessConnection, ProcessData, ProcessCloseConnection); diff --git a/ui5/panel/panel.html b/ui5/panel/panel.html index 7721d98f18cef2a59baf4b9a5de384ba55f31ebc..e6680d6562e65e7868e1e7dfb51d84aed933ec3f 100644 --- a/ui5/panel/panel.html +++ b/ui5/panel/panel.html @@ -7,7 +7,7 @@ <title>ROOT7 web panel</title> <script type="text/javascript" src="jsrootsys/scripts/JSRootCore.js"></script> </head> - + <style> html { height: 100%; } body { min-height: 100%; margin: 0; overflow: hidden } @@ -26,26 +26,30 @@ loading scripts... </div> </body> - + <script type='text/javascript'> function ShowOpenui5Panel(panel_handle, arg) { - + if (!panel_handle || !arg.first_msg || !sap) return false; - + var panelid = "TopPanelId"; - + var viewName = arg.first_msg; - + if ((viewName.indexOf("rootui5.") !== 0) && (viewName.indexOf("jsroot.") !== 0) && (viewName.indexOf("sap.") !== 0)) { var p = viewName.indexOf("."); if ((p > 1) && (p < viewName.length - 1)) { - console.log('Register module path', viewName.substr(0,p)); - var _paths = {}; _paths[viewName.substr(0,p)] = "/currentdir/"; + var tgtpath = "/currentdir/"; + var pp = JSROOT.source_dir.indexOf("/jsrootsys/"); + if (pp>0) tgtpath = JSROOT.source_dir.substr(0,pp) + "currentdir/"; + var _paths = {}; + _paths[viewName.substr(0,p)] = tgtpath; + console.log('Register module path', viewName.substr(0,p), ' as ', tgtpath); sap.ui.loader.config({ paths: _paths }); } } - + sap.ui.require(["sap/ui/core/mvc/XMLView"], function(XMLView) { XMLView.create({ id: panelid, @@ -57,7 +61,7 @@ }); } - + JSROOT.ConnectWebWindow({ prereq_logdiv: "PanelDiv", // openui5src: "jsroot",