ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> pyxpcom
pyxpcom
Re: [pyxpcom] Inline Python in XUL application for calling XUL browsergoBack() method
by Mark Hammond other posts by this author
Aug 10 2007 7:24AM messages near this date
view in the new Beta List Site
[pyxpcom] Inline Python in XUL application for calling XUL browser goBack() method | Re: [pyxpcom] Inline Python in XUL application for calling XUL browsergoBack() method
>  					<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

_______________________________________________
pyxpcom mailing list
pyxpcom@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Ryan Sturmer
Mark Hammond
Ryan Sturmer
Mark Hammond
Ryan Sturmer

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved