On Fri, May 16, 2008 at 5:33 PM, kanugula <[EMAIL PROTECTED]>
wrote:

>
> I am having problem invoking javascript function in Qooxdoo Static member.
> I get the error logout() is not a function.
>
> qx.Class.define("dialog.StatusDialog",
> {
>        statics :
>        {
>             show : function(exc, isSuccess)
>            {
>               if (exc["class"] = "RemoteSessionTimeout") {
>                     qx.client.Timer.once(
>                  function()
>                  {
>                      this.logout(); //doesn't work


Well that will certainly not work since a static method, by definition, is
not associated with an object, so there's no 'this'.

>
>                                logout(); //this is also not working


I'm a little surprised that that doesn't work, but you can make it
explicit.  Instead of calling logout(), call window.logout().  Then...

   <script type='text/javascript'>
>        function logout(){
>          alert("called");
>        }


Replace that with:

  window.logout = function()
  {
    alert("called");
  } ;

See if that works for you.

Do you really need global functions?  Can't logout be in a qooxdoo class?
If there's no reason that you can't have it in a qooxdoo class, you can
prevent muddying the global address space.  You could do something like
this:

qx.Class.define("myPseudoGlobalSpace",
{
  statics:
  {
    logout : function()
    {
      alert("called");
    }
  }
});

and then in dialog.statusDialog.show(), you can call
myPseudoGlobalSpace.logout()

Derrell
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to