From: <b_c...@us...> - 2011-11-19 21:28:03
|
Revision: 5737 http://jaffa.svn.sourceforge.net/jaffa/?rev=5737&view=rev Author: b_calderwood Date: 2011-11-19 21:27:57 +0000 (Sat, 19 Nov 2011) Log Message: ----------- If duplicate key is found and record uses a multi field key, then reset the value on the field that caused the duplicate key error. This makes it easier for the user to leave the field and change any of the key field values. Modified Paths: -------------- trunk/JaffaRIA/source/html/js/extjs/jaffa/maintenance/plugins/Panel.js Modified: trunk/JaffaRIA/source/html/js/extjs/jaffa/maintenance/plugins/Panel.js =================================================================== --- trunk/JaffaRIA/source/html/js/extjs/jaffa/maintenance/plugins/Panel.js 2011-11-19 20:06:41 UTC (rev 5736) +++ trunk/JaffaRIA/source/html/js/extjs/jaffa/maintenance/plugins/Panel.js 2011-11-19 21:27:57 UTC (rev 5737) @@ -340,7 +340,7 @@ this.cascade(function (f) { if (f.mapping && !f.readOnly && !f.textOnly) { // place keyup listener on fields except radio buttons and checkboxes - if (f.xtype != 'checkbox' && f.xtype != 'radio' && f.xtype!='htmleditor' && f.xtype!='xhtmleditor') { + if (f.xtype != 'checkbox' && f.xtype != 'radio' && f.xtype!='htmleditor' && f.xtype!='xhtmleditor' && f.xtype!='comment') { f.on('keyup', function (tField, evt) { if (evt.getKey) { if (!this.isDirty && !evt.isNavKeyPress() && (evt.keyCode==evt.BACKSPACE || evt.keyCode==evt.DELETE || !evt.isSpecialKey())) { @@ -349,7 +349,7 @@ } }, this); } - if (f.xtype == 'htmleditor' || f.xtype == 'xhtmleditor') { + if (f.xtype == 'htmleditor' || f.xtype == 'xhtmleditor' || f.xtype == 'comment') { f.on('change', function(f, oldValue, newValue){ // add old value and new value comparison to allow this event also act like change event // make sure that the ''==undefined==null in the test @@ -456,7 +456,7 @@ if (newValue && this.controller) { var criteria = {}; var originalStartValue = field.startValue; - + var multiFieldKey = false; //multikey support if(this.keyFields && Ext.isArray(this.keyFields)){ for(var i=0; i < this.keyFields.length; i++){ @@ -468,6 +468,7 @@ return; } } + multiFieldKey = true; } else { criteria[field.mapping] = {values: [newValue]}; } @@ -499,6 +500,7 @@ //focus on the key-field field.focus(); field.startValue = originalStartValue; //ensures that the change-listener is fired on a subsequent blur, even if the invalid value remains unchanged in Firefox/Chrome + if (multiFieldKey)field.setValue(); field.hasFocus = true; //ensures that the change-listener is fired on a subsequent blur, even if the invalid value remains unchanged in IE //} } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |