CoWorker Nature
[lgpl/argeo-commons.git] / security / runtime / org.argeo.security.ria / src / argeo-ria-lib / security / class / org / argeo / security / ria / UserEditorApplet.js
index 29d8aa0fedf7deb08fdbaa262ae0d27abfc4c6bd..772cf2e7fc18deb8ec57ce34581573a1c0d38225 100644 (file)
@@ -84,7 +84,10 @@ qx.Class.define("org.argeo.security.ria.UserEditorApplet",
                
        },
        instanceId : {init:""},
-       instanceLabel : {init:"Editor"}         
+       instanceLabel : {init:"Editor"},
+       loaded : {
+               init : false
+       }
   },
 
   members :
@@ -144,12 +147,19 @@ qx.Class.define("org.argeo.security.ria.UserEditorApplet",
                this.passGB.add(this.passPane.getContainer());
                
                this.naturesTab = new qx.ui.tabview.TabView("top");
-               this.simpleNature = new org.argeo.security.ria.components.SimpleUserNatureImpl();
                
+               this.simpleNature = new org.argeo.security.ria.components.SimpleUserNatureImpl();               
                var page1 = new qx.ui.tabview.Page(this.simpleNature.getNatureLabel());
                page1.setLayout(new qx.ui.layout.Dock());
                page1.add(this.simpleNature.getContainer(), {edge:"center"});
                this.naturesTab.add(page1);
+               
+               this.coWorkerNature = new org.argeo.security.ria.components.CoworkerNatureImpl();               
+               var page2 = new qx.ui.tabview.Page(this.coWorkerNature.getNatureLabel());
+               page2.setLayout(new qx.ui.layout.Dock());
+               page2.add(this.coWorkerNature.getContainer(), {edge:"center"});
+               this.naturesTab.add(page2);
+               
                this.naturesGB.add(this.naturesTab, {edge:"center"});
                                        
        },
@@ -167,6 +177,9 @@ qx.Class.define("org.argeo.security.ria.UserEditorApplet",
                this.simpleNature.addListener("modified", function(){
                        this.setModified(true);
                }, this);               
+               this.coWorkerNature.addListener("modified", function(){
+                       this.setModified(true);
+               }, this);               
        },
        
        _initializeGroupBox: function(groupBox){
@@ -183,6 +196,9 @@ qx.Class.define("org.argeo.security.ria.UserEditorApplet",
         * @param data {Element} The text xml description. 
         */
        load : function(userData){
+               if(this.getLoaded()){
+                       return;
+               }
                if(userData){
                        this.usernameField.setValue(userData);
                }
@@ -197,6 +213,7 @@ qx.Class.define("org.argeo.security.ria.UserEditorApplet",
                var button2 = new qx.ui.form.Button("Close", "org.argeo.security.ria/window-close.png", commands["close"].command);             
                this.buttonGB.add(button);
                this.buttonGB.add(button2);
+               this.setLoaded(true);
                
        },