PDA

View Full Version : [CLOSED-1049] ext.form.Checkbox startValue property and Chrome



dtex-lab
11 Jun 2010, 6:05 AM
Hi, ext.form.Checkbox startValue property in Chrome is not setted (using firebug for Chrome I always see 'undefined')

The same application under Firefox works fine.

Could someone give me a suggestion, please?

jsakalos
11 Jun 2010, 12:17 PM
What's the problem? Is it Firebug Lite problem only or you application doesn't work in Chrome? You shouldn't need to do anything with startValue. Also, docs state:


This will be undefined until the Field has been visited.

dtex-lab
13 Jun 2010, 11:46 PM
The problem is that my application works correctly in Firefox but not in Chrome: startValue in Firex is setted correctly but not in Chrome (it's always = undefined)

jsakalos
14 Jun 2010, 12:15 AM
OK, post please a showcase (http://extjs.com/learn/Ext_Forum_Help#Posting_a_working_showcase), we'll take a look if it is not a bug.

dtex-lab
14 Jun 2010, 7:26 AM
Hi, I have developed the showcase

Test a)
To test it:
- Open the application using Firefox
- click several times on 'field a)' checkbox
- you will see the 'a) startValue' text changes fips from true to false

- Open the same application using Chrome
- performs the same steps as described above
- you will see the 'a) startValue' text always displays: undefined

In my opinion this is the bug.

For test a)
In my opinion is very strange that I have to loose the focus programmatically on 'btn', to see that a) startValue changes.
Without that, the a) startValue becames 'false' the first time, and, after several checkbox click stays false.
Loosing the focus programmatically, the startValue is correctly set.
I repeat myself: in my opinion this is a little bit strange

I have inserted another test case:
field b)
the button 'click here to change b) value'
b) startValue

If u click on button you will see that b) startValue is always equals to b) value
This because ExtJS assigns the startValue when component is focused.
In my opinion is probably better to assign the startValue in set method: the set method might assign before the startValue using value and after the value within the new value.
This will disconnects the startValue setting from focus manager to connect it within the set method that is just the method designed to set the value

Here's the test case


Ext.onReady(function () {
var iCnt = 1;
var vView = new Ext.Viewport({
renderTo: 'test-body',
layout: 'form',
items: [{
xtype: 'checkbox',
id: 'fldA',
fieldLabel: 'field a)',
listeners: {
'check': function (aFld, aChecked) {
var vStartA = Ext.getCmp('startA');
var vFldA = Ext.getCmp('fldA');
var vValue = vFldA.startValue == undefined ? 'undefined' : vFldA.startValue;
vStartA.setValue(vValue);
var vBtn = Ext.getCmp('btn');
vBtn.focus();
}
}
}, {
xtype: 'field',
id: 'startA',
fieldLabel: 'a) startValue',
disabled: true
}, {
xtype: 'field',
id: 'fldB',
fieldLabel: 'field b)',
listeners: {
'change': function (aFld, aStartValue, aNewValue) {
var vStartB = Ext.getCmp('startB');
var vFldB = Ext.getCmp('fldB');
vStartB.setValue(vFldB.startValue);
}
}
}, {
xtype: 'button',
text: 'click here to change b) value',
id: 'btn',
listeners: {
'click': function (aBtn, aEvt) {
var vFldB = Ext.getCmp('fldB');
var vOldValue = vFldB.getValue();
vFldB.setValue('Change nr: ' + iCnt++);
var vNewValue = vFldB.getValue();
vFldB.focus();
vFldB.fireEvent('change', vFldB, vNewValue, vOldValue);
}
}
}, {
xtype: 'field',
id: 'startB',
fieldLabel: 'b) startValue',
disabled: true
}]
});
});

jsakalos
14 Jun 2010, 7:29 AM
OK, moving this thread to bugs.

dtex-lab
17 Jun 2010, 1:04 AM
Hi, any news about it ?
ty

up.

dtex-lab
24 Jun 2010, 1:18 AM
No one is taking care about it?

Regards
Ty

evant
24 Jun 2010, 1:25 AM
It's been assigned a ticket number, we're aware of it.

evant
24 Jun 2010, 10:59 PM
Thought I'd seen this before: http://www.sencha.com/forum/showthread.php?93735-CLOSED-CheckBox-events-not-working-in-webkit-browsers&p=447722

Unfortunately we can't fix this. Closing.

dtex-lab
29 Jun 2010, 4:10 AM
Think about to change where the startValue is setted ? so move it from focus to some other place ?
I agree that you cannot fix some Chrome / Safari bugs.. if they doesn't throws focus event, you cannot do anything... but maybe it is possible to re-think the "business" logic about the startValue / originalValue for checkbox, radio and so on.. in order to keep the same behaviour for all components
Ty