View Full Version : [FIXED] Ext.SegmentedButton > setPressedButtons doesn't trigger "toggle" event

10 May 2012, 12:01 PM
Sencha Touch version tested:

Sencha Touch 2.0.1

Browser versions tested against:

Chrome 18.0.1025


When we call "setPressedButtons" on a SegmentedButton component, it doesn't trigger the "toggle" event. Since other components do it, like "setValue" triggering "change", I expected SegmentedButton to share the same behavior.

Steps to reproduce the problem:
Create a SegmentedButton with a number of items, connect an event handler to the "toggle" event and call "setPressedButtons" method on the component and note that the event is not fired.

Leonardo Braga

11 May 2012, 7:55 AM
Thanks for the report

new Ext.Container({
fullscreen : true,
items : [
xtype : 'segmentedbutton',
items : [
text : 'Yes'
text : 'No'
listeners : {
toggle : function() {
xtype : 'button',
text : 'Press Yes',
handler : function(button) {
var container = button.up('container'),
seg = container.down('segmentedbutton'),
yes = seg.down('button[text=Yes]');


22 May 2012, 1:30 PM
Fixed for the next release. Thanks for the heads up.

23 Aug 2012, 9:47 AM
Fixed for the next release. Thanks for the heads up.

I don't plan to upgrade to the new version any time soon. Could you provide me with a patch for 2.1? Or at least provide some details regarding the fix so that I can try to implement it in my application? Thanks.

23 Aug 2012, 10:03 AM
The fix should be in 2.1 already.

If you need a direct patch, you will need to go through support. Just link them to this thread.

23 Sep 2012, 10:20 PM
I monkeypatched my current code with this new SegmentedButton code, and I'm running into an issue with the fixed source.

I have a view component that I'm listening to 'toggle' on, but also setting the toggled button with setPressedButtons on view initialization.

This is causing an infinite loop in my code with the updated source...

Is there any way to skip passing the toggle event, suppress it, or perhaps set pressed buttons another way that won't trigger the event?

Right now I'm removing the listener, setting the status, then re-installing it. Seems like a huge pain.