diff options
author | Beat Schwarzentrub | 2019-04-26 12:35:46 +0000 |
---|---|---|
committer | Beat Schwarzentrub | 2019-04-26 12:35:46 +0000 |
commit | f3f8063e1f8f318fe56838208f5035ce3d571a96 (patch) | |
tree | d3e764edc47cce7542d535cc633b3f905cbc9a17 | |
parent | 8a51cf453f1111f14e5fd135cb95485096328a45 (diff) | |
download | org.eclipse.scout.rt-features/bschwarzent/destroy_page.tar.gz org.eclipse.scout.rt-features/bschwarzent/destroy_page.tar.xz org.eclipse.scout.rt-features/bschwarzent/destroy_page.zip |
Page: destroy detail table and detail form when page is destroyedfeatures/bschwarzent/destroy_page
243657
Change-Id: I53ab1e6ec4f28495592587bd1d4b5b0e952f3ee7
5 files changed, 22 insertions, 16 deletions
diff --git a/org.eclipse.scout.rt.ui.html/src/main/js/scout/desktop/outline/pages/Page.js b/org.eclipse.scout.rt.ui.html/src/main/js/scout/desktop/outline/pages/Page.js index d6d7ab2d3a..25b8f223d9 100644 --- a/org.eclipse.scout.rt.ui.html/src/main/js/scout/desktop/outline/pages/Page.js +++ b/org.eclipse.scout.rt.ui.html/src/main/js/scout/desktop/outline/pages/Page.js @@ -77,6 +77,19 @@ scout.Page.prototype._init = function(model) { this._internalInitDetailForm(); }; +/** + * @override TreeNode.js + */ +scout.Page.prototype._destroy = function() { + scout.Page.parent.prototype._destroy.call(this); + if (this.detailTable) { + this.detailTable.destroy(); + } + if (this.detailForm) { + this.detailForm.destroy(); + } +}; + scout.Page.prototype._internalInitTable = function() { var table = this.detailTable; if (table) { diff --git a/org.eclipse.scout.rt.ui.html/src/main/js/scout/desktop/outline/pages/PageWithNodes.js b/org.eclipse.scout.rt.ui.html/src/main/js/scout/desktop/outline/pages/PageWithNodes.js index 007dfe771d..5317a3786b 100644 --- a/org.eclipse.scout.rt.ui.html/src/main/js/scout/desktop/outline/pages/PageWithNodes.js +++ b/org.eclipse.scout.rt.ui.html/src/main/js/scout/desktop/outline/pages/PageWithNodes.js @@ -39,9 +39,7 @@ scout.PageWithNodes.prototype._createTable = function() { }; scout.PageWithNodes.prototype._onDetailTableRowAction = function(event) { - var clickedRow = event.source.rowsMap[event.row.id]; - var nodeToSelect = clickedRow.node; - this.getOutline().selectNode(nodeToSelect); + this.getOutline().mediator.onTableRowAction(event, this); }; scout.PageWithNodes.prototype._rebuildDetailTable = function(childPages) { diff --git a/org.eclipse.scout.rt.ui.html/src/main/js/scout/desktop/outline/pages/PageWithTable.js b/org.eclipse.scout.rt.ui.html/src/main/js/scout/desktop/outline/pages/PageWithTable.js index b7fe6bda53..5a89b2aaad 100644 --- a/org.eclipse.scout.rt.ui.html/src/main/js/scout/desktop/outline/pages/PageWithTable.js +++ b/org.eclipse.scout.rt.ui.html/src/main/js/scout/desktop/outline/pages/PageWithTable.js @@ -178,7 +178,12 @@ scout.PageWithTable.prototype._onLoadTableDataFail = function(error) { this.detailTable.setTableStatus(scout.Status.error({ message: this.session.text('ErrorWhileLoadingData') })); - $.log.error('Failed to load tableData. error=', error); + + var handler = scout.create('ErrorHandler', { + displayError: false + }); + handler.handle(error); + handler.handle('Failed to load tableData, see previous error for details'); }; scout.PageWithTable.prototype._onLoadTableDataAlways = function() { diff --git a/org.eclipse.scout.rt.ui.html/src/main/js/scout/router/Route.js b/org.eclipse.scout.rt.ui.html/src/main/js/scout/router/Route.js index 3bd07d0a58..b3e976bf53 100644 --- a/org.eclipse.scout.rt.ui.html/src/main/js/scout/router/Route.js +++ b/org.eclipse.scout.rt.ui.html/src/main/js/scout/router/Route.js @@ -36,5 +36,4 @@ scout.Route.prototype.activate = function(location) { * to perform clean-up operations. */ scout.Route.prototype.deactivate = function() { - }; diff --git a/org.eclipse.scout.rt.ui.html/src/main/js/scout/router/router.js b/org.eclipse.scout.rt.ui.html/src/main/js/scout/router/router.js index ace9953788..ff7937803d 100644 --- a/org.eclipse.scout.rt.ui.html/src/main/js/scout/router/router.js +++ b/org.eclipse.scout.rt.ui.html/src/main/js/scout/router/router.js @@ -37,16 +37,7 @@ scout.router = { }, activate: function(location) { - if (!location) { - var regexp = new RegExp('[^/]*$'); // match everything after last slash - var matches = regexp.exec(document.location.href); - location = matches[0]; - } - - // no route is set in the URL - if (scout.strings.empty(location) || '/' === location) { - location = this.defaultLocation; - } + location = location || (window.location.hash || '') || this.defaultLocation; var i, route = null; for (i = 0; i < this.routes.length; i++) { @@ -100,6 +91,6 @@ scout.router = { }; window.addEventListener('popstate', function(event) { - scout.router.activate(null); + scout.router.activate(); return false; }); |