how do you call this method?
if it's a singleton, then you must get an instance before using any of its
methods.
Edu
On Wed, Jun 8, 2011 at 15:26, Patrice Oostermeyer <[email protected]>wrote:
> Ok I have the ugly part working.
> But I don't quite get the better approach.
> I'm trying to call reloadMap from Application.js, which is of
> type qx.application.Standalone.
> I marked it "singleton", which seems to be no problem.
> The call to reloadMap works, BUT in it is a reference to 'this', and that
> is where it fails.
> Any suggestions?
>
> qx.Class.define("test.Application",
> { extend : qx.application.Standalone,
> type: "singleton",
>
> members :
> {
> some:"bla",
> main : function() {...}
> reloadMap : function(msg)
> { this.some = "thensome";
> // crash when called outside this app.
> alert("ReloadMap says: " + msg + this.some);
> }
> }
> }
>
> Regards,
> Patrice
>
> 2011/6/1 Marc Puts <[email protected]>
>
>> In the main() function of your application, you could set a global
>> variable that calls the reloadMap function.
>> Playground example:
>> http://tinyurl.com/3eth8of
>>
>> While the above works, it's pretty ugly.
>>
>> Another (and imo, better) approach would be to have the reloadMap()
>> function in a singleton class:
>>
>> qx.Class.define("test.SomeClass",
>> {
>> type: "singleton",
>> extend : qx.core.Object",
>>
>> members :
>> {
>> reloadMap : function(msg)
>> {
>> alert("ReloadMap says: " + msg);
>> }
>> }
>> }
>>
>> Then, from outside the application, you can write:
>> test.SomeClass.getInstance().reloadMap("Hello!");
>>
>>
>>
>> Regards,
>> Marc
>>
>>
>> On 06/01/2011 04:29 PM, ibanezje wrote:
>> > Probably asked more than once,
>> >
>> > but how do I call a function in my main Application from outside the
>> > application?
>> > something like:
>> >
>> > fails.
>> > reloadMap() is a function in the 'members' section of Application.js
>> >
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Simplify data backup and recovery for your virtual environment with
>> vRanger.
>> Installation's a snap, and flexible recovery options mean your data is
>> safe,
>> secure and there when you need it. Data protection magic?
>> Nope - It's vRanger. Get your free trial download today.
>> http://p.sf.net/sfu/quest-sfdev2dev
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>
>
>
> ------------------------------------------------------------------------------
> EditLive Enterprise is the world's most technically advanced content
> authoring tool. Experience the power of Track Changes, Inline Image
> Editing and ensure content is compliant with Accessibility Checking.
> http://p.sf.net/sfu/ephox-dev2dev
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel