Re: MVP For Popups

2013-05-21 Thread David

Typically you would have a Presenter that  initializes your view ( the 
static dom) , loads your view with data from an  async server invocation , 
and receives requests from the view for more data .   Have a look at 
https://developers.google.com/web-toolkit/articles/mvp-architecture-2.

Apart from dispatching url place requests via browser History, I personally 
hold off from using the event bus until  I have a situation where multiple 
views may be interested in a single event or a given view is reused by many 
use cases with different presenters.The EventBus also is handy 
for managing a model cache (broadcasting model changes to interested views).

Here's a recent video from last weeks Google IO :
https://www.youtube.com/watch?v=kilmaSRq49g   .  The EventBus is covered 
about halfway in.

David


On Monday, May 20, 2013 8:15:22 AM UTC-4, Tim Hill wrote:
>
> Thanks Oliver, that has got me on the right track :)
>
> Next question... When I click on the save address button (for example), 
> the callback registers that the save button for address has been clicked 
> and runs the required method in the callback. This then calls an async 
> method in another class to save the address to a local SQLite instance. 
> What would be the best way to pass back the success/failure of the database 
> operation? Would it be on the eventbus, or is there a more preferred way?
>
> Sorry for the noddy questions, but still learning!
>
> Cheers
>
> Tim
>
>

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




Re: MVP For Popups

2013-05-20 Thread Tim Hill
Thanks Oliver, that has got me on the right track :)

Next question... When I click on the save address button (for example), the 
callback registers that the save button for address has been clicked and 
runs the required method in the callback. This then calls an async method 
in another class to save the address to a local SQLite instance. What would 
be the best way to pass back the success/failure of the database operation? 
Would it be on the eventbus, or is there a more preferred way?

Sorry for the noddy questions, but still learning!

Cheers

Tim

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




Re: MVP For Popups

2013-05-20 Thread Tim Hill
Thanks Oliver, that has got me on the right track :)

Next question... When I click on the save address button (for example), the 
callback registers that the save button for address has been clicked and 
runs the required method in the callback. This then calls an async method 
in another class to save the address to a local SQLite instance. What would 
be the best way to pass back the success/failure of the database operation? 
Would it be on the eventbus, or is there a more preferred way?

Sorry for the noddy questions, but still learning!

Cheers

Tim

On Saturday, 11 May 2013 21:14:50 UTC+1, Oliver Krylow wrote:
>
> Hi!
>
> Implement your popups in the views and have callbacks as arguments for 
> your presenters to provide logic when necessary .
>
> Example :
>
> view.showNewEventDialog(data,new NewEventCallback(){
>
> @Override
> public void onSave(String data){
> 
>
> }
>
> @Override
> public void onExtends (){
> ...
> }
>
> });
> On May 11, 2013 12:59 AM, "Tim Hill" > 
> wrote:
>
>> Hi,
>>
>> I would appreciate some advice, if anyone has any time to spare... I am 
>> slowly, but surely, getting to grips with GWT (I think) and I have hit my 
>> next stumbling block. The scenario is as follows:
>> > The app loads to the calendar view
>> > User clicks on a date and the 'add new event' dialog/popup is shown
>> > User enters event info, along with address of the event. If the address 
>> does not already exist within the app, the user can click a button to 
>> extend the popup to enter a new address
>> > User clicks save.
>> > Events fired to save new data.
>>
>> My quandary is thus... I am attempting to implement my app using MVP 
>> (activities/presenters/places/views etc), but I am not sure how best to 
>> implement popups like I described above as there is more logic in there 
>> than a simple 'busy' popup, for example. My aim is to have as much of the 
>> app logic as possible separate from the UI implementation so I can easily 
>> port the app to a mobile interface. 
>>
>> Thanks in advance!
>>
>> Tim
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Google Web Toolkit" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-web-toolkit+unsubscr...@googlegroups.com .
>> To post to this group, send email to 
>> google-we...@googlegroups.com
>> .
>> Visit this group at 
>> http://groups.google.com/group/google-web-toolkit?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>

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




Re: MVP For Popups

2013-05-11 Thread Oliver Krylow
Hi!

Implement your popups in the views and have callbacks as arguments for your
presenters to provide logic when necessary .

Example :

view.showNewEventDialog(data,new NewEventCallback(){

@Override
public void onSave(String data){


}

@Override
public void onExtends (){
...
}

});
On May 11, 2013 12:59 AM, "Tim Hill"  wrote:

> Hi,
>
> I would appreciate some advice, if anyone has any time to spare... I am
> slowly, but surely, getting to grips with GWT (I think) and I have hit my
> next stumbling block. The scenario is as follows:
> > The app loads to the calendar view
> > User clicks on a date and the 'add new event' dialog/popup is shown
> > User enters event info, along with address of the event. If the address
> does not already exist within the app, the user can click a button to
> extend the popup to enter a new address
> > User clicks save.
> > Events fired to save new data.
>
> My quandary is thus... I am attempting to implement my app using MVP
> (activities/presenters/places/views etc), but I am not sure how best to
> implement popups like I described above as there is more logic in there
> than a simple 'busy' popup, for example. My aim is to have as much of the
> app logic as possible separate from the UI implementation so I can easily
> port the app to a mobile interface.
>
> Thanks in advance!
>
> Tim
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




MVP For Popups

2013-05-10 Thread Tim Hill
Hi,

I would appreciate some advice, if anyone has any time to spare... I am 
slowly, but surely, getting to grips with GWT (I think) and I have hit my 
next stumbling block. The scenario is as follows:
> The app loads to the calendar view
> User clicks on a date and the 'add new event' dialog/popup is shown
> User enters event info, along with address of the event. If the address 
does not already exist within the app, the user can click a button to 
extend the popup to enter a new address
> User clicks save.
> Events fired to save new data.

My quandary is thus... I am attempting to implement my app using MVP 
(activities/presenters/places/views etc), but I am not sure how best to 
implement popups like I described above as there is more logic in there 
than a simple 'busy' popup, for example. My aim is to have as much of the 
app logic as possible separate from the UI implementation so I can easily 
port the app to a mobile interface. 

Thanks in advance!

Tim

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