Sheesh, that easy huh? Suits me, works perfectly. Cheers Dan
Aaron ----- Original Message ----- From: "Dan Fillpot" <[EMAIL PROTECTED]> To: "qooxdoo Development" <[email protected]> Sent: Tuesday, November 14, 2006 3:50 PM Subject: Re: [qooxdoo-devel] Reusing a button > var newButton = origButton.clone(); > > > HTH, > > Dan > > > Aaron Cooper wrote: >> Hi all, >> >> I've got a button (well several actually) that I want to use on >> multiple windows of my app. In this case it's for logging out: >> >> /**************************************************************************** >> /* Logout Button >> /***************************************************************************/ >> var btnLogout = new qx.ui.form.Button("Logout", "icon/16/decrypted.png"); >> btnLogout.setRight(5); >> btnLogout.setBottom(5); >> btnLogout.name= 'logoutButton'; >> >> btnLogout.addEventListener("execute", function(e) { >> // Run ajax process for logout >> ajax.requestFile = "ajax/logout.php"; >> ajax.method = 'get'; >> ajax.onError = whenLogoutError; >> ajax.onCompletion = whenLogoutComplete; >> ajax.runAJAX(); >> }); >> >> // Actions to take when a logout has bee completed >> function whenLogoutComplete() { >> if(ajax.response == 1) { >> currentWindow.close(); >> loginBox.open(); >> currentWindow = loginBox; >> } else { >> alert('Logout Failed'); >> } >> } >> >> // Only a serious error will kick this (e.g. PHP file missing) >> function whenLogoutError() { >> alert('There has been a backend error while logging out - Please >> contact Us'); >> } >> /**************************************************************************** >> /* END Logout Button >> /***************************************************************************/ >> >> Don't worry too much about the code itself, as it works fine. >> >> What I want to do be able to use multiple instances of this button >> whereever I want. At the moment, even if I add the button to more than >> one window, it will only display on the last one it was added to. >> >> I'm reading up on OO and prototyping as I havn't done this aspect of >> JS before, and can only guess that it's the key to what I want. >> >> I was wondering if anyone had any guidence on the this sort of thing >> please? >> >> Cheers >> Aaron >> ------------------------------------------------------------------------ >> >> ------------------------------------------------------------------------- >> Using Tomcat but need to do more? Need to support web services, security? >> Get stuff done quickly with pre-integrated technology to make your job >> easier >> Download IBM WebSphere Application Server v.1.0.1 based on Apache >> Geronimo >> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >> ------------------------------------------------------------------------ >> >> _______________________________________________ >> qooxdoo-devel mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel >> > > > -- > Help me find a cure for Cancer: > http://www.grid.org/services/teams/team.htm?id=83F99A51-C506-4F52-837D-5A0D396DC4F2 > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > qooxdoo-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
