Hi Thomas, thank you very much for your reply.

I have made sure that client code is trying to access only after the
service has populated data into the single-ton class.  I am trying to
access data from client in the onSuccess method AsyncCallback class of
the service which does the actual storing  the data into the shared
single-ton class.

After examining the trace/logs, I see that the object returned by the
getinstance()  when called from service is different from the one we
get when client code is calling getinstance().

After little investigation, I am just wondering, what I am trying to
do is possible or not in GWT. I know that GWT's shared package can
contain code, which will be translated to javascript and included in
client side, and kept as java and included in server side. But, what
about data? Once after the application is loaded, how come the server
side code can update the javascript code in client?   Is it possible
in first place? If yes, what am I missing?

Hope, I am clear in my description above. Let me know, if you need any
more info from my side.  Thanks again for your response and your help
is much appreciated.

Cheers,
Vikky



On Aug 19, 1:02 am, Thomas Dvornik <[email protected]> wrote:
> Some code will be useful, especially the singleton class.
>
> Also, when/how are you getting the data? One potential problem I can
> see happening is the client code accessing the data before the server
> sets the values in the singleton class.
>
> Tom
>
> On Aug 18, 2:24 am, vikky8118 <[email protected]> wrote:
>
>
>
> > Hello all, I am new to GWT programming! Here is the problem that I am
> > trying to solve since two days.
>
> > I have the following
> > service package  :   a server side service which interacts with db and
> > gets data and stores the data in the shared package class
> > shared package  :   a shared class which represent the data I wanted
> > to store. it has setters and getters to all the class fields. This is
> > a single ton class.
> > client package    :   a client side class which invokes the server
> > side service and then tries to access the data from shared class in
> > which, we have data which is populated by server side service.
>
> > But, this is what happening.
>
> > Service is being called successfully and service side operations are
> > performed successfully and shared class data is populated properly.
> > But, when I try to get the shared package - single ton class, I get a
> > different object / not the one I wanted and I get junk data from the
> > getters of the class ( 'undefined' )
>
> > I am not sure if this is the right way, but, the data is frequently
> > accessed. Hence, my plan is to access the data from db for once, store
> > it in shared package single ton class and access it every time from it
> > when ever client needs it.
>
> > Can some one help me, what flaw I am making here?
>
> > Thanks in advance.
> > Vikky.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to