Re: GWT MVP pattern - change different parts of page on an event

2011-04-05 Thread Ashton Thomas
Not sure if I'm stating things you already know, but maybe an
alternative or cleaner way is to implement MVP using Places and
Activities

Each section could have an Activity Manager that changes the Presenter/
Activity based on the Place (May not change everyone section each
time)

Or you could have a presenter for some sections that implement custom
EventHandlers and replace the displayed widget depending on custom
events

Not sure what your exact use is, but having a presenter for each
section (as a starting point) may prove messy in the long run.




On Apr 5, 2:29 pm, moni  wrote:
> I am creating a GWT application using MVP pattern. I have an index
> page which uses DockLayoutPanel. I have view and presenter for each
> section of dockLayoutPanel (ex: NorthView and NorthPresenter). I have
> four buttons in the center panel (NorthBtn, EastBtn, WestBtn,
> SouthBtn). onClick of any one of the buttons the UI should change in
> respective section of dockLayoutPanel.
>
> Entry Point Class:
>
> @Override
> public void onModuleLoad() {
>     RPCServiceAsync rpcService = GWT.create(RPCService.class);
>     HandlerManager eventBus = new HandlerManager(null);
>     AppController appViewer = new AppController(rpcService, eventBus);
>
>     appViewer.go(RootLayoutPanel.get());
>
> }
>
> AppController class has the logic for History management and event
> handling logic. (From Google article - To handle logic that is not
> specific to any presenter and instead resides at the application
> layer, we'll introduce the AppController component.)
>
> For example, onClick of a EastBtn in center panel I add a new history
> token, "east", and onValueChange() method is called. The respective
> presenter and view is created, say EastView and EastPresenter:
>
> 1. How can I update the existing EastPanel with the newly created
> panel (as I dont have handle to the old Panel)?
> 2. If the user has bookmarked the page after the button click and re-
> visits the page with bookmarked link, the flow would reach
> onValueChange method and create EastView and EastPanel. But, how can
> the rest of the page be re-created and EastPanel be updated?

-- 
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-toolkit@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.



GWT MVP pattern - change different parts of page on an event

2011-04-05 Thread moni
I am creating a GWT application using MVP pattern. I have an index
page which uses DockLayoutPanel. I have view and presenter for each
section of dockLayoutPanel (ex: NorthView and NorthPresenter). I have
four buttons in the center panel (NorthBtn, EastBtn, WestBtn,
SouthBtn). onClick of any one of the buttons the UI should change in
respective section of dockLayoutPanel.

Entry Point Class:

@Override
public void onModuleLoad() {
RPCServiceAsync rpcService = GWT.create(RPCService.class);
HandlerManager eventBus = new HandlerManager(null);
AppController appViewer = new AppController(rpcService, eventBus);

appViewer.go(RootLayoutPanel.get());
}

AppController class has the logic for History management and event
handling logic. (From Google article - To handle logic that is not
specific to any presenter and instead resides at the application
layer, we'll introduce the AppController component.)

For example, onClick of a EastBtn in center panel I add a new history
token, "east", and onValueChange() method is called. The respective
presenter and view is created, say EastView and EastPresenter:

1. How can I update the existing EastPanel with the newly created
panel (as I dont have handle to the old Panel)?
2. If the user has bookmarked the page after the button click and re-
visits the page with bookmarked link, the flow would reach
onValueChange method and create EastView and EastPanel. But, how can
the rest of the page be re-created and EastPanel be updated?

-- 
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-toolkit@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.