I found the key!!
I follow the step from clicking the button to get the alert popup...these
are the steps:
* I click the button ( mousedownevent fired )
* _applyChecked fired.
* _applyChecked calls _handleItemChecked on the RadioManager.
* Radio Manager calls _applySelected. changeSelected event fired.
* changeChecked event fired on the button.
I try to modify the applySelected method...but to stop the propagation I
have to modify the first step!!!
I devleop a MyButton class extendin AbstractButton. I paste the content form
Button class.
qx.Class.define("custom.MiButton",
{
extend : qx.ui.pageview.AbstractButton,
construct : function(vText, vIcon, vIconWidth, vIconHeight,
vFlash,funcion)
{
this.base(arguments, vText, vIcon, vIconWidth, vIconHeight, vFlash);
condicion = funcion; //la funcion que se evalua para aceptar el checked
this.initChecked();
this.initTabIndex();
this.addEventListener("mouseover", this._onmouseover);
this.addEventListener("mouseout", this._onmouseout);
this.addEventListener("mousedown", this._onmousedown);
this.addEventListener("keydown", this._onkeydown);
this.addEventListener("keypress", this._onkeypress);
},
members:
{
condicion: "" // to be initialized in the constructor
},
Adds a condition member. A string to be evaluated.
_onmousedown : function(e) {
var res = eval(condicion);
if( res){
this.setChecked(true);
}
}
On mousedown I eval the condition...if I select 'No' nothings occurs. I stop
the propagation at the begin!!!
Cheers.
Alexander Back wrote:
>
> Hi,
>
> On Thursday 19 March 2009 sgallego wrote:
>> Alert popup appear asking me before make the page change... if I click
>> 'Cancel'...the event not occur over my buttonView class...but the event
>> is
>> propagated and 'chagechecked' over the button clicked is fired.
>> Can I do somwthing like stopPropagation function??
> Yes you can :)
>
> Just call the "stopPropagation" method at the event object.
> -> http://demo.qooxdoo.org/0.7.4/apiviewer/#qx.event.type.Event
>
> cheers,
> Alex
>
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
--
View this message in context:
http://www.nabble.com/alert-user-before-chaging-page-in-buttonview-tp22563991p22616932.html
Sent from the qooxdoo-devel mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel