Re: [pyxpcom] Inline Python in XUL application for calling XUL browsergoBack() method
by Ryan Sturmer other posts by this author
Aug 10 2007 8:16AM messages near this date
view in the new Beta List Site
Re: [pyxpcom] Inline Python in XUL application for calling XUL browsergoBack() method
|
Re: [pyxpcom] Inline Python in XUL application for calling XULbrowsergoBack() method
Mark,
Thank you for the reply!
Given that you're not familiar enough with these specific elements,
where would *you* go to figure out which interfaces are implemented by
my surface object (it's a <browser> XUL element) and do you have a
snippet of code that exemplifies the retrieval of an object (via
getElementById(), and the application of that interface so that the
goBack() method can be called?
Cheers!
-R
On 8/10/07, Mark Hammond <mhammond@[...].au> wrote:
> > <button label="Back"
> > oncommand="document.getElementById('surface').goBack()" />
> > </tabpanel>
> ...
> >
> > A click on the button returns the following message to my
> > error console:
> >
> > WARNING:xpcom:Python DOM script error
> > Traceback (most recent call last):
> > File
> > "C:\mozilla-src-vc71\mozilla\obj-i686-pc-mingw32\dist\bin\pyth
> > on\nsdom\context.py",
> > line 478, in CallEventHandler
> > return handler(*args)
> > File "chrome://main/content/main.xul", line 1, in oncommand
> > File
> > "C:\mozilla-src-vc71\mozilla\obj-i686-pc-mingw32\dist\bin\pyth
> > on\nsdom\context.py",
> > line 144, in __getattr__
> > return Component.__getattr__(self, attr)
> > File
> > "C:\mozilla-src-vc71\mozilla\obj-i686-pc-mingw32\dist\bin\pyth
> > on\xpcom\client\__init__.py",
> > line 384, in __getattr__
> > raise AttributeError, "XPCOM component '%s' has no attribute '%s'"
> > % (self._object_name_, attr)
> > <type 'exceptions.AttributeError'>: XPCOM component
> > '<unknown>' has no attribute 'goBack'
>
> The problem is that the result of getElementById('surface') is not what you
> expect. You need to work out which interface implements the goBack()
> method, and then work out if surface is supposed to implement it (in which
> case you may need an explicit QueryInterface), or if it really is some other
> object implementing it (such as the window or similar). I'm afraid that I'm
> not familiar enough with these specific objects to know without looking
> though...
>
> Mark
>
>
--
"Time is an illusion. Lunchtime, doubly so."
Ryan Sturmer
ryansturmer@[...].com
http://www.gogglemarks.net/
_______________________________________________
pyxpcom mailing list
pyxpcom@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Ryan Sturmer
Mark Hammond
Ryan Sturmer
Mark Hammond
Ryan Sturmer
|