X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.slc.webapp%2Fsrc%2Fmain%2Fwebapp%2Fsource%2Fclass%2Forg%2Fargeo%2Fria%2Fcomponents%2FViewPane.js;h=e04970c4388420c54df81b805e1dcc7c55a6950b;hb=d71a4b12cc6f78a3fceeb620f539150e5835b511;hp=b56b5b1f63771e2aa140f1f55b6c0cf3055f404e;hpb=6155800a7f6279f3fbb76109ca54438743f14705;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/ria/components/ViewPane.js b/org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/ria/components/ViewPane.js index b56b5b1f6..e04970c43 100644 --- a/org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/ria/components/ViewPane.js +++ b/org.argeo.slc.webapp/src/main/webapp/source/class/org/argeo/ria/components/ViewPane.js @@ -53,7 +53,16 @@ qx.Class.define("org.argeo.ria.components.ViewPane", * Map of commands definition * @see org.argeo.ria.event.Command */ - commands : {init : null, nullable:true, check:"Map"} + commands : {init : null, nullable:true, check:"Map"}, + /** + * The real business content. + */ + content : { + init: null, + nullable : true, + check : "org.argeo.ria.components.IView", + apply : "_applyContent" + } }, /* @@ -122,18 +131,19 @@ qx.Class.define("org.argeo.ria.components.ViewPane", * Sets the content of this pane. * @param content {org.argeo.ria.components.IView} An IView implementation */ - setContent : function(content){ + _applyContent : function(content){ + if(content == null) return; var addScrollable = (content.addScroll?content.addScroll():false); if(addScrollable){ this.setOwnScrollable(true); this.scrollable = new qx.ui.container.Scroll(content); this.add(this.scrollable, {flex: 1}); }else{ - this.content = content; - this.add(this.content, {flex:1}); + this.guiContent = content; + this.add(this.guiContent, {flex:1}); } }, - + addHeaderComponent : function(component){ this.header.setPadding(4); this.header.add(component, {edge:"center"}); @@ -159,14 +169,15 @@ qx.Class.define("org.argeo.ria.components.ViewPane", empty: function(){ if(this.getOwnScrollable() && this.scrollable){ this.remove(this.scrollable); - }else if(this.content){ - this.remove(this.content); + }else if(this.guiContent){ + this.remove(this.guiContent); } if(this.getCommands()){ org.argeo.ria.event.CommandsManager.getInstance().removeCommands(this.getCommands()); this.setCommands(null); } this.setViewTitle(this._defaultViewTitle); + this.setContent(null); } }