Mobile app: pages, store...

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Mobile app: pages, store...

Frédéric
Hi,

So, I'm working on my little home automation client app, and I have a
little problem...

This client app will be build according to the server information. I
first have to get a config (json) from that server, parse it, and then
create the pages/widgets based upon what I find in the config.

My problem is how to organize my code to do that? I started from the
mobile showcase code. The Application object creates the pages. It also
creates a Json store (through a service object, based on code I found
in the tutorials), and fetch data.

The problem is that the datas are retreived asynchronously, ans are not
available when I create the pages, so they can't create their widgets.

I tried to fire a "loded" event from my service, and the pages listen
to that event. In their callback routine, they ask the service object
the infos they need, and create widgets.

But it does not work, as I can't add these widgets to the page from the
callback; this.getcontent() does not exists...

So, how to do that?

Thanks,

--
    Frédéric

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Mobile app: pages, store...

Daniel Wagner
Administrator
Hi,

you just need to make sure the callback is executed in the context of
the page, then this.getContent() will work.


Regards,
Daniel

On 14.02.2015 14:34, Frédéric wrote:

> Hi,
>
> So, I'm working on my little home automation client app, and I have a
> little problem...
>
> This client app will be build according to the server information. I
> first have to get a config (json) from that server, parse it, and then
> create the pages/widgets based upon what I find in the config.
>
> My problem is how to organize my code to do that? I started from the
> mobile showcase code. The Application object creates the pages. It also
> creates a Json store (through a service object, based on code I found
> in the tutorials), and fetch data.
>
> The problem is that the datas are retreived asynchronously, ans are not
> available when I create the pages, so they can't create their widgets.
>
> I tried to fire a "loded" event from my service, and the pages listen
> to that event. In their callback routine, they ask the service object
> the infos they need, and create widgets.
>
> But it does not work, as I can't add these widgets to the page from the
> callback; this.getcontent() does not exists...
>
> So, how to do that?
>
> Thanks,
>

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: Mobile app: pages, store...

Frédéric
Le Monday 16 February 2015, Daniel a écrit :

> you just need to make sure the callback is executed in the context of
> the page, then this.getContent() will work.

Ok, I see!

Thanks,

--
    Frédéric

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel