q.window 0.7.7 onshow bug

3 views
Skip to first unread message

andy

unread,
Jun 22, 2010, 8:37:35 PM6/22/10
to Qutensil
Hi, updated to latest version of q (0.7.7)

if I add an onShow method to a new q.window the default q.window
onShow method is not fired...

the only way I can get it to fire is as follows:

onShow:function(self)
{
//do some stuff here
self.onShow();
}

the above only works if i comment out Q.callback('onShow',this); from
the default q.window class.

Am i doing something wrong?

I would like it to:
1/ call the default q.window onShow
2/ call my custom code for onShow.

thanks

andy

wonderingwout

unread,
Jun 23, 2010, 2:49:21 AM6/23/10
to Qutensil
Hi Andy,

Could you give me some more details.
Like the full example of your code (where the new Q.WIndow instance is
created).

Also browser and os.
We tested on three platforms on all main browsers, but maybe we're
overseeing something...

And what about 'Test 5' on this page:
http://qutensil.com/pages/qwindow

If you click the button of test 5 a white window should open with
'show' written in it.
The onShow callback writes this inside the window, so if that's the
case things should work fine.

Wout

andrew edmundson

unread,
Jun 23, 2010, 2:58:33 AM6/23/10
to qute...@googlegroups.com
Example as follows:

I have an ajax call that fills the window with data as follows:

var win = new Q.Window({
position:'fixed',
id: id,
trigger: '',
text:json_decode(json.content),
title: refr[0][2],
style: className,
onShow: function(self){
shroud_off();
if (json.execute)
{
if (json.execute!='')
{
//run on a timeout so the window displays even if code is bad...
setTimeout(function(){eval(json_decode(json.execute))},200);;
}
}
}
});

What I am trying to achieve is that the above onShow code runs (which it does at present) but I also want the default onShow code to run on the qwindow - which at present it dosent (I added an alert to the default onShow) and this dosent run unless the self.onShow(); is added inside the onShow above and the Q.callback('onShow',this); taken out of the default class onShow

Im running:
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 GTB7.0 ( .NET CLR 3.5.30729)
Windows Vista.

Thanks for all your help.

Andy

wonderingwout

unread,
Jun 23, 2010, 3:15:39 AM6/23/10
to Qutensil
Ok, try again without your code in the onShow function but only
something like:

onShow: function() {
alert('show');
}

If that works something else is wrong.

And you can leave the 'position:fixed' and 'trigger: ""' arguments.
The position is fixed by default and if you don't have a trigger, it
shouldn't be a blank string.

andrew edmundson

unread,
Jun 23, 2010, 3:24:28 AM6/23/10
to qute...@googlegroups.com
Here are my results...

If I remove the onShow method from my code completely AND edit qwindow.js and add an alert('show') into the default onShow method - the alert is NOT called (the window shows ok but no alert),

If I add my own custom onShow code it is run ok as this was not the problem - the default class onShow is still not called.


if I switch to version 0.7.6 and do the same it works ok, in v0.7.6 if I add my own custom onShow to a new qwindow its called ok and the default class onShow is called too.

Hope all this helps..

andrew edmundson

unread,
Jun 23, 2010, 3:33:12 AM6/23/10
to qute...@googlegroups.com
Tried it on google chrome too,


Steps to reproduce are simply edit the onShow in qwindow.js and add an alert,

Launch a window and no alert is shown

andy

wonderingwout

unread,
Jun 23, 2010, 3:59:06 AM6/23/10
to Qutensil
Ok, I found the bug.
Could you verify if it is working in this version:

http://download.qutensil.com/Q.js-v0.0.7.8b.tar.gz

If it does I'll publish it right away.
And by the way, thanks for your input!

andrew edmundson

unread,
Jun 23, 2010, 4:49:15 AM6/23/10
to qute...@googlegroups.com
Will check shortly..


cheers

andy

andrew edmundson

unread,
Jun 23, 2010, 8:39:58 AM6/23/10
to qute...@googlegroups.com
Have tested it and it all works ok, was there a bug with the callback stuff?

andrew edmundson

unread,
Jun 23, 2010, 8:42:58 AM6/23/10
to qute...@googlegroups.com
Do you have the files downloadable without the minifying (with original line breaks) (could possibly place in a src folder in zip?), this would greatly help when testing etc

Excellent work again!!,I love testing / using these libraries they are wicked!


Thanks again

wonderingwout

unread,
Jun 23, 2010, 8:45:58 AM6/23/10
to Qutensil
Ok great.

The bug was caused by deprecated code in Q.Window.
The onShow method wasn't called properly.

wonderingwout

unread,
Jun 23, 2010, 8:49:09 AM6/23/10
to Qutensil
Currently we're working hard on v0.0.8 which will already include
Q.Textarea, a WYSIWYG editor.
That release will be under an MIT license an we'll include the
uncompressed files as well.

I expect it to be one of these days...

andrew edmundson

unread,
Jun 23, 2010, 9:28:39 AM6/23/10
to qute...@googlegroups.com
Nice one sounds exciting!, another useful widget for the arsenal..
Reply all
Reply to author
Forward
0 new messages