Re: Question about gwt from a newbie.

2010-06-24 Thread aditya sanas
There is one more way to do this is to have notifiers which I have
implemented in my application.

suppose you have one interface say
Step 1 :
interface WidgetStateChangedNotifier{
   // this will have method as per you requirement...
}

Step 2 :
implement this interface in Widget A as widget A must get notification about
state change in Widget B

class WidgetA implements WidgetStateChangedNotifier{

// this class will implement that method and this method will get called
whenever there is change in WidgetB
}

Step 3 :

Now the state of widget B has changed and you wants to notify WidgetA about
it
for this purpose create an object of this interface pass it to the
constructor of WidgetB.
and call its method whenever there is a change in state of widget say widget
must get notification whenever user clicks WidgetB

then

public void onClick(ClickEvent){
/// here we will give a call to the method of that interface which in turn
will call method from WidgetA so Widget A got notification

}

I hope this will help you.

--
Aditya


On Thu, Jun 24, 2010 at 12:31 PM, Qian Qiao  wrote:

> On Thu, Jun 24, 2010 at 02:46, tank  wrote:
> >Assume i have two widgets A and B in host page. They bind to
> > datasource DSA and DSB respectly. I do some stuff in A then DSA has
> > changed. DSA's change leads to  DSB's change. Question is:
> >How to reflect DSB's change on B and where to put such code?
> >I can let widget A has a reference of B. When the rpc call for
> > changing DSA finished i call B's some function to refresh B's data.
> > Another way is keeping widget A and B seperately and to put this logic
> > in entrypoint. But first, refresh data always means refilling , i cant
> > do it with an incremental manner. Second, when we have more than two
> > widgets whose datasources all have relationship with other, the code
> > will become more ugly and hard to maintain.
> >I am not familiar with RIA, i used to write some jsps/servlets and
> > just jump from page to page. I dont need worry about data
> > refreshing.Then what's the common way in GWT?
> >
>
> One option is to make it event driven. So once A is updated, it fires
> some sort of event, triggering all listeners on it to do whatever
> appropriate. The advantage of this approach is that as you add more Bs
> and Cs and Ds in, the complexity doesn't grow out of control.
>
> HTH.
>
> -- Joe
>
>
> --
> Proper software development is like female orgasm. Some claim it's a
> myth, others try very hard to make it happen but don't know how, and
> most magazines, books and videos showing it are showing faked ones.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to google-web-tool...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-web-toolkit+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

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



Re: Question about gwt from a newbie.

2010-06-24 Thread Qian Qiao
On Thu, Jun 24, 2010 at 02:46, tank  wrote:
>    Assume i have two widgets A and B in host page. They bind to
> datasource DSA and DSB respectly. I do some stuff in A then DSA has
> changed. DSA's change leads to  DSB's change. Question is:
>    How to reflect DSB's change on B and where to put such code?
>    I can let widget A has a reference of B. When the rpc call for
> changing DSA finished i call B's some function to refresh B's data.
> Another way is keeping widget A and B seperately and to put this logic
> in entrypoint. But first, refresh data always means refilling , i cant
> do it with an incremental manner. Second, when we have more than two
> widgets whose datasources all have relationship with other, the code
> will become more ugly and hard to maintain.
>    I am not familiar with RIA, i used to write some jsps/servlets and
> just jump from page to page. I dont need worry about data
> refreshing.Then what's the common way in GWT?
>

One option is to make it event driven. So once A is updated, it fires
some sort of event, triggering all listeners on it to do whatever
appropriate. The advantage of this approach is that as you add more Bs
and Cs and Ds in, the complexity doesn't grow out of control.

HTH.

-- Joe


-- 
Proper software development is like female orgasm. Some claim it's a
myth, others try very hard to make it happen but don't know how, and
most magazines, books and videos showing it are showing faked ones.

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



Re: Question about gwt from a newbie.

2010-06-23 Thread StrongSteve
I would suggest to implement a ValueChangeListener on the Widget A.
So every time the value of the Widget A changes, Widget B get informed
and can perform its necessary code.

Is this what you meant?

Greetings
Stefan

On 23 Jun., 20:46, tank  wrote:
>     Assume i have two widgets A and B in host page. They bind to
> datasource DSA and DSB respectly. I do some stuff in A then DSA has
> changed. DSA's change leads to  DSB's change. Question is:
>     How to reflect DSB's change on B and where to put such code?
>     I can let widget A has a reference of B. When the rpc call for
> changing DSA finished i call B's some function to refresh B's data.
> Another way is keeping widget A and B seperately and to put this logic
> in entrypoint. But first, refresh data always means refilling , i cant
> do it with an incremental manner. Second, when we have more than two
> widgets whose datasources all have relationship with other, the code
> will become more ugly and hard to maintain.
>     I am not familiar with RIA, i used to write some jsps/servlets and
> just jump from page to page. I dont need worry about data
> refreshing.Then what's the common way in GWT?

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



Question about gwt from a newbie.

2010-06-23 Thread tank
Assume i have two widgets A and B in host page. They bind to
datasource DSA and DSB respectly. I do some stuff in A then DSA has
changed. DSA's change leads to  DSB's change. Question is:
How to reflect DSB's change on B and where to put such code?
I can let widget A has a reference of B. When the rpc call for
changing DSA finished i call B's some function to refresh B's data.
Another way is keeping widget A and B seperately and to put this logic
in entrypoint. But first, refresh data always means refilling , i cant
do it with an incremental manner. Second, when we have more than two
widgets whose datasources all have relationship with other, the code
will become more ugly and hard to maintain.
I am not familiar with RIA, i used to write some jsps/servlets and
just jump from page to page. I dont need worry about data
refreshing.Then what's the common way in GWT?

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