1. Sebastian Sdorra
  2. scm-manager

Commits

Sebastian Sdorra  committed 434a46c

added afterrender listener to Sonia.rest.EditForm for setting focus

  • Participants
  • Parent commits f107d44
  • Branches default

Comments (0)

Files changed (3)

File scm-webapp/src/main/webapp/resources/js/sonia.group.js

View file
 
     var config = {
       title: 'Edit Group',
-      listeners: {
-        afterrender: function(){
-          if ( ! update ){
-            Ext.getCmp('nameField').focus(true, 500);
-          }
-        }
-      },
+      focusField: 'groupName',
       items:[{
-        id: 'nameField',
+        id: 'groupName',
         fieldLabel:'Name',
         name:'name',
         anchor: '100%',

File scm-webapp/src/main/webapp/resources/js/sonia.repository.js

View file
 
     var config = {
       title: 'Edit Repository',
+      focusField: 'repositoryName',
       items:[
-        {fieldLabel: 'Name', name: 'name', readOnly: update, allowBlank: false},
+        { id: 'repositoryName', fieldLabel: 'Name', name: 'name', readOnly: update, allowBlank: false},
         {
          fieldLabel: 'Type',
          name: 'type',

File scm-webapp/src/main/webapp/resources/js/sonia.rest.js

View file
 
   title: 'Edit REST',
   data: null,
+  focusField: null,
   
   initComponent: function(){
 
       defaultType:'textfield',
       monitorValid: true,
       defaults: {width: 190},
+      listeners: {
+        afterrender: {
+          fn: function(){
+            if ( this.focusField != null && this.data == null ){
+              Ext.getCmp(this.focusField).focus(true, 500);
+            }
+          },
+          scope: this
+        }
+      },
       buttons:[
         {text: 'Ok', formBind: true, scope: this, handler: this.submit},
         {text: 'Cancel', scope: this, handler: this.cancel}