You found a bug! We've classified it as EXTJSIII-104 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Ext User
    Join Date
    Jan 2008
    Posts
    28
    Vote Rating
    0
    sekundek is on a distinguished road

      0  

    Default [OPEN-865] isDirty on radiogroup

    [OPEN-865] isDirty on radiogroup


    Ext version tested:
    • Ext 3.2 rev ____

    Adapter used:
    • ext

    css used:
    • only default ext-all.css



    Browser versions tested against:
    • FF3 (firebug 1.3.0.10 installed)

    Operating System:
    • Win7

    Description:
    • When loading json data to a form with radiogroup and later checking isDirty, radiogroup is always returned dirty. It because originalValue is not set on radios inside group but only on group itself. When isDirty from checkboxgroup is called it checks isDrity for every radio, which is always true.

    Test Case:

    Code:
        <<insert working code to reproduce the report >>
    See this URL : http://


    Steps to reproduce the problem:
    • use form from samples
    • load json object into form


    Debugging already done:
    • yes

    Possible fix:
    • bellow is isDirty for raidogroup

    Code:
    	// private
        isDirty: function(){
            //override the behaviour to check sub items.
            if (this.disabled || !this.rendered) {
                return false;
            }
    
            var dirty = false;
    		if (this.getValue().getRawValue() != this.originalValue.getRawValue()) {
    			dirty = true;
    		}
            return dirty;
        }

  2. #2
    Sencha User realjax's Avatar
    Join Date
    Aug 2009
    Location
    Netherlands
    Posts
    412
    Vote Rating
    6
    realjax is on a distinguished road

      0  

    Default


    Yeah, pretty sad actually that radio groups and checkbox groups have sucked from first introduction (mind you, that was about 5 versions ago!!) and still suck up untill this day. Both groups still malfunction horribly when using trackResetOnload. I've posted numerous bug reports on this, but I'm done reporting bugs for ExtJs.

  3. #3
    Ext JS Premium Member
    Join Date
    Jun 2008
    Location
    Belgium
    Posts
    263
    Vote Rating
    1
    maquejp is on a distinguished road

      0  

    Default


    Will this be solved somehow? "Patch" or v4?

  4. #4
    Sencha User
    Join Date
    Mar 2010
    Location
    Russia, Moscow
    Posts
    57
    Vote Rating
    0
    westvovik is on a distinguished road

      0  

    Default


    Tell this problem till now it is not solved?

  5. #5
    Sencha User
    Join Date
    Jun 2011
    Posts
    1
    Vote Rating
    0
    mk7332 is on a distinguished road

      0  

    Default Possible fix?

    Possible fix?


    I'm using Ext 3.3.x. The following code seems to fix the behavior of isDirty() in radiogroup. Am I missing something? Seems like such a simple fix to not be fixed in Ext js's code. Will this fix cause other problems?

    Code:
    Ext.override(Ext.form.RadioGroup,
    {
        isDirty: function()
        {
            if (this.originalValue == undefined){
                return false;
            }
            if (this.originalValue.inputValue == this.getValue().inputValue ){
                return false;
            }
            return true;
        }
    });

  6. #6
    Sencha User
    Join Date
    Mar 2010
    Location
    Russia, Moscow
    Posts
    57
    Vote Rating
    0
    westvovik is on a distinguished road

      0  

    Default


    this problem in function setValues in class Ext.form.BasicForm

    Code:
    Ext.form.BasicForm.override ({
        setValues : function(values){
            if(Ext.isArray(values)){ // array of objects
                for(var i = 0, len = values.length; i < len; i++){
                    var v = values[i];
                    var f = this.findField(v.id);
                    if(f){
                        f.setValue(v.value);
                        if (this.trackResetOnLoad) {
                            if (f instanceof Ext.form.CheckboxGroup) {
                                f.eachItem(function(item){
                                    if (item instanceof Ext.form.Checkbox) item.originalValue = item.getValue();
                                });
                            } else {
                                f.originalValue = f.getValue();
                            }
                        }
                    }
                }
            }else{ // object hash
                var field, id;
                for(id in values){
                    if(!Ext.isFunction(values[id]) && (field = this.findField(id))){
                        field.setValue(values[id]);
                        if (this.trackResetOnLoad) {
                            if (field instanceof Ext.form.CheckboxGroup) {
                                field.eachItem(function(item){
                                    if (item instanceof Ext.form.Checkbox) item.originalValue = item.getValue();
                                });
                            } else {
                                field.originalValue = field.getValue();
                            }
                        }
                    }
                }
            }
            return this;
        },
    });

  7. #7
    Ext JS Premium Member canxss's Avatar
    Join Date
    Sep 2008
    Posts
    184
    Vote Rating
    3
    canxss is on a distinguished road

      0  

    Default


    I've just faced this problem and found this thread while trying to find a solution. And I'm also surprised and disappointed that this is issue is still not fixed.

    This thread suggested a fix but I'm hesitating to apply it since it may cause violations in other parts.

    Did anyone found and applied a safe fix?

    Ipek

  8. #8
    Sencha User
    Join Date
    Sep 2013
    Posts
    1
    Vote Rating
    0
    blatham is on a distinguished road

      0  

    Default Getting errors...

    Getting errors...


    I used this fix on my radiogroup and it does fix the problem... however, I also get an error that says that on this line this.getValue() is null:
    Code:
    if (this.getValue().getRawValue() != this.originalValue.getRawValue())
    Here is my radiogroup:
    Code:
    {
        xtype        : 'radiogroup',
        columns     : 1,
        hideLabel    : true,
        items         : [
        {
                boxLabel    : ' - Bound to page content width',
                name         : 'MenuLayout',
                inputValue    : 1
        },
        {
                boxLabel     : ' - Full page width, left aligned',
                name         : 'MenuLayout',
                inputValue     : 2
        },
        {
                boxLabel    : ' - Full page width, center aligned',
                name         : 'MenuLayout',
                inputValue    : 3
         },
         {
                boxLabel    : ' - Full page width, right aligned',
                name         : 'MenuLayout',
                inputValue    : 4
         }
         ],
         isDirty: function(){
            //override the behaviour to check sub items.
            if (this.disabled || !this.rendered) 
            {
                  return false;
            }
    
            var dirty = false;
            if (this.getValue().getRawValue() != this.originalValue.getRawValue()) 
            {
                  dirty = true;
            }
            return dirty;
       }

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi