Re: Elemental2-compatible Activities (and Places)?

2021-03-07 Thread Frank Hossfeld
Sorry, wrong link. This one is correct: 
https://gitter.im/gwtproject/gwt-modules

Frank Hossfeld schrieb am Sonntag, 7. März 2021 um 12:47:27 UTC+1:

> Gordan Krešić schrieb am Samstag, 6. März 2021 um 18:24:17 UTC+1
>
>> I can see it still references widgets, so definitely not a final port, 
>> but 
>> if you are interested I can propose pull request based on my own port 
>> which 
>> uses elemental2.dom.HTMLElement instead of widgets. However, that should 
>> be 
>> up to a debate, because I believe more modular approach would be needed 
>> to 
>> cover most use cases: widgets, elemental2's HTMLElement, elemento's 
>> IsElement and possibly others.
>>
>
> Yeap, that's the problem. (and the reason, why Nalu uses several plugins, 
> to deal with the different implementations). We haven start the discussion 
> yet. And ATM, I am not sure, if IsWidget and Widget, is already migrated.I 
> think not. Think it is gwt-widgets, which is not yet done too, or at least 
> it is still in progress. Maybe something to discuss inside the gwt-modules 
> room: https://github.com/gwtproject
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/0c7e4ac9-d739-48f4-9ef2-b0ea252dfcedn%40googlegroups.com.


Re: Elemental2-compatible Activities (and Places)?

2021-03-07 Thread Frank Hossfeld
Gordan Krešić schrieb am Samstag, 6. März 2021 um 18:24:17 UTC+1

> I can see it still references widgets, so definitely not a final port, but 
> if you are interested I can propose pull request based on my own port 
> which 
> uses elemental2.dom.HTMLElement instead of widgets. However, that should 
> be 
> up to a debate, because I believe more modular approach would be needed to 
> cover most use cases: widgets, elemental2's HTMLElement, elemento's 
> IsElement and possibly others.
>

Yeap, that's the problem. (and the reason, why Nalu uses several plugins, 
to deal with the different implementations). We haven start the discussion 
yet. And ATM, I am not sure, if IsWidget and Widget, is already migrated.I 
think not. Think it is gwt-widgets, which is not yet done too, or at least 
it is still in progress. Maybe something to discuss inside the gwt-modules 
room: https://github.com/gwtproject

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/7456d7ab-a8fa-4765-ac05-109a45ce8137n%40googlegroups.com.


Re: Elemental2-compatible Activities (and Places)?

2021-03-06 Thread Vegegoku

Domino-mvp is a framework of many things, but if you are just interesting 
on listening to URL changes and do some routing based on those changes in a 
simple way, then maybe you can try domino-history 
<https://github.com/DominoKit/domino-history> (it is what domino-mvp use 
under the hood).
On Saturday, March 6, 2021 at 7:24:17 PM UTC+2 Gordan Krešić wrote:

> On 06. 03. 2021. 15:47, Frank Hossfeld wrote:
> > There are a few places where are the progress of the module update is 
> tracked:
> > 
> > 
> > 
> https://docs.google.com/spreadsheets/d/1b1D9fEqRh5lZ8cqMJtYoc_25rfTRvsuJkTtS2vjgi3o/edit#gid=0
>  
> > <
> https://docs.google.com/spreadsheets/d/1b1D9fEqRh5lZ8cqMJtYoc_25rfTRvsuJkTtS2vjgi3o/edit#gid=0
> >
> > 
> https://docs.google.com/spreadsheets/d/15WXfiklnTeqjRLI8gKj5iyGk7iDhnuQHGcpYJgpNlmQ/edit#gid=0
>  
> > <
> https://docs.google.com/spreadsheets/d/15WXfiklnTeqjRLI8gKj5iyGk7iDhnuQHGcpYJgpNlmQ/edit#gid=0
> >
> > https://github.com/FrankHossfeld/gwt-modules 
> > <https://github.com/FrankHossfeld/gwt-modules> (still in progress)
>
> Now... I found this on Twitter minutes ago and came here to post those 
> links... :)
>
> > And yes, the Activities module is not migrated yet.
>
> How about your own port mentioned in first sheet:
>
> https://github.com/FrankHossfeld/gwt-activity
>
> I can see it still references widgets, so definitely not a final port, but 
> if you are interested I can propose pull request based on my own port 
> which 
> uses elemental2.dom.HTMLElement instead of widgets. However, that should 
> be 
> up to a debate, because I believe more modular approach would be needed to 
> cover most use cases: widgets, elemental2's HTMLElement, elemento's 
> IsElement and possibly others.
>
> > If you are looking for J2CL/Elemental2 ready frameworks, take a look 
> here:
> > 
> > * dominokit/domino-mvp <https://github.com/DominoKit/domino-mvp>
> > * nalukit/nalu <https://github.com/NaluKit/nalu>  (Disclaimer: I am the
> > author)
>
> Seen both of them, but I'm porting existing project that has some 
> infrastructure (I'm trying not to exaggerate and call it a "framework" :) 
> ) 
> build on top of activities and places that I would like to reuse if 
> possible.
>
> -gkresic.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/46f11cde-1f9a-4af4-b2c4-06939e3d33den%40googlegroups.com.


Re: Elemental2-compatible Activities (and Places)?

2021-03-06 Thread Gordan Krešić

On 06. 03. 2021. 15:47, Frank Hossfeld wrote:

There are a few places where are the progress of the module update is tracked:


https://docs.google.com/spreadsheets/d/1b1D9fEqRh5lZ8cqMJtYoc_25rfTRvsuJkTtS2vjgi3o/edit#gid=0 
<https://docs.google.com/spreadsheets/d/1b1D9fEqRh5lZ8cqMJtYoc_25rfTRvsuJkTtS2vjgi3o/edit#gid=0>
https://docs.google.com/spreadsheets/d/15WXfiklnTeqjRLI8gKj5iyGk7iDhnuQHGcpYJgpNlmQ/edit#gid=0 
<https://docs.google.com/spreadsheets/d/15WXfiklnTeqjRLI8gKj5iyGk7iDhnuQHGcpYJgpNlmQ/edit#gid=0>
https://github.com/FrankHossfeld/gwt-modules 
<https://github.com/FrankHossfeld/gwt-modules> (still in progress)


Now... I found this on Twitter minutes ago and came here to post those 
links... :)



And yes, the Activities module is not migrated yet.


How about your own port mentioned in first sheet:

https://github.com/FrankHossfeld/gwt-activity

I can see it still references widgets, so definitely not a final port, but 
if you are interested I can propose pull request based on my own port which 
uses elemental2.dom.HTMLElement instead of widgets. However, that should be 
up to a debate, because I believe more modular approach would be needed to 
cover most use cases: widgets, elemental2's HTMLElement, elemento's 
IsElement and possibly others.



If you are looking for J2CL/Elemental2 ready frameworks, take a look here:

  * dominokit/domino-mvp <https://github.com/DominoKit/domino-mvp>
  * nalukit/nalu <https://github.com/NaluKit/nalu>  (Disclaimer: I am the
author)


Seen both of them, but I'm porting existing project that has some 
infrastructure (I'm trying not to exaggerate and call it a "framework" :) ) 
build on top of activities and places that I would like to reuse if possible.


-gkresic.

--
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/bdbdc150-4a9b-734d-7d45-869dcf8dbf3e%40steatoda.com.


Re: Elemental2-compatible Activities (and Places)?

2021-03-06 Thread Frank Hossfeld
There are a few places where are the progress of the module update is 
tracked:


https://docs.google.com/spreadsheets/d/1b1D9fEqRh5lZ8cqMJtYoc_25rfTRvsuJkTtS2vjgi3o/edit#gid=0
https://docs.google.com/spreadsheets/d/15WXfiklnTeqjRLI8gKj5iyGk7iDhnuQHGcpYJgpNlmQ/edit#gid=0
https://github.com/FrankHossfeld/gwt-modules (still in progress)

And yes, the Activities module is not migrated yet.

If you are looking for J2CL/Elemental2 ready frameworks, take a look here:

   - dominokit/domino-mvp <https://github.com/DominoKit/domino-mvp>
   - nalukit/nalu <https://github.com/NaluKit/nalu>  (Disclaimer: I am the 
   author)
   

Gordan Krešić schrieb am Donnerstag, 18. Februar 2021 um 20:23:17 UTC+1:

> Is there a port of com.google.gwt.activity.* classes that work with 
> elemental2 (HTML)Elements instead of widgets?
>
> I can find only port of Places (https://github.com/gwtproject/gwt-places), 
>
> but no activities.
>
> I can't find that sheet with progress on porting GWT components to 
> J2CL/GWT3 
> - what is the status of Activities and Places on that regard?
>
> -gkresic.
>
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/f56a79b5-98f0-4584-977a-16d4024ee8d8n%40googlegroups.com.


Elemental2-compatible Activities (and Places)?

2021-02-18 Thread Gordan Krešić
Is there a port of com.google.gwt.activity.* classes that work with 
elemental2 (HTML)Elements instead of widgets?


I can find only port of Places (https://github.com/gwtproject/gwt-places), 
but no activities.


I can't find that sheet with progress on porting GWT components to J2CL/GWT3 
- what is the status of Activities and Places on that regard?


-gkresic.

--
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/b5ffd4ac-579f-1098-473f-ea6c6381bd9a%40steatoda.com.


Generate skeleton for activities and places

2020-10-02 Thread Guillen Antonio
HI,

I am looking for a plugin or equivalent that can generate the skeletons for 
activities and places, some thing equivalent to GWTP? Have you informations 
on this?

Thanks a lot

Antonio

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/e861ef26-5f80-42a2-ab61-a5880ccf9200n%40googlegroups.com.


Activities and Places - Enabling History to reflect an updated data item

2016-01-06 Thread Thomas Broyer
You need to somehow notify your cached data that it has changed; there are many 
ways to do that depending on how you architected things.

You could have the cached list in a "holder" class and simply call a method on 
it from your update activity.
Or you could send an event in the event bus for more decoupling.
Or you could mediate all data access through a class that handles the caching 
and could update the cached list in-place.

And when your list activity starts, either unconditionnally update your view, 
or check whether the list has changed before doing so.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Activities and Places - Enabling History to reflect an updated data item

2016-01-06 Thread Paul Mazzuca
Thanks for all the quick replies.  When having to consider the back button 
in a browser or an Android mobile device, it certainly changes the way you 
think about architecting the standard goto(Place).  My solution was to 
build in a static placeCache into each Place, that way when getPlace is 
called from the tokenizer the placeCache can be returned rather than 
parsing the token.  

//MyPlace extends Place

public static MyPlace placeCache;


@Prefix("tok1")

public static class Tokenizer implements PlaceTokenizer {


public MyPlace getPlace(String token) {

//deal with null case if necessary


return placeCache;


public String getToken(MyPlace place) {

MyPlace.placeCache = place;

return "unused_tok";

}

}


//in another file once the item has changed
MyPlace.placeCache = MyPlace.create(newItem)


//then when the back button clicked on browser the new place is used

I am not too proud of the solution, but it works.   I might try and put it 
all in one class as you suggested.




On Wednesday, January 6, 2016 at 12:32:37 AM UTC-8, Thomas Broyer wrote:
>
> You need to somehow notify your cached data that it has changed; there are 
> many ways to do that depending on how you architected things.
>
> You could have the cached list in a "holder" class and simply call a 
> method on it from your update activity.
> Or you could send an event in the event bus for more decoupling.
> Or you could mediate all data access through a class that handles the 
> caching and could update the cached list in-place.
>
> And when your list activity starts, either unconditionnally update your 
> view, or check whether the list has changed before doing so.
>
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Activities and Places - Enabling History to reflect an updated data item

2016-01-05 Thread Juan Pablo Gardella
I think you need to program it in the start() method in the activity.

On 5 January 2016 at 12:44, Paul Mazzuca  wrote:

> Let's say I have a view with a list of items. When I click on an item I go
> to a new Place and view with details about that item.  In this details
> view, I do some update to the item, then want to return back to the list
> view, but only using the back button on the browser.
>
> If the user clicks the back button on the browser, that would trigger a
> place change event (a History.back() call)  and would return me to the
> list, however, the item in the list would be the stale version of the item,
> rather than the new version I just updated.
>
> How can I pass the updated item to the list when only using the back
> button on the browser, and without reaching out to the server?
>
> --
> You received this message because you are subscribed to the Google Groups
> "GWT Users" 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 https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Activities and Places - Enabling History to reflect an updated data item

2016-01-05 Thread Paul Mazzuca
Let's say I have a view with a list of items. When I click on an item I go 
to a new Place and view with details about that item.  In this details 
view, I do some update to the item, then want to return back to the list 
view, but only using the back button on the browser.  

If the user clicks the back button on the browser, that would trigger a 
place change event (a History.back() call)  and would return me to the 
list, however, the item in the list would be the stale version of the item, 
rather than the new version I just updated.  

How can I pass the updated item to the list when only using the back button 
on the browser, and without reaching out to the server?

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: Activities and Places - Enabling History to reflect an updated data item

2016-01-05 Thread N Troncoso
Juan is correct. If you populate the list in the start() method of the 
activity, that will be called everytime the place corresponding to that 
activity is loaded, so you can refresh it then.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" 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 https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Unit Test for GWT Activities and Places

2014-09-11 Thread VaraKalyan Maddi

Hi All,

I couldn't get much documentation about unit testing for activities and 
places.
Can any one point me an example or an doc for this.


Thanks 
Kalyan

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: Unit Test for GWT Activities and Places

2014-09-11 Thread Thomas Broyer


On Thursday, September 11, 2014 11:46:49 AM UTC+2, VaraKalyan Maddi wrote:


 Hi All,

 I couldn't get much documentation about unit testing for activities and 
 places.
 Can any one point me an example or an doc for this.


Well, there's not much to say.

PlaceTokenizers and ActivityMappers can quite easily be unit-tested.
Activities are a bit different, but you should be able to simulate their 
lifecycle from your test (call start()→mayStop()→onStop(), and/or 
start()→onCancel()). You can use a mock/stub/fake/dummy AcceptsOneWidget 
and a real event bus on which you'll listen to events (you might want to 
use a CountingEventBus).
And to test navigation, you can use mock/stub/fake/dummy 
PlaceController.Delegate and/or PlaceHistoryHandler.Historian.

It all depends on what your activities are doing though, and possibly 
whether you're using MVP in your activities, and in which form (abstracting 
the view behind an interface –you can then mock/stub the view– vs. using 
UiBinder –you can then use GWTMockito from Google). The hardest is to 
mock/stub your data access, so you'd probably better abstract them behind 
interfaces you can easily mock/stub.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: Unit Test for GWT Activities and Places

2014-09-11 Thread Joseph Lust
As Thomas points out, you can test your tokenizers and mappers in JUnit. 
Testing any higher level orchestration between them is more of an 
integration test. I leave these to some basic Selenium smoke tests that 
ensure that navigation between states works correctly.

Joe

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: Activities and Places, how to deal with nested views ?

2014-01-02 Thread V.B.
Also check out Slotted to see if it fits your needs.
https://code.google.com/p/slotted/

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Activities and Places, how to deal with nested views ?

2014-01-01 Thread Ronan Quillevere
I know it might be an old topic, but I have tried to implement thomas idea (
http://tbroyer.posterous.com/gwt-21-activities-nesting-yagni ) in the 
following github project. I will be happy to have some comments/suggestions.

https://github.com/ronanquillevere/GWT-Multi-Activities

Regards

On Wednesday, October 26, 2011 3:09:31 PM UTC+2, Olivier O wrote:

 Dear GWT profesionnals, 

 I try to create an little app who allow users to make search. The main 
 screen contains some inputs and a TabLayoutPanel who contains two set 
 of inputs. 
 The main screen is created with UiBinder and the two containeds into 
 the tabs are also described with UiBinder. I have one activity who 
 manage the screen and perform the search. 

 But now I have to add another search button into the first tab. This 
 search button let the user do a search and complete the inputs. The 
 first solution is to add another callback method to the atcivity 
 doNestedSearchAndFillSubset() but this nestedSearch can prompt the 
 user with an popup panel to select one line from the result set... 

 Is it a way to manage the subSearch view and action with another 
 activity who is nested into the main screen activity ? 

 Thanks

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.


Re: GWT : Activities and Places AND History

2013-08-03 Thread Thomas Broyer
You shouldn't have several PlaceHistoryHandler: there's only one *history*, 
so there should be only one thing handling and managing it.

That said, I've heard people using nested activities, but it's not been 
designed with the use case in mind; 
see http://blog.ltgt.net/gwt-21-activities-nesting-yagni
If you think you really need nesting, then hae a look at GWT-P.

Last thing, I don't understand why you have MainThreePlace subclasses 
rather than just using its name property (e.g. new 
MainThreePlace(SubOnePlace))

On Saturday, August 3, 2013 8:00:17 AM UTC+2, asif...@gmail.com wrote:


 https://lh5.googleusercontent.com/-RSNSAkKbGAk/UfycL4-RLAI/ARM/mMuPIY5ScZo/s1600/ActMap-2.jpg

 I made some minor changes in the code - the main activity mapper looks 
 like this

 if (place instanceof MainTwoPlace)
 {
 return new MainTwoActivity(clientFactory);
 } else if (place instanceof MainThreePlace) {
 return new MainThreeActivity(clientFactory); // this should be 
 handled in the sub-activitymapper - hence return null and do nothing
 } 
 return new MainOneActivity(clientFactory); // if place doesn't 
 match, just drop down to main page

 However, the View 3 now crashes with 
 *
 Caused by: com.google.gwt.core.client.JavaScriptException: 
 (HierarchyRequestError): Node cannot be inserted at the specified point in 
 the hierarchy*

 on line - panel.setWidget(mainThreeDefaultView); in 
 MainThreeActivity Line 31;

 Another picture of my View 3:-




 Now my eventbus, placecontroller and historymapper code in View 3 is as 
 follows:-

 EventBus eventBus = mainClientFactory.getEventbus();
 
 placeController = mainClientFactory.getPlacecontroller();
 

 subActivityMapper = new SubActivityMapper(mainClientFactory);
 subActivityManager = new ActivityManager(subActivityMapper, 
 eventBus);
 //subActivityManager.setDisplay(singleWidgetPanel);
 subActivityManager.setDisplay(contentPanel);
 
 subPlaceHistoryHandler = new 
 PlaceHistoryHandler(mainClientFactory.getMainhistoryMapper());
 subPlaceHistoryHandler.register(placeController, eventBus, new 
 MainThreeSubOnePlace());


 The latest source code is attached here. The previous one can be ignored.

 Any idea where I am going wrong? I know it is in the MainThreeView and the 
 activitymapper somewhere - but a help/hint would be really appreciated.

 Thanks

 On Friday, August 2, 2013 11:58:09 PM UTC-4, asif...@gmail.com wrote:


 https://lh6.googleusercontent.com/-TadxaD9PEvE/Ufx6cxpGibI/AQw/MBD-HZMCVA4/s1600/ActMap.jpg
 Hi Thomas,

 So I tried working out a small prototype:-
 1. The main app has 3 views with corresponding activity and place. The 
 main app also has an activity mapper which handles View 1 and View 2.
 Here is the activitymapper
 if (place instanceof MainTwoPlace)
 {
 return new MainTwoActivity(clientFactory);
 } else if (place instanceof MainThreePlace) {
 return null; // this should be handled in the 
 sub-activitymapper - hence return null and do nothing
 } 
 return new MainOneActivity(clientFactory); // if place doesn't 
 match, just drop down to main page


 2. View 3 has has 3 sub-views with corresponding activity and place. 
 View 3 has a sub-activity mapper which handles sub-view1, sub-view2 and 
 sub-view 3.
 HEre is the sub-activity mapper
 if (place instanceof MainThreePlace) {
 String token = ((MainThreePlace) place).getName();
 if ((token.equals(SubOnePlace)) || 
 (token.equals(MainThreePlace))) {
 return new MainThreeSubOneActivity(mainClientFactory);
 } else if (token.equals(SubTwoPlace)) {
 return new MainThreeSubOneActivity(mainClientFactory);
 } else if (token.equals(SubThreePlace)) {
 return new MainThreeSubOneActivity(mainClientFactory);
 } else {
 return new MainThreeActivity(mainClientFactory);
 }
 
 }else {
 return null;
 }
 Now Switching to place/view 1 and 2 ( in main app ) works fine.

 However switching to place 3  - the application goes into a crazy loop in 
 the getplace / gettoken loop. 

 What I am confused about  - switching to 3 should launch the 
 default/sub-view 1 - but this seems not to work. 

 Could you please help me figure out where I am going wrong? The 
 compressed folder of the entire sources is attached here



 On Thursday, August 1, 2013 6:16:38 PM UTC-4, Thomas Broyer wrote:

 The behavior when called from onModuleLoad is unexpected; but calling 
 PlaceController#goTo in onModuleLoad is also unexpected: 99.9% of the 
 cases, you'll want to call PlaceHistoryHandler#handleCurrentHistory, and 
 possibly set new RootPlace(ChartTest) as the *default place* when 
 initializing the PlaceHistoryHandler.
 There are probably 

Re: GWT : Activities and Places AND History

2013-08-03 Thread asif . tmcp
Awesome !!!. Thanks Thomas

With your pointers, I have managed to work out the example  - it works 
flawlessly now. thanks once again. :)

I read your blog and the related Jira articles as well as the discussion 
regarding the same in the GWT Contributors group. I can see a lot of 
thought going behind the current design.

Coming back to this discussion - I would like to have your frank opinion on 
what is the best possible way to go forward :-
I am designing an app which has a top menu ( corresponding to the 3 main 
views ) and a sub-menu with multiple views attached to the third-main-menu.
I foresee that in future - this app would be ported to a mobile version 
where the 3rd view with sub-view will not be present only in the mobile 
version. The options in front of me - 
1. Stick to this ugly hack version which you helped me to work out with 
nested activity mappers
2. Implement the multiple activity - multiple layout without nesting as 
elaborated in your blog - ( it is clean and elegant, liked it a lot)
3. Go for GWTP - I had a look at it some time back but was reluctant to 
introduce another lib into my app - and now if it is only for nesting I 
would still avoid it .. a bit lazy of me I guess :(

What in your opinion would be the best way forward with future usability in 
mind?

Thanks and Regards,

On Saturday, August 3, 2013 6:13:48 AM UTC-4, Thomas Broyer wrote:

 You shouldn't have several PlaceHistoryHandler: there's only one *history*, 
 so there should be only one thing handling and managing it.

 That said, I've heard people using nested activities, but it's not been 
 designed with the use case in mind; see 
 http://blog.ltgt.net/gwt-21-activities-nesting-yagni
 If you think you really need nesting, then hae a look at GWT-P.

 Last thing, I don't understand why you have MainThreePlace subclasses 
 rather than just using its name property (e.g. new 
 MainThreePlace(SubOnePlace))

 On Saturday, August 3, 2013 8:00:17 AM UTC+2, asif...@gmail.com wrote:


 https://lh5.googleusercontent.com/-RSNSAkKbGAk/UfycL4-RLAI/ARM/mMuPIY5ScZo/s1600/ActMap-2.jpg

 I made some minor changes in the code - the main activity mapper looks 
 like this

 if (place instanceof MainTwoPlace)
 {
 return new MainTwoActivity(clientFactory);
 } else if (place instanceof MainThreePlace) {
 return new MainThreeActivity(clientFactory); // this should 
 be handled in the sub-activitymapper - hence return null and do nothing
 } 
 return new MainOneActivity(clientFactory); // if place doesn't 
 match, just drop down to main page

 However, the View 3 now crashes with 
 *
 Caused by: com.google.gwt.core.client.JavaScriptException: 
 (HierarchyRequestError): Node cannot be inserted at the specified point in 
 the hierarchy*

 on line - panel.setWidget(mainThreeDefaultView); in 
 MainThreeActivity Line 31;

 Another picture of my View 3:-




 Now my eventbus, placecontroller and historymapper code in View 3 is as 
 follows:-

 EventBus eventBus = mainClientFactory.getEventbus();
 
 placeController = mainClientFactory.getPlacecontroller();
 

 subActivityMapper = new SubActivityMapper(mainClientFactory);
 subActivityManager = new ActivityManager(subActivityMapper, 
 eventBus);
 //subActivityManager.setDisplay(singleWidgetPanel);
 subActivityManager.setDisplay(contentPanel);
 
 subPlaceHistoryHandler = new 
 PlaceHistoryHandler(mainClientFactory.getMainhistoryMapper());
 subPlaceHistoryHandler.register(placeController, eventBus, new 
 MainThreeSubOnePlace());


 The latest source code is attached here. The previous one can be ignored.

 Any idea where I am going wrong? I know it is in the MainThreeView and 
 the activitymapper somewhere - but a help/hint would be really appreciated.

 Thanks

 On Friday, August 2, 2013 11:58:09 PM UTC-4, asif...@gmail.com wrote:


 https://lh6.googleusercontent.com/-TadxaD9PEvE/Ufx6cxpGibI/AQw/MBD-HZMCVA4/s1600/ActMap.jpg
 Hi Thomas,

 So I tried working out a small prototype:-
 1. The main app has 3 views with corresponding activity and place. The 
 main app also has an activity mapper which handles View 1 and View 2.
 Here is the activitymapper
 if (place instanceof MainTwoPlace)
 {
 return new MainTwoActivity(clientFactory);
 } else if (place instanceof MainThreePlace) {
 return null; // this should be handled in the 
 sub-activitymapper - hence return null and do nothing
 } 
 return new MainOneActivity(clientFactory); // if place doesn't 
 match, just drop down to main page


 2. View 3 has has 3 sub-views with corresponding activity and place. 
 View 3 has a sub-activity mapper which handles sub-view1, sub-view2 and 
 sub-view 3.
 HEre is the sub-activity mapper
 if (place instanceof MainThreePlace) {
 String token = ((MainThreePlace) place).getName();
  

Re: GWT : Activities and Places AND History

2013-08-02 Thread asif . tmcp
Hi Thomas ,

Thanks for your response. 

I actually have onclickhandlers configured in the onmoduleload and calling 
the change of place in the clickhandlers. So it is in the entry point class 
but not really called from onmoduleload.

Anyways, I would configure an empty prototype with what i want and post it 
here so that we can have an uniform understanding.

Regards

On Thursday, August 1, 2013 6:16:38 PM UTC-4, Thomas Broyer wrote:

 The behavior when called from onModuleLoad is unexpected; but calling 
 PlaceController#goTo in onModuleLoad is also unexpected: 99.9% of the 
 cases, you'll want to call PlaceHistoryHandler#handleCurrentHistory, and 
 possibly set new RootPlace(ChartTest) as the *default place* when 
 initializing the PlaceHistoryHandler.
 There are probably legitimate use cases for calling goTo from 
 onModuleLoad, so if you believe you're in this case, feel free to open an 
 issue in the tracker (don't forget to precise the browser(s) it happens in, 
 and the version of GWT being used).

 On Friday, August 2, 2013 12:07:47 AM UTC+2, asif...@gmail.com wrote:

 Hi,

 I have a small ( :) ) confusion about when does history change fire in an 
 Activities and Places scenario.

 I have an application with left panel and right panel (called RootPlace) 
 with ActivityMapper for each panel as well as for the main view.

 The following call from two different place gives me two different 
 historymapper behaviour.

 *clientFactory.getPlaceController().goTo(new RootPlace(ChartTest));*

 If I call it  from onModuleLoad() the history refreshes the whole page ( 
 essentially onmoduleload is called again).

 If I call it from a clickhandler in the rightpanel RootPlace-View, then 
 the history doesn't refresh the whole page.

 Why should i have two different behaviour?

 What am i missing?

 I can upload the code -but it is part of a big app :(  - time to have a 
 jsfiddle for gwt apps.

 Regards,
 Asif






-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




GWT : Activities and Places AND History

2013-08-01 Thread asif . tmcp
Hi,

I have a small ( :) ) confusion about when does history change fire in an 
Activities and Places scenario.

I have an application with left panel and right panel (called RootPlace) 
with ActivityMapper for each panel as well as for the main view.

The following call from two different place gives me two different 
historymapper behaviour.

*clientFactory.getPlaceController().goTo(new RootPlace(ChartTest));*

If I call it  from onModuleLoad() the history refreshes the whole page ( 
essentially onmoduleload is called again).

If I call it from a clickhandler in the rightpanel RootPlace-View, then 
the history doesn't refresh the whole page.

Why should i have two different behaviour?

What am i missing?

I can upload the code -but it is part of a big app :(  - time to have a 
jsfiddle for gwt apps.

Regards,
Asif




-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: GWT : Activities and Places AND History

2013-08-01 Thread Thomas Broyer
The behavior when called from onModuleLoad is unexpected; but calling 
PlaceController#goTo in onModuleLoad is also unexpected: 99.9% of the 
cases, you'll want to call PlaceHistoryHandler#handleCurrentHistory, and 
possibly set new RootPlace(ChartTest) as the *default place* when 
initializing the PlaceHistoryHandler.
There are probably legitimate use cases for calling goTo from onModuleLoad, 
so if you believe you're in this case, feel free to open an issue in the 
tracker (don't forget to precise the browser(s) it happens in, and the 
version of GWT being used).

On Friday, August 2, 2013 12:07:47 AM UTC+2, asif...@gmail.com wrote:

 Hi,

 I have a small ( :) ) confusion about when does history change fire in an 
 Activities and Places scenario.

 I have an application with left panel and right panel (called RootPlace) 
 with ActivityMapper for each panel as well as for the main view.

 The following call from two different place gives me two different 
 historymapper behaviour.

 *clientFactory.getPlaceController().goTo(new RootPlace(ChartTest));*

 If I call it  from onModuleLoad() the history refreshes the whole page ( 
 essentially onmoduleload is called again).

 If I call it from a clickhandler in the rightpanel RootPlace-View, then 
 the history doesn't refresh the whole page.

 Why should i have two different behaviour?

 What am i missing?

 I can upload the code -but it is part of a big app :(  - time to have a 
 jsfiddle for gwt apps.

 Regards,
 Asif






-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Slotted - A Slot/Nesting Extension to Activities and Places

2013-05-16 Thread V.B.
Fantastic. Thank you!

-- 
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: Slotted - A Slot/Nesting Extension to Activities and Places

2013-05-14 Thread V.B.
Great, thank you! v2 sounds like exactly what we need. Do you have any 
estimate about when you might release v2?

-- 
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: Slotted - A Slot/Nesting Extension to Activities and Places

2013-05-14 Thread Jeffrey Kleiss
I will create a release candidate this weekend, which contains all the
features that will be in the final release.  I will then be working on the
documentation over the next couple months, and then make the final release
once all the documentation is done.


On Tue, May 14, 2013 at 6:56 AM, V.B. vidalborro...@gmail.com wrote:

 Great, thank you! v2 sounds like exactly what we need. Do you have any
 estimate about when you might release v2?

  --
 You received this message because you are subscribed to a topic in the
 Google Groups Google Web Toolkit group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/google-web-toolkit/gP_iZrIZn-o/unsubscribe?hl=en
 .
 To unsubscribe from this group and all its topics, 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.




Re: Slotted - A Slot/Nesting Extension to Activities and Places

2013-05-13 Thread V.B.
Hello,
   Slotted looks very promising. I have a question regarding bookmarking 
and URLs. Does Slotted have a built-in way of representing nested 
activities/places? Specifically, I would like to be able to include in the 
bookmark the current state of all nested activities. I was going to 
implement this myself, but if Slotted can help here I'll just use that 
instead. Also, how well does Slotted lend itself to code-splitting?
Thanks.

-- 
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: Slotted - A Slot/Nesting Extension to Activities and Places

2013-05-13 Thread Jeffrey Kleiss
Slotted v1 has support for URLs for nested Activities with global
parameters.  Meaning the URL will have the list of Activities with slashes
and then have '?' followed by a parameter list (key=value).  I have been
working on another version that allows for parameters to be attached to
specific Activities similar to how the GWT AP does it.  v2 is currently
being used in a new development project.  It feels stable, but I wanted to
give it a little more testing before release.

Currently Slotted doesn't provide support for CodeSplitting, but we are
looking to add that over the next year.  We don't currently have a design
for this, but any code splitting technique for Activities and Place can be
used in Slotted.



On Mon, May 13, 2013 at 5:46 AM, V.B. vidalborro...@gmail.com wrote:

 Hello,
Slotted looks very promising. I have a question regarding bookmarking
 and URLs. Does Slotted have a built-in way of representing nested
 activities/places? Specifically, I would like to be able to include in the
 bookmark the current state of all nested activities. I was going to
 implement this myself, but if Slotted can help here I'll just use that
 instead. Also, how well does Slotted lend itself to code-splitting?
 Thanks.

 --
 You received this message because you are subscribed to a topic in the
 Google Groups Google Web Toolkit group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/google-web-toolkit/gP_iZrIZn-o/unsubscribe?hl=en
 .
 To unsubscribe from this group and all its topics, 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.




Re: DTO as a place constructor parameter in MVP with Activities and Places

2013-02-26 Thread Jens
Its just a matter of taste.

I guess most people only store the database Id inside the place and then 
fetch the data in the activity. If you have multiple activities active at 
the same time you may build a thin layer between your activity and RPC 
mechanism so that only one request is done for a given database id even if 
all active activities request it at the same time. 

Sometimes people fetch the data once and then want to pass it around to 
different activities so they dont need to load it again. In that case you 
would add the database id and the data to the place and then first check if 
data is available and if not fetch it by using the id.
This would be a similar situation to your DTO. The reason why you would 
have both id and data itself in the place is that only the id is used in 
the Tokenizer for the place URL. You most likely don't want all DTO data 
serialized in the URL. Its the same as not having the whole UI state 
serialized in the URL. Only choose the most important parts that gives a 
good result when accessing the URL directly. All other UI state could be 
saved to local sessionStorage (e.g. scrollbar positions, specific textbox 
contents, whatever).
Alternatively you could also add a thin caching mechanism so you don't need 
to put data into the place. Just refetch the data by id from the local 
cache.

I treat the place URL as an ordinary URL for navigation so most times they 
simply look like: menuitem/optional submenuitem/database id of data 
needed/coarse UI state like a Tab or a category that should be selected 
by default. Something like #/employees/1/address would go to the employees 
screen, cause the activity to load employe with ID 1 and then show the 
address tab/category in the UI. Everything else would be stored in local 
sessionStorage.

Personally I think the only URLs that could be very long are URLs that 
represent a search query with lots of search criteria and you want that 
search query to be bookmarkable. Everything else should be fairly short, 
but your mileage may vary.

-- J.


-- 
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: DTO as a place constructor parameter in MVP with Activities and Places

2013-02-26 Thread Craig Hawkins
Thanks for your perspective.  Passing an object ID around certainly seems 
better than serializing the whole data object in the tokenizer, especially 
considering that the data object can be cached.  I read somewhere on a blog 
yesterday where someone chose to implement the presenter in a separate 
object.  The presenter would have access to the model and be available to 
the activity from the global client factory object.  I'll have to get more 
experience before I can properly evaluate this architectural variation. 
 Initially I will keep the presenter and activity together because the 
simplicity is attractive.

Regards
Craig


On Tuesday, February 26, 2013 5:33:43 AM UTC-4, Jens wrote:

 Its just a matter of taste.

 I guess most people only store the database Id inside the place and then 
 fetch the data in the activity. If you have multiple activities active at 
 the same time you may build a thin layer between your activity and RPC 
 mechanism so that only one request is done for a given database id even if 
 all active activities request it at the same time. 

 Sometimes people fetch the data once and then want to pass it around to 
 different activities so they dont need to load it again. In that case you 
 would add the database id and the data to the place and then first check if 
 data is available and if not fetch it by using the id.
 This would be a similar situation to your DTO. The reason why you would 
 have both id and data itself in the place is that only the id is used in 
 the Tokenizer for the place URL. You most likely don't want all DTO data 
 serialized in the URL. Its the same as not having the whole UI state 
 serialized in the URL. Only choose the most important parts that gives a 
 good result when accessing the URL directly. All other UI state could be 
 saved to local sessionStorage (e.g. scrollbar positions, specific textbox 
 contents, whatever).
 Alternatively you could also add a thin caching mechanism so you don't 
 need to put data into the place. Just refetch the data by id from the 
 local cache.

 I treat the place URL as an ordinary URL for navigation so most times they 
 simply look like: menuitem/optional submenuitem/database id of data 
 needed/coarse UI state like a Tab or a category that should be selected 
 by default. Something like #/employees/1/address would go to the employees 
 screen, cause the activity to load employe with ID 1 and then show the 
 address tab/category in the UI. Everything else would be stored in local 
 sessionStorage.

 Personally I think the only URLs that could be very long are URLs that 
 represent a search query with lots of search criteria and you want that 
 search query to be bookmarkable. Everything else should be fairly short, 
 but your mileage may vary.

 -- J.




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




DTO as a place constructor parameter in MVP with Activities and Places

2013-02-25 Thread Craig Hawkins
I have looked at the MVP with Activities and Places examples in the Google 
GWT development docs and tutorials and started creating a simple app.  I am 
now looking at editing an object from a datastore and have a DTO 
representation of the object.  It seems natural to pass this DTO to a place 
constructor as a means to get the data to the activity which also serves as 
the presenter, but I am not confident that this is the intent of the MVP 
with Activities and Places architecture.  I feel like I am missing 
something because the place tokenizer would then be responsible for 
serializing the DTO and any UI state - is this the implied intent of the 
architecture?

How are others implementing this?

-- 
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: Slotted - A Slot/Nesting Extension to Activities and Places

2013-01-25 Thread Alfredo Quiroga
Very cool and extremely useful indeed. So far I have only read the 
documentation, haven't actually used the framework yet but the way this is 
architected/implemented at least at first glance seems to be right on. Would 
not mind it at all if this made its way into GWT core.

Great work, thank you for sharing it.

Sent from my iPhone

On Jan 24, 2013, at 4:52 PM, Jeffrey Kleiss jeffg@gmail.com wrote:

 We have just released the open source project Slotted version 0.1, and we 
 would love to hear your feedback and suggestions on the project.  Slotted can 
 be found here: http://code.google.com/p/slotted/.
 
 Here is a brief description:
 
 Slotted
 
 The Slotted framework is an extension of GWT Activities and Places (AP), 
 which adds the ability to nest Activities inside other Activities. Slotted 
 has retained much of the AP API, and has only changed where needed to 
 support nesting. This allows for easy migration of existing AP projects.
 
 Just like Activities and Places, Slotted is a history management framework 
 that allows you to create bookmarkable URLs within your application, thus 
 allowing the browser's back button and bookmarks to work as users expect. It 
 maybe used in conjunction with MVP development, but is not strictly speaking 
 an MVP framework.
 
 If you haven't seen GWT's Activities and Places, you can read GWT's 
 documentation here: 
 https://developers.google.com/web-toolkit/doc/latest/DevGuideMvpActivitiesAndPlaces
 
 Why Nesting?
 
 GWT's Activities are great, and provide a great flow for page initialization 
 and page navigation. Now imagine a page with a TabPanel. Wouldn't it be great 
 if each Tab was setup like an Activity? Wouldn't it be great to have delayed 
 initialization and navigation checks?
 
 This is why Slotted was created. Slotted allows you to organize your entire 
 site into hierarchy of Activities. You no longer need to manage complex 
 Views/Activities yourself. You can divide these complex pages into many 
 Activities, and allow Slotted to manage the nesting structure and provide 
 nice bookmarkable URLs for these complex views.
 
 Getting Started
 
 Want to get started using Slotted? Take a look at the Overview and 
 MigrateGWTActivitiesPlaces. You can also find code samples here.
 
 
 
 -- 
 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.
 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 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.
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.




Slotted - A Slot/Nesting Extension to Activities and Places

2013-01-24 Thread Jeffrey Kleiss
We have just released the open source project Slotted version 0.1, and we 
would love to hear your feedback and suggestions on the project.  Slotted 
can be found here: http://code.google.com/p/slotted/.

Here is a brief description:

Slotted

The Slotted framework is an extension of GWT Activities and Places (AP), 
which adds the ability to nest Activities inside other Activities. Slotted 
has retained much of the AP API, and has only changed where needed to 
support nesting. This allows for easy migration of existing AP projects.

Just like Activities and Places, Slotted is a history management framework 
that allows you to create bookmarkable URLs within your application, thus 
allowing the browser's back button and bookmarks to work as users expect. 
It maybe used in conjunction with MVP development, but is not strictly 
speaking an MVP framework.

If you haven't seen GWT's Activities and Places, you can read GWT's 
documentation here: 
https://developers.google.com/web-toolkit/doc/latest/DevGuideMvpActivitiesAndPlaces
Why Nesting?

GWT's Activities are great, and provide a great flow for page 
initialization and page navigation. Now imagine a page with a TabPanel. 
Wouldn't it be great if each Tab was setup like an Activity? Wouldn't it be 
great to have delayed initialization and navigation checks?

This is why Slotted was created. Slotted allows you to organize your entire 
site into hierarchy of Activities. You no longer need to manage complex 
Views/Activities yourself. You can divide these complex pages into many 
Activities, and allow Slotted to manage the nesting structure and provide 
nice bookmarkable URLs for these complex views.

Getting Started

Want to get started using Slotted? Take a look at the 
Overviewhttp://code.google.com/p/slotted/wiki/Overview
 and 
MigrateGWTActivitiesPlaceshttp://code.google.com/p/slotted/wiki/MigrateGWTActivitiesPlaces.
 
You can also find code samples 
herehttp://code.google.com/p/slotted/source/browse/#git%2Fexamples
.


-- 
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.
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: Activities and places with MVP approach question

2012-12-05 Thread Daniel Mauricio Patino León
Hi Joseph i am not trying to move the backend things on AP i meant the
actions of the user.

Some user could bookmark the place of edit, create or read  Products,  for
example.

The place and activity per action.

/#Addproduct:
/#Editproduct:1312
/#Readproduct:

or just one place different activities.

/#Product:Read
/#Product:New
/#Product:Edit-1312




2012/11/26 Jesse Hutton jesse.hut...@gmail.com

 I have previously used one activity for C and U, and another for R (and
 D). It basically came down to the fact that the views were mostly the same
 between those pairs, so they could be reused and the activity (and
 presenter) could figure out the details and which controls to show based
 the action information the place (which you can get away with having one
 of). In addition, I also had a list activity for a total of 3 activities
 for each entity type.

 Jesse


 On Sun, Nov 4, 2012 at 1:50 PM, Daniel Mauricio Patino León 
 ceo.lion@gmail.com wrote:

 I recently started a new project usign Activities and palces with mvp.
 Now i have a quiestion of approach.

 Example:

 Employee CRUD

 Activity and place for each operation C, R, U

 One place differente activities for operations C, R, U.

 what you guys suggest to use and why?

 many thanks

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-web-toolkit/-/U7HG3XPNSk8J.
 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.


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




-- 
ISC. Daniel Mauricio Patiño León.
Director ejecutivo
Liondev S.A. de C.V.

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



Re: Activities and places with MVP approach question

2012-11-26 Thread Jesse Hutton
I have previously used one activity for C and U, and another for R (and D).
It basically came down to the fact that the views were mostly the same
between those pairs, so they could be reused and the activity (and
presenter) could figure out the details and which controls to show based
the action information the place (which you can get away with having one
of). In addition, I also had a list activity for a total of 3 activities
for each entity type.

Jesse


On Sun, Nov 4, 2012 at 1:50 PM, Daniel Mauricio Patino León 
ceo.lion@gmail.com wrote:

 I recently started a new project usign Activities and palces with mvp. Now
 i have a quiestion of approach.

 Example:

 Employee CRUD

 Activity and place for each operation C, R, U

 One place differente activities for operations C, R, U.

 what you guys suggest to use and why?

 many thanks

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-web-toolkit/-/U7HG3XPNSk8J.
 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.


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



Best practice to implement hash bang tokens in activities and places keeping @WithTokenizers

2012-11-15 Thread Robert Hoffmann
Hi,

I am currently using:
- PlaceHistoryMapper historyMapper = 
GWT.create(AppPlaceHistoryMapper.class);
- @WithTokenizers({FrontPlace.Tokenizer.class, ...}) on PlaceHistoryMapper

I'd like to use now hash bang tokens for places to support bot crawling. 

What is the best way (minimal change) to do this? 

I am currently using a PlaceHistoryMapper-WRAPPER that adds and understands 
the bang (!).

The PlaceHistoryMapper I pass to this wrapper is created through the old 
process (GWT.create + @WithTokenizers). I've posted the code below for 
clarity.
Note: I like that I can continue to use @WithTokenizers.

Is there a better way to achieve this?

I expected that there would be a flag on @WithTokenizers or another 
annotation to simply switch hash bang tokens, but did find no reference in 
the docs or the web.

Thank you.


  PlaceHistoryMapper historyMapper = 
GWT.create(AppPlaceHistoryMapper.class);
  class PlaceHistoryMapperHashBang implements PlaceHistoryMapper {

   private PlaceHistoryMapper historyMapper;

   PlaceHistoryMapperHashBang(PlaceHistoryMapper historyMapper) {
this.historyMapper = historyMapper;
   }

   @Override
   public Place getPlace(String token) {
Place p=historyMapper.getPlace(token.substring(1));
if(p!=null) return p;
return historyMapper.getPlace(token);
   }

   @Override
   public String getToken(Place place) {
return !+historyMapper.getToken(place);
   }
  }

  PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(new 
PlaceHistoryMapperHashBang(historyMapper));


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/Nrzican0O30J.
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.



Re: Best practice to implement hash bang tokens in activities and places keeping @WithTokenizers

2012-11-15 Thread Thomas Broyer

On Wednesday, November 14, 2012 10:38:50 PM UTC+1, Robert Hoffmann wrote:

 Hi,

 I am currently using:
 - PlaceHistoryMapper historyMapper = 
 GWT.create(AppPlaceHistoryMapper.class);
 - @WithTokenizers({FrontPlace.Tokenizer.class, ...}) on PlaceHistoryMapper

 I'd like to use now hash bang tokens for places to support bot crawling. 

 What is the best way (minimal change) to do this?


Ideally, I'd change the @Prefix annotations to include the !; but you can 
also extend DefaultHistorian, or use your approach, which is fine too (in 
getPlace, instead of unconditionally trying a substring(1), I'd rather 
check with a startsWith(!)).

But that's the easiest part of the #! story…

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/gc6wQgbct5oJ.
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.



Re: Best practice to implement hash bang tokens in activities and places keeping @WithTokenizers

2012-11-15 Thread Robert Hoffmann
Thanks for the quick reply.

Some of my thoughts regarding the different options.

1) @Prefix
- Since the hash bang is part of a a global scheme and the @Prefix a 
personal attribute of a Place, I don't feel comfortable to add it there.

2) Extending DefaultHistorian
- This does not 'force' the developer to use hash bang notation in hrefs 
(i.e. of anchors in UiBinder), and a crawler would miss those links.  

3) Extending PlaceHistoryMapper
- maybe I did actually find a good solution at 2am ;-)
- outlined in the my post above

best -R
 

But that's the easiest part of the #! story…


so true ;-)

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/Qs_EinOopSYJ.
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.



Re: Activities and places with MVP approach question

2012-11-07 Thread Joseph Lust
Why use AP for these backend service actions? Places usually have a name 
token for the URL like #!home, so that they can be mapped to the URL's, 
browser history, and bookmarks, allowing users to return to that Place at a 
future date. I don't think you want the user to bookmark a CRUD operation 
and then trigger it again in the future by returning the URL or hitting the 
Back button on the browser.


Sincerely,
Joseph

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/6uYZqPf-HgYJ.
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.



Activities and places with MVP approach question

2012-11-04 Thread Daniel Mauricio Patino León
I recently started a new project usign Activities and palces with mvp. Now 
i have a quiestion of approach.

Example:

Employee CRUD

Activity and place for each operation C, R, U 

One place differente activities for operations C, R, U.

what you guys suggest to use and why?

many thanks

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/U7HG3XPNSk8J.
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.



Navigation and history support while using activities and places

2012-09-25 Thread Stag


I have an application designed as follows.

It is a travel claim reimburment app. It has two tabs:

1. My Claims : shows all reimbursment claims made so far

2. My Account: showing my details


It has number of claims on the Left and when selected displays Entries on 
the Right.

The picture of the view expected is attached.

https://lh6.googleusercontent.com/-3khQuQYJr7o/UFsrb-nPWYI/AAM/t5dx-0gkhSI/s1600/AppView.png



I have made the following Views.

AppView : for Entire App which has tab panel and tabs

MyAccountsView : for contents under MyAccount Tab.

MyClaims View : for contents under Myclaims Tab. This has two panels. The 
one in left loads with the claims. The right is empty till a claim is 
selected to view.

SelectedClaimView : for panel on the right hand side,which displays the 
claimentries of selected claim..


 Each view has a correponding place and activity.


 These are th following requirements which I am getting difficulty while 
creating my application:


 *When I click on claim on left hand panel the right hand panel must show 
claim entries within selectedClaimView. When I click another claim the list 
must be populated by contents of that claim. I also want history support 
for this claim selection.*


 I am facing following problems while designing:

   1. 
   
   How to add nested activities. e.g. When I select MyClaimsTab all claims 
   must load up in left panel. On Selection of claim the claim entries must 
   load in right panel via selected claims view. However calling an activity 
   and changing the place stops the calling activity.
   2. 
   
   Also Both the activities in both tabs must run simultaneosly and history 
   must be maintained between tab switches. This is something I dont know how 
   to do and would appreciate suggestions.
   
   

 
 
 
  
 

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/6oC1aTielMgJ.
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.

attachment: AppView.png

Re: Designing for testability with MVP and Activities and Places

2012-06-19 Thread Ed


 @Mike: also have a look at this topic, it might give you some idea's:

LINKIEhttps://groups.google.com/forum/#!topic/google-web-toolkit/hwMKmuZv4BI
 

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/hrenD7AIAOgJ.
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.



Re: Designing for testability with MVP and Activities and Places

2012-06-16 Thread Joseph Lust
To add to Peter's comment, the JUnit/GWTTestCase coverage is still 
valuable, despite Selenium, because it allows fast identification of errors 
at an easily identifiable granularity.

For example, on a current GWT project with 1K classes, if a UI automation 
test failed with Selenium, then we know there is a problem, but it could be 
at many layers of our stack. Further, running our 2K Selenium (we use 
Cucumber, but very similar) tests takes two hours. Our developers are not 
going to run this before they checkin. But, our 3K JUnit/GWTTestCase tests 
take only 8 minutes to run. This way we can use features like TeamCity's 
*Pretested 
Commit* and run these tests before allowing a commit, and if a failure 
happens, it's been isolated to the class and method level for quick fixing.

Also note, you can easily test the RPC calls from GWTTestCase, see Asyncronous 
GWTTestCasehttps://developers.google.com/web-toolkit/doc/latest/DevGuideTesting#DevGuideAsynchronousTesting
.


Sincerely,
Joseph

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/qLoEyyiSLHkJ.
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.



Re: Designing for testability with MVP and Activities and Places

2012-06-14 Thread Thomas Broyer


On Thursday, June 14, 2012 6:19:23 AM UTC+2, Mike Dee wrote:

 Have a look at 
 http://www.google.com/events/io/2010/sessions/gwt-continuous-build-testing.html
 The Wave guys came up with a model where the presenter controls the view, 
 so there's no getter; the view calls the presenter back with the values 
 when needed (i.e. your find() method would have the firstname et al. as 
 arguments).


 Useful, thanks.  I think we are doing something along those lines, but I'm 
 not sure we'll stick with.  Still experimenting with testing.
  


 Then a GWTTestCase could be written to call all the setters (which fill 
 in the form fields) and press the Find button (need to add a method to 
 simulate the pressing of the Find button).


 If you assume Google tested the widgets, why are you using a GWTTestCase? 
 Mock the view and use a standard JUnit test case, it'll run so much faster! 


 Your question brings up an issue I struggle with.  I understand the 
 benefits of MVP in terms of testing.  However, I want to test the back-end 
 simultaneously, including GWT-RPC and data queries.  As a result, I think 
 GWTTestCase is needed.


In that case yes, either GWTTestCase or Selenium/WebDriver tests.
But using GWTTestCase you can still create a mock view if it makes things 
easier for you (though I must admit I'd use a mock RPC too in this case, 
and testing data queries separately from GWT); otherwise I think you'd 
have better results with Selenium/WebDriver (see below though).
 

 You may be correct, Selenium is the better way to do that.  I haven't 
 tried Selenium with GWT apps (would be interested in hearing how well and 
 easy it is to work with in terms of GWT).  I've heard it can be difficult, 
 particularly with GWT apps.


I haven't used Selenium/WebDriver either.
The key is to use ensureDebugId on your widgets, and run your tests against 
an app compiled with the com.google.gwt.debug.Debug module (so that 
ensureDebugId is not a no-op).

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/7H9G_T5sGN0J.
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.



Re: Designing for testability with MVP and Activities and Places

2012-06-14 Thread Mike Dee
We probably we go with Selenium.  Someone else (other than me) will 
evaluate that.

I look at MVP + JRE based testing/mocking and I have trouble seeing the 
value.  All of our algorithms and database interactions are pojos and we 
have tons of JUnit tests written (without MVP + JRE tests/mocks).  I ask 
myself if there is much value in doing MVP + JRE based tests/mocks when 
Selenium will exercise those same areas.  Why do double the work?  Maybe I 
don't understand something or need to get used to the idea.

Then I ask myself why do MVP if not doing the MVP+JRE tests/mocks?  Yes, it 
makes the code cleaner, separating business logic from display.  Is that 
enough?

On Thursday, June 14, 2012 2:37:05 AM UTC-7, Thomas Broyer wrote:



 On Thursday, June 14, 2012 6:19:23 AM UTC+2, Mike Dee wrote:

 Have a look at 
 http://www.google.com/events/io/2010/sessions/gwt-continuous-build-testing.html
 The Wave guys came up with a model where the presenter controls the 
 view, so there's no getter; the view calls the presenter back with the 
 values when needed (i.e. your find() method would have the firstname et al. 
 as arguments).


 Useful, thanks.  I think we are doing something along those lines, but 
 I'm not sure we'll stick with.  Still experimenting with testing.
  


 Then a GWTTestCase could be written to call all the setters (which fill 
 in the form fields) and press the Find button (need to add a method to 
 simulate the pressing of the Find button).


 If you assume Google tested the widgets, why are you using a 
 GWTTestCase? Mock the view and use a standard JUnit test case, it'll run so 
 much faster! 


 Your question brings up an issue I struggle with.  I understand the 
 benefits of MVP in terms of testing.  However, I want to test the back-end 
 simultaneously, including GWT-RPC and data queries.  As a result, I think 
 GWTTestCase is needed.


 In that case yes, either GWTTestCase or Selenium/WebDriver tests.
 But using GWTTestCase you can still create a mock view if it makes things 
 easier for you (though I must admit I'd use a mock RPC too in this case, 
 and testing data queries separately from GWT); otherwise I think you'd 
 have better results with Selenium/WebDriver (see below though).
  

 You may be correct, Selenium is the better way to do that.  I haven't 
 tried Selenium with GWT apps (would be interested in hearing how well and 
 easy it is to work with in terms of GWT).  I've heard it can be difficult, 
 particularly with GWT apps.


 I haven't used Selenium/WebDriver either.
 The key is to use ensureDebugId on your widgets, and run your tests 
 against an app compiled with the com.google.gwt.debug.Debug module (so that 
 ensureDebugId is not a no-op).


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/jomcMl99q_wJ.
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.



Re: Designing for testability with MVP and Activities and Places

2012-06-14 Thread Peter Donald
On Fri, Jun 15, 2012 at 7:06 AM, Mike Dee mdichiapp...@gmail.com wrote:
 I look at MVP + JRE based testing/mocking and I have trouble seeing the
 value.  All of our algorithms and database interactions are pojos and we
 have tons of JUnit tests written (without MVP + JRE tests/mocks).  I ask
 myself if there is much value in doing MVP + JRE based tests/mocks when
 Selenium will exercise those same areas.  Why do double the work?  Maybe I
 don't understand something or need to get used to the idea.

Selenium tests are slow to execute and expensive to write. MVP+mock
tests are relatively fast to write and fast to execute but may not
exercise the full stack. It sort of comes dow to when do you use
integration tests and when do you use unit tests.

So it is usually to expensive to get a good level of coverage using
Selenium alone. We try get good coverage using MVP+mock testig and
then reserve selenium tests to exercise a smaller number high value
scenarios


-- 
Cheers,

Peter Donald

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



Re: Designing for testability with MVP and Activities and Places

2012-06-13 Thread Thomas Broyer


On Wednesday, June 13, 2012 2:59:33 AM UTC+2, Mike Dee wrote:


 A couple of questions regarding a test I'd like to perform.  Let's assume 
 that testing occurs with a live database (and GWT-RPC).  I know that 
 contest of the database and what should be returned for certain queries.  
 I'd like to run tests that execute certain queries and make sure they 
 appear in the table (at certain positions).


I'd probably rather use Selenium/WebDriver tests here.
 

 1) How would I test the clicking within the results.  For example, each 
 person's name appears (per row) as a Hyperlink in the results.  This is 
 implemented in a CellTable with Hyperlinks.  Normal behavior is that when 
 the Hyperlink is clicked, GWT goes to the new place.  There is no 
 notification to the activity.  I suppose a ClickHandler could be added, but 
 it would have no usefulness other than testing.  Would it be better to not 
 use a Hyperlink (maybe a Label with a click handler) and add a 
 selectPerson() method to the Presenter.  Then the activity could test the 
 selection and handle the advancing to the new Place?


How can you possibly use a Hyperlink (widget) in a CellTable?!
You might want to handle the click event from within your cell and call 
History.newItem() or PlaceController#goTo() from there (still not 
testable), or use a callback (similar to ButtonCell, ActionCell, or 
ClickableTextCell) where you put the History/PlaceController stuff, or 
route it through the Presenter.
 

 2) I've seen a technique where a Display interface is created within the 
 Presenter.  It contains a list of HasText and HasClickHandlers that 
 conceptually define the View.  It seems pretty fine grained.   Of course, 
 this has the same issue related to Hyperlinks.


Don't do that, if you ever write tests with a mock view, it'll be a pain to 
mock. 

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/0F7Otmrw_FEJ.
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.



Re: Designing for testability with MVP and Activities and Places

2012-06-13 Thread Mike Dee
I got this HyperlinkCell class somewhere and it works pretty good.

public class HyperlinkCell extends AbstractCellHyperlink
{
@Override
public void render( com.google.gwt.cell.client.Cell.Context context, 
Hyperlink h, SafeHtmlBuilder sb )
{
sb.append( SafeHtmlUtils.fromTrustedString( h.toString() ) );
}
}

As I thought about it more I ask myself what do I want to test.  I'd like 
to test that the data in the view is retrieved properly, put into a query 
properly, and that the query works.  I don't need to test that the view 
displays things properly.  I'll assume Google tested its widgets.

Given that, what do you think about this idea for testing?  I got this idea 
by examining the Display interface technique.

Add getters and setters to for each view field.  Using the above example,

public class PersonSearchViewImpl extends ResizeComposite implements 
PersonSearchView
{
public void setFirstname( String firstname )
{
   this.firstname.setText( firstname );
}

public String getFirstname()
{
   firstname.getText();
}
}

Then a GWTTestCase could be written to call all the setters (which fill in 
the form fields) and press the Find button (need to add a method to 
simulate the pressing of the Find button).

On Wednesday, June 13, 2012 3:30:26 AM UTC-7, Thomas Broyer wrote:



 On Wednesday, June 13, 2012 2:59:33 AM UTC+2, Mike Dee wrote:


 A couple of questions regarding a test I'd like to perform.  Let's assume 
 that testing occurs with a live database (and GWT-RPC).  I know that 
 contest of the database and what should be returned for certain queries.  
 I'd like to run tests that execute certain queries and make sure they 
 appear in the table (at certain positions).


 I'd probably rather use Selenium/WebDriver tests here.
  

 1) How would I test the clicking within the results.  For example, each 
 person's name appears (per row) as a Hyperlink in the results.  This is 
 implemented in a CellTable with Hyperlinks.  Normal behavior is that when 
 the Hyperlink is clicked, GWT goes to the new place.  There is no 
 notification to the activity.  I suppose a ClickHandler could be added, but 
 it would have no usefulness other than testing.  Would it be better to not 
 use a Hyperlink (maybe a Label with a click handler) and add a 
 selectPerson() method to the Presenter.  Then the activity could test the 
 selection and handle the advancing to the new Place?


 How can you possibly use a Hyperlink (widget) in a CellTable?!
 You might want to handle the click event from within your cell and call 
 History.newItem() or PlaceController#goTo() from there (still not 
 testable), or use a callback (similar to ButtonCell, ActionCell, or 
 ClickableTextCell) where you put the History/PlaceController stuff, or 
 route it through the Presenter.
  

 2) I've seen a technique where a Display interface is created within the 
 Presenter.  It contains a list of HasText and HasClickHandlers that 
 conceptually define the View.  It seems pretty fine grained.   Of course, 
 this has the same issue related to Hyperlinks.


 Don't do that, if you ever write tests with a mock view, it'll be a pain 
 to mock. 


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/tW8FwX5ZMiUJ.
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.



Re: Designing for testability with MVP and Activities and Places

2012-06-13 Thread Thomas Broyer


On Wednesday, June 13, 2012 11:48:22 PM UTC+2, Mike Dee wrote:

 I got this HyperlinkCell class somewhere and it works pretty good.

 public class HyperlinkCell extends AbstractCellHyperlink
 {
 @Override
 public void render( com.google.gwt.cell.client.Cell.Context context, 
 Hyperlink h, SafeHtmlBuilder sb )
 {
 sb.append( SafeHtmlUtils.fromTrustedString( h.toString() ) );
 }
 }


That's basically equivalent to this lighter-weight version (does not 
construct a DOM object for the Hyperlink widget):

public class LinkCell extends AbstractCellTokenAndLabel {
   interface Templates extends SafeHtmlTemplates {
  @Template(a href='{0}'{1}/a)
  SafeHtml link(SafeUri token, String label);
   }

   private static final Templates TEMPLATE = GWT.create(Templates.class);
   
   @Override
   public voif render(Cell.Context context, TokenAndLabel value, 
SafeHtmlBuilder sb) {
  sb.append(TEMPLATE.template(UriUtils.fromString(# + 
value.getToken()), value.getLabel()));
   }
}
 

 As I thought about it more I ask myself what do I want to test.  I'd like 
 to test that the data in the view is retrieved properly, put into a query 
 properly, and that the query works.  I don't need to test that the view 
 displays things properly.  I'll assume Google tested its widgets.

 Given that, what do you think about this idea for testing?  I got this 
 idea by examining the Display interface technique.

 Add getters and setters to for each view field.  Using the above example,

 public class PersonSearchViewImpl extends ResizeComposite implements 
 PersonSearchView
 {
 public void setFirstname( String firstname )
 {
this.firstname.setText( firstname );
 }

 public String getFirstname()
 {
firstname.getText();
 }
 }


Have a look at 
http://www.google.com/events/io/2010/sessions/gwt-continuous-build-testing.html
The Wave guys came up with a model where the presenter controls the view, 
so there's no getter; the view calls the presenter back with the values 
when needed (i.e. your find() method would have the firstname et al. as 
arguments).

Then a GWTTestCase could be written to call all the setters (which fill in 
 the form fields) and press the Find button (need to add a method to 
 simulate the pressing of the Find button).


If you assume Google tested the widgets, why are you using a GWTTestCase? 
Mock the view and use a standard JUnit test case, it'll run so much faster! 

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/AjuxOwaXUboJ.
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.



Re: Designing for testability with MVP and Activities and Places

2012-06-13 Thread Mike Dee


 Have a look at 
 http://www.google.com/events/io/2010/sessions/gwt-continuous-build-testing.html
 The Wave guys came up with a model where the presenter controls the view, 
 so there's no getter; the view calls the presenter back with the values 
 when needed (i.e. your find() method would have the firstname et al. as 
 arguments).


Useful, thanks.  I think we are doing something along those lines, but I'm 
not sure we'll stick with.  Still experimenting with testing.
 


 Then a GWTTestCase could be written to call all the setters (which fill in 
 the form fields) and press the Find button (need to add a method to 
 simulate the pressing of the Find button).


 If you assume Google tested the widgets, why are you using a GWTTestCase? 
 Mock the view and use a standard JUnit test case, it'll run so much faster! 


Your question brings up an issue I struggle with.  I understand the 
benefits of MVP in terms of testing.  However, I want to test the back-end 
simultaneously, including GWT-RPC and data queries.  As a result, I think 
GWTTestCase is needed.  You may be correct, Selenium is the better way to 
do that.  I haven't tried Selenium with GWT apps (would be interested in 
hearing how well and easy it is to work with in terms of GWT).  I've heard 
it can be difficult, particularly with GWT apps.  

I'm considering if the technique described above could be an alternative to 
many Selenium tests.  It still allows testing in Java (even though it uses 
GWTTestCase).  As a Java programmer, that is very desirable.  Think of how 
easy it would be test a query driven case.  With Java/GWTTestCase the test 
case can drive the query (almost like scripting a view), exercise all the 
mechanics of the query (including the GWT-RPC), and easily check the 
results.  Essentially, all the layers of software are tested.  The only 
thing left out is the actual data entry by the user.

A good point made in the video you mentioned is Google follows a 70/20/10 
rule.  70% of test are micro tests that run quickly and involve no network 
traffice.  10% are big tests, largely GWTTestCase tests.  I guess I'm 
looking at the latter.  These are tests that run by QA to verify the 
product.  Being based on GWTTestCase (and it's being slow) is not that big 
of a deal, if it works better than Selenium.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/y9uGaRn0IGYJ.
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.



Designing for testability with MVP and Activities and Places

2012-06-12 Thread Mike Dee
Here is a simple example that I'm working on.  Input would be appreciated.  
I'm sure there are different approaches, but I'm having trouble finding one 
and having a particular issue with the level of granularity of testing.

I know one answer, in advance, will be to not use GWTTestCase.  I will heed 
that.  But the example below represents a simpler situation where 
GWTTestCase will likely be needed.  So, how would one do this with 
GWTTestCase (assuming the actual case I'll be testing for is a good 
candidate for GWTTestCase)?

I have a basic search form.  It has fields on it like: first name, last 
name, etc.  There is also a Find button.  When the Find button is pressed, 
a list of people matching the criteria appear.  Each row in the list 
(CellTable) has person's name, date of birth, address, etc.   Many items 
are links (Hyperlinks).  For example, the person's name is a Hyperlink 
that, when clicked, goes to a new screen showing the person details.  Basic 
CRUD stuff.

There is a presenter, defined by the view.

public interface PersonSearchView extends IsWidget
{
public void setPresenter( Presenter listener );
public void setData( VectorPersonSearchInfo psinfos );
...

public interface Presenter
{
  /**
 * Find people that match certain criteria.
 * 
 * @return
 */
void findPersons( String firstname, String lastname, int sortBy, 
int start, int cnt );

/**
 * Navigate to a new Place in the browser.
 */
void goTo( Place place );
}
}

The PersonSearchActivity implements the Presenter.

public class PersonSearchActivity extends AbstractActivity implements 
PersonSearchView.Presenter
{
 ...
public void findPersons( String firstname, String lastname, int sortBy, 
int start, int cnt )
{
MyServiceAsync srv = GWT.create( MyService.class );
PersonSearchCallback personSearchCallback = new 
PersonSearchCallback ();
srv .findPersons( firstname, lastname, sortBy, start, cnt, 
personSearchCallback );
}

private class PersonSearchCallback extends 
AsyncCallbackVectorPersonSearchInfo
{
public void onFail( Throwable caught )
{
 caught.printStackTrace();
}

public void onSuccess( VectorPersonSearchInfo results )
{
 clientFactory.getPersonSearchView().setData( results );
}
}
}

The PersonSearchViewImpl has a bunch of test fields on it (firstname, 
lastname, find button, etc) and calls the activities method to actually do 
work.

public class PersonSearchViewImpl extends ResizeComposite implements 
PersonSearchView
{
interface Binder extends UiBinderWidget, PersonSearchViewImpl
{
}

private static final Binder binder = GWT.create( Binder.class );

@UiField TextBox firstname;
@UiField TextBox lastname;
@UiField Button findButton;

/**
 * Handle Search button - do the search.
 */
@UiHandler( findButton )
protected void onFindButtonClick( ClickEvent event ) 
{
...
listener.findPersons( firstname, lastname, sortby, start, cnt );
...
}
}

A couple of questions regarding a test I'd like to perform.  Let's assume 
that testing occurs with a live database (and GWT-RPC).  I know that 
contest of the database and what should be returned for certain queries.  
I'd like to run tests that execute certain queries and make sure they 
appear in the table (at certain positions).

1) How would I test the clicking within the results.  For example, each 
person's name appears (per row) as a Hyperlink in the results.  This is 
implemented in a CellTable with Hyperlinks.  Normal behavior is that when 
the Hyperlink is clicked, GWT goes to the new place.  There is no 
notification to the activity.  I suppose a ClickHandler could be added, but 
it would have no usefulness other than testing.  Would it be better to not 
use a Hyperlink (maybe a Label with a click handler) and add a 
selectPerson() method to the Presenter.  Then the activity could test the 
selection and handle the advancing to the new Place?

2) I've seen a technique where a Display interface is created within the 
Presenter.  It contains a list of HasText and HasClickHandlers that 
conceptually define the View.  It seems pretty fine grained.   Of course, 
this has the same issue related to Hyperlinks.  

Anway, I'd appreciate feedback on various approaches.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/EW14INAHCXIJ.
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.



Re: Selecting list items from history actions using Activities and Places

2012-03-03 Thread Chris Price
Does this line not fire that event for you -

https://github.com/chrisprice/menubodyexample/blob/master/src/com/scottlogic/cprice/menubodyexample/client/menu/Menu.java#L48
On 2 Mar 2012 20:57, Shaun Tarves sh...@tarves.net wrote:

 This worked out fine. However, the obvious issue is that it's pretty hard
 to have anything done in your app BEFORE that initial PlaceChangeEvent
 (say, if you directly go to a specific place via the URL) gets fired.

 My solution was to write the same logic in both a placeChangeHandler and
 on initialization of the menu to select an item.

 Thanks for the help.

 On Thu, Mar 1, 2012 at 12:03 PM, Thomas Broyer t.bro...@gmail.com wrote:



 On Thursday, March 1, 2012 4:54:04 PM UTC+1, Jens wrote:

 Provide a correct equals()/hashcode() implementation in your places as
 mentioned in JavaDoc for Place.java.

 If you don't do so, CachingActivityMapper wont cache anything because it
 also does an oldPlace.equals(newPlace) to see if it can return the cached
 activity.


 ...if you don't do this, you risk an infinite loop... (well, the loop
 should be broken by the SelectionModel, which shouldn't fire an event when
 you don't actually change the selection)

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-web-toolkit/-/9n07mtAs3foJ.

 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.


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


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



Re: Selecting list items from history actions using Activities and Places

2012-03-03 Thread Shaun Tarves
What I meant is that in your app structure, you'll typically have a call to
initBrowserHistory pretty early on. That will fire the initial
placeChangeEvent. When that happens, the activity containing the menu
hasn't event been started yet (or likely instantiated even), so the
placeChange handler isn't available to listen for that event.

That is of course assuming you follow the typical activities/places set up
with multiple activity mappers, etc

- Shaun

On Mar 3, 2012, at 6:26 AM, Chris Price pric...@gmail.com wrote:

Does this line not fire that event for you -

https://github.com/chrisprice/menubodyexample/blob/master/src/com/scottlogic/cprice/menubodyexample/client/menu/Menu.java#L48
On 2 Mar 2012 20:57, Shaun Tarves sh...@tarves.net wrote:

 This worked out fine. However, the obvious issue is that it's pretty hard
 to have anything done in your app BEFORE that initial PlaceChangeEvent
 (say, if you directly go to a specific place via the URL) gets fired.

 My solution was to write the same logic in both a placeChangeHandler and
 on initialization of the menu to select an item.

 Thanks for the help.

 On Thu, Mar 1, 2012 at 12:03 PM, Thomas Broyer t.bro...@gmail.com wrote:



 On Thursday, March 1, 2012 4:54:04 PM UTC+1, Jens wrote:

 Provide a correct equals()/hashcode() implementation in your places as
 mentioned in JavaDoc for Place.java.

 If you don't do so, CachingActivityMapper wont cache anything because it
 also does an oldPlace.equals(newPlace) to see if it can return the cached
 activity.


 ...if you don't do this, you risk an infinite loop... (well, the loop
 should be broken by the SelectionModel, which shouldn't fire an event when
 you don't actually change the selection)

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-web-toolkit/-/9n07mtAs3foJ.

 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.


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

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

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



Re: Selecting list items from history actions using Activities and Places

2012-03-03 Thread Chris Price
I see what you're getting at.

Not that it helps, but that link was meant to be -

https://github.com/chrisprice/menubodyexample/blob/master/src/com/scottlogic/cprice/menubodyexample/client/Menubodyexample.java#L48

i.e. historyHandler.handleCurrentHistory();

On Sat, Mar 3, 2012 at 1:39 PM, Shaun Tarves sh...@tarves.net wrote:
 What I meant is that in your app structure, you'll typically have a call to
 initBrowserHistory pretty early on. That will fire the initial
 placeChangeEvent. When that happens, the activity containing the menu hasn't
 event been started yet (or likely instantiated even), so the placeChange
 handler isn't available to listen for that event.

 That is of course assuming you follow the typical activities/places set up
 with multiple activity mappers, etc

 - Shaun

 On Mar 3, 2012, at 6:26 AM, Chris Price pric...@gmail.com wrote:

 Does this line not fire that event for you -

 https://github.com/chrisprice/menubodyexample/blob/master/src/com/scottlogic/cprice/menubodyexample/client/menu/Menu.java#L48

 On 2 Mar 2012 20:57, Shaun Tarves sh...@tarves.net wrote:

 This worked out fine. However, the obvious issue is that it's pretty hard
 to have anything done in your app BEFORE that initial PlaceChangeEvent (say,
 if you directly go to a specific place via the URL) gets fired.

 My solution was to write the same logic in both a placeChangeHandler and
 on initialization of the menu to select an item.

 Thanks for the help.

 On Thu, Mar 1, 2012 at 12:03 PM, Thomas Broyer t.bro...@gmail.com wrote:



 On Thursday, March 1, 2012 4:54:04 PM UTC+1, Jens wrote:

 Provide a correct equals()/hashcode() implementation in your places as
 mentioned in JavaDoc for Place.java.

 If you don't do so, CachingActivityMapper wont cache anything because it
 also does an oldPlace.equals(newPlace) to see if it can return the cached
 activity.


 ...if you don't do this, you risk an infinite loop... (well, the loop
 should be broken by the SelectionModel, which shouldn't fire an event when
 you don't actually change the selection)

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-web-toolkit/-/9n07mtAs3foJ.

 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.


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

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

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

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



Re: Selecting list items from history actions using Activities and Places

2012-03-03 Thread Shaun Tarves
That's pretty much the same way my app is set up, so you can see the
problem. Like I said, I solved it by essentially repeating the same
code as in the placeChangeHandler in the activity start() method, but
it seems little hokey.

Any ideas how to make this a little cleaner?

- Shaun

On Mar 3, 2012, at 8:50 AM, Chris Price pric...@gmail.com wrote:

 I see what you're getting at.

 Not that it helps, but that link was meant to be -

 https://github.com/chrisprice/menubodyexample/blob/master/src/com/scottlogic/cprice/menubodyexample/client/Menubodyexample.java#L48

 i.e. historyHandler.handleCurrentHistory();

 On Sat, Mar 3, 2012 at 1:39 PM, Shaun Tarves sh...@tarves.net wrote:
 What I meant is that in your app structure, you'll typically have a call to
 initBrowserHistory pretty early on. That will fire the initial
 placeChangeEvent. When that happens, the activity containing the menu hasn't
 event been started yet (or likely instantiated even), so the placeChange
 handler isn't available to listen for that event.

 That is of course assuming you follow the typical activities/places set up
 with multiple activity mappers, etc

 - Shaun

 On Mar 3, 2012, at 6:26 AM, Chris Price pric...@gmail.com wrote:

 Does this line not fire that event for you -

 https://github.com/chrisprice/menubodyexample/blob/master/src/com/scottlogic/cprice/menubodyexample/client/menu/Menu.java#L48

 On 2 Mar 2012 20:57, Shaun Tarves sh...@tarves.net wrote:

 This worked out fine. However, the obvious issue is that it's pretty hard
 to have anything done in your app BEFORE that initial PlaceChangeEvent (say,
 if you directly go to a specific place via the URL) gets fired.

 My solution was to write the same logic in both a placeChangeHandler and
 on initialization of the menu to select an item.

 Thanks for the help.

 On Thu, Mar 1, 2012 at 12:03 PM, Thomas Broyer t.bro...@gmail.com wrote:



 On Thursday, March 1, 2012 4:54:04 PM UTC+1, Jens wrote:

 Provide a correct equals()/hashcode() implementation in your places as
 mentioned in JavaDoc for Place.java.

 If you don't do so, CachingActivityMapper wont cache anything because it
 also does an oldPlace.equals(newPlace) to see if it can return the cached
 activity.


 ...if you don't do this, you risk an infinite loop... (well, the loop
 should be broken by the SelectionModel, which shouldn't fire an event when
 you don't actually change the selection)

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-web-toolkit/-/9n07mtAs3foJ.

 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.


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

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

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

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


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



Re: Selecting list items from history actions using Activities and Places

2012-03-02 Thread Shaun Tarves
This worked out fine. However, the obvious issue is that it's pretty hard
to have anything done in your app BEFORE that initial PlaceChangeEvent
(say, if you directly go to a specific place via the URL) gets fired.

My solution was to write the same logic in both a placeChangeHandler and on
initialization of the menu to select an item.

Thanks for the help.

On Thu, Mar 1, 2012 at 12:03 PM, Thomas Broyer t.bro...@gmail.com wrote:



 On Thursday, March 1, 2012 4:54:04 PM UTC+1, Jens wrote:

 Provide a correct equals()/hashcode() implementation in your places as
 mentioned in JavaDoc for Place.java.

 If you don't do so, CachingActivityMapper wont cache anything because it
 also does an oldPlace.equals(newPlace) to see if it can return the cached
 activity.


 ...if you don't do this, you risk an infinite loop... (well, the loop
 should be broken by the SelectionModel, which shouldn't fire an event when
 you don't actually change the selection)

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-web-toolkit/-/9n07mtAs3foJ.

 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.


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



Re: Selecting list items from history actions using Activities and Places

2012-03-01 Thread Thomas Broyer
Have a look at the Showcase sample's code for the tree view on the left:
http://code.google.com/p/google-web-toolkit/source/browse/trunk/samples/showcase/src/com/google/gwt/sample/showcase/client/Showcase.java#97

On Wednesday, February 29, 2012 9:51:51 PM UTC+1, Shaun Tarves wrote:

 It does, but this is a differrent issue. The selectionmodel needs to be 
 notified of selection somehow if the user isn't selecting with mouse or 
 keyboard. 

 My problem is when the user *navigates* to a state in the app where an 
 item should appear to be selected  - directly via a URL (as supported by 
 activities/places) or using back/forward buttons - rather than by clicking.

 For example, I click an Item in the CellList, the onSelection change 
 handler fires an event to go to a new place. The Item appears 
 selected...all is good. However, when the user clicks the back button, for 
 example, I now need to select a DIFFERENT item in that CellList to 
 represent the last place they were on. The history manager fires some 
 placeChangeEvent that I can listen for. So I attach a handler to that 
 PlaceChangeEvent that tells the list to select and item.

 The problem is that the selection handler, upon being told to select the 
 item representing where I *actually* am, will AGAIN fire the event to go 
 to a new place (as it should). Now, I've got a bad loop.

 I hope that makes the problem clearer. I can't wrap my head around how to 
 make this work.

 - Shaun


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/qZHDWnNPDPMJ.
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.



Re: Selecting list items from history actions using Activities and Places

2012-03-01 Thread Chris Price
I've knocked up a quick example of what I was meaning, I think it
works for all the cases you described. I'd be interested in how your
app is different -

https://github.com/chrisprice/menubodyexample/blob/master/src/com/scottlogic/cprice/menubodyexample/client/menu/Menu.java

(n.b. the instanceof and string equality code is a dirty hack!)

On Wed, Feb 29, 2012 at 8:51 PM, Shaun Tarves sh...@tarves.net wrote:
 It does, but this is a differrent issue. The selectionmodel needs to be
 notified of selection somehow if the user isn't selecting with mouse or
 keyboard.

 My problem is when the user navigates to a state in the app where an item
 should appear to be selected  - directly via a URL (as supported by
 activities/places) or using back/forward buttons - rather than by clicking.

 For example, I click an Item in the CellList, the onSelection change handler
 fires an event to go to a new place. The Item appears selected...all is
 good. However, when the user clicks the back button, for example, I now need
 to select a DIFFERENT item in that CellList to represent the last place they
 were on. The history manager fires some placeChangeEvent that I can listen
 for. So I attach a handler to that PlaceChangeEvent that tells the list to
 select and item.

 The problem is that the selection handler, upon being told to select the
 item representing where I actually am, will AGAIN fire the event to go to a
 new place (as it should). Now, I've got a bad loop.

 I hope that makes the problem clearer. I can't wrap my head around how to
 make this work.

 - Shaun

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-web-toolkit/-/oGLD5HqYR0cJ.

 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.

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



Re: Selecting list items from history actions using Activities and Places

2012-03-01 Thread Jens
You may also want to 
read: 
https://groups.google.com/d/topic/google-web-toolkit/dTwvMbxlFgI/discussion

Its not directly related to your problem but as you are firing place 
changes by listening on the selection model it could happen that your UI 
may gets inconsistent. This can happen if you use Activity.mayStop() to 
provide warning messages and the user chooses to cancel a place change. 
Without considering this case your list will have the new item selected 
(because you clicked on it and CellList updates the selection model) while 
your details view still shows the old item (because the user cancels the 
place change).

-- J.


Am Mittwoch, 29. Februar 2012 14:30:21 UTC+1 schrieb Shaun Tarves:

 Hi all -

 First off, thanks for all the great info on this board. I've gotten so 
 much out of it. However, I'm having a problem I haven't seen addressed 
 before. Here's my scenario:

 1) I have 2 places, 2 separate activity managers/mappers (one for a menu 
 display area and one for content display area).

 2) In the menu area is a basic CellList, with an attached selection 
 handler that fires an event registered on the app's event bus to go to a 
 new place. It also naturally selects the item in the menu.

 Selection of items/going to new places works naturally when the user is 
 clicking around. 

 My problem:

 When any history action is involved (via a direct URL or using 
 back/forward in the browser), how to I handle selecting the appropriate 
 item in the menu?

 The obvious choice is a place change handler in the menu, which, in turn, 
 uses the menu's selection handler to select the appropriate item. BUT, 
 since the selection handler fires an event to go to a new place upon 
 selection, it introduces circular logic. (onPlaceChange does setSelected, 
 then onSelection fires an event to change places)

 It's disconcerting that none of the sample apps (expenses, mobilewebapp) 
 do any kind of item selection when you navigate DIRECTLY to a place via 
 URL, but this seems like a really basic feature of a web application.

 Thoughts?


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/McTGZk-A6DQJ.
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.



Re: Selecting list items from history actions using Activities and Places

2012-03-01 Thread Shaun Tarves
@Thomas - In the example you pointed me to, what prevents this from
essentially creating an infinite loop? OnSelectionChange fires a new
history event. The history handler responds, gets info and changes the
selection, which would in turn fire a new history event. No?

@Chris - I think it's the same situation...your selection handler fires a
new place, which selects and item, which would in turn fire a new place
request. Right?

Am I missing something here?

On Thu, Mar 1, 2012 at 5:14 AM, Jens jens.nehlme...@gmail.com wrote:

 You may also want to read:
 https://groups.google.com/d/topic/google-web-toolkit/dTwvMbxlFgI/discussion

 Its not directly related to your problem but as you are firing place
 changes by listening on the selection model it could happen that your UI
 may gets inconsistent. This can happen if you use Activity.mayStop() to
 provide warning messages and the user chooses to cancel a place change.
 Without considering this case your list will have the new item selected
 (because you clicked on it and CellList updates the selection model) while
 your details view still shows the old item (because the user cancels the
 place change).

 -- J.


 Am Mittwoch, 29. Februar 2012 14:30:21 UTC+1 schrieb Shaun Tarves:

 Hi all -

 First off, thanks for all the great info on this board. I've gotten so
 much out of it. However, I'm having a problem I haven't seen addressed
 before. Here's my scenario:

 1) I have 2 places, 2 separate activity managers/mappers (one for a
 menu display area and one for content display area).

 2) In the menu area is a basic CellList, with an attached selection
 handler that fires an event registered on the app's event bus to go to a
 new place. It also naturally selects the item in the menu.

 Selection of items/going to new places works naturally when the user is
 clicking around.

 My problem:

 When any history action is involved (via a direct URL or using
 back/forward in the browser), how to I handle selecting the appropriate
 item in the menu?

 The obvious choice is a place change handler in the menu, which, in turn,
 uses the menu's selection handler to select the appropriate item. BUT,
 since the selection handler fires an event to go to a new place upon
 selection, it introduces circular logic. (onPlaceChange does setSelected,
 then onSelection fires an event to change places)

 It's disconcerting that none of the sample apps (expenses, mobilewebapp)
 do any kind of item selection when you navigate DIRECTLY to a place via
 URL, but this seems like a really basic feature of a web application.

 Thoughts?

  --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-web-toolkit/-/McTGZk-A6DQJ.

 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.


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



Re: Selecting list items from history actions using Activities and Places

2012-03-01 Thread Chris Price
In my example this is caught by the following in
SingleSelectionManager, which traps setting the selected value to be
itself -
http://code.google.com/codesearch#T04cSGC7sWI/trunk/user/src/com/google/gwt/view/client/SingleSelectionModel.javaq=abstractselectionmodel%20package:http://google-web-toolkit%5C.googlecode%5C.coml=106

However, Jens raises a very good point about the potential downside of
this approach.

Chris

On Thu, Mar 1, 2012 at 2:23 PM, Shaun Tarves sh...@tarves.net wrote:
 @Thomas - In the example you pointed me to, what prevents this from
 essentially creating an infinite loop? OnSelectionChange fires a new history
 event. The history handler responds, gets info and changes the selection,
 which would in turn fire a new history event. No?

 @Chris - I think it's the same situation...your selection handler fires a
 new place, which selects and item, which would in turn fire a new place
 request. Right?

 Am I missing something here?


 On Thu, Mar 1, 2012 at 5:14 AM, Jens jens.nehlme...@gmail.com wrote:

 You may also want to
 read: https://groups.google.com/d/topic/google-web-toolkit/dTwvMbxlFgI/discussion

 Its not directly related to your problem but as you are firing place
 changes by listening on the selection model it could happen that your UI may
 gets inconsistent. This can happen if you use Activity.mayStop() to provide
 warning messages and the user chooses to cancel a place change. Without
 considering this case your list will have the new item selected (because you
 clicked on it and CellList updates the selection model) while your details
 view still shows the old item (because the user cancels the place change).

 -- J.


 Am Mittwoch, 29. Februar 2012 14:30:21 UTC+1 schrieb Shaun Tarves:

 Hi all -

 First off, thanks for all the great info on this board. I've gotten so
 much out of it. However, I'm having a problem I haven't seen addressed
 before. Here's my scenario:

 1) I have 2 places, 2 separate activity managers/mappers (one for a
 menu display area and one for content display area).

 2) In the menu area is a basic CellList, with an attached selection
 handler that fires an event registered on the app's event bus to go to a new
 place. It also naturally selects the item in the menu.

 Selection of items/going to new places works naturally when the user is
 clicking around.

 My problem:

 When any history action is involved (via a direct URL or using
 back/forward in the browser), how to I handle selecting the appropriate item
 in the menu?

 The obvious choice is a place change handler in the menu, which, in turn,
 uses the menu's selection handler to select the appropriate item. BUT, since
 the selection handler fires an event to go to a new place upon selection, it
 introduces circular logic. (onPlaceChange does setSelected, then onSelection
 fires an event to change places)

 It's disconcerting that none of the sample apps (expenses, mobilewebapp)
 do any kind of item selection when you navigate DIRECTLY to a place via URL,
 but this seems like a really basic feature of a web application.

 Thoughts?

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-web-toolkit/-/McTGZk-A6DQJ.

 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.


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

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



Re: Selecting list items from history actions using Activities and Places

2012-03-01 Thread Shaun Tarves
It still seems like an extra event at the very least. User selects, which
fires selection change, which fires new place, which then reselects the
item (the loop ends here since there no selection change would be fired
given that the item is already selected).

BUT, in the case of history movement (back/forward), new place is
requested, place change is fired, which selects item, which fires
selectionchange, which then again goes to new place.

How would you not get an extra item on the history stack with this approach?


On Thu, Mar 1, 2012 at 9:31 AM, Chris Price pric...@gmail.com wrote:

 In my example this is caught by the following in
 SingleSelectionManager, which traps setting the selected value to be
 itself -

 http://code.google.com/codesearch#T04cSGC7sWI/trunk/user/src/com/google/gwt/view/client/SingleSelectionModel.javaq=abstractselectionmodel%20package:http://google-web-toolkit%5C.googlecode%5C.coml=106

 However, Jens raises a very good point about the potential downside of
 this approach.

 Chris

 On Thu, Mar 1, 2012 at 2:23 PM, Shaun Tarves sh...@tarves.net wrote:
  @Thomas - In the example you pointed me to, what prevents this from
  essentially creating an infinite loop? OnSelectionChange fires a new
 history
  event. The history handler responds, gets info and changes the selection,
  which would in turn fire a new history event. No?
 
  @Chris - I think it's the same situation...your selection handler fires a
  new place, which selects and item, which would in turn fire a new place
  request. Right?
 
  Am I missing something here?
 
 
  On Thu, Mar 1, 2012 at 5:14 AM, Jens jens.nehlme...@gmail.com wrote:
 
  You may also want to
  read:
 https://groups.google.com/d/topic/google-web-toolkit/dTwvMbxlFgI/discussion
 
  Its not directly related to your problem but as you are firing place
  changes by listening on the selection model it could happen that your
 UI may
  gets inconsistent. This can happen if you use Activity.mayStop() to
 provide
  warning messages and the user chooses to cancel a place change. Without
  considering this case your list will have the new item selected
 (because you
  clicked on it and CellList updates the selection model) while your
 details
  view still shows the old item (because the user cancels the place
 change).
 
  -- J.
 
 
  Am Mittwoch, 29. Februar 2012 14:30:21 UTC+1 schrieb Shaun Tarves:
 
  Hi all -
 
  First off, thanks for all the great info on this board. I've gotten so
  much out of it. However, I'm having a problem I haven't seen addressed
  before. Here's my scenario:
 
  1) I have 2 places, 2 separate activity managers/mappers (one for a
  menu display area and one for content display area).
 
  2) In the menu area is a basic CellList, with an attached selection
  handler that fires an event registered on the app's event bus to go to
 a new
  place. It also naturally selects the item in the menu.
 
  Selection of items/going to new places works naturally when the user is
  clicking around.
 
  My problem:
 
  When any history action is involved (via a direct URL or using
  back/forward in the browser), how to I handle selecting the
 appropriate item
  in the menu?
 
  The obvious choice is a place change handler in the menu, which, in
 turn,
  uses the menu's selection handler to select the appropriate item. BUT,
 since
  the selection handler fires an event to go to a new place upon
 selection, it
  introduces circular logic. (onPlaceChange does setSelected, then
 onSelection
  fires an event to change places)
 
  It's disconcerting that none of the sample apps (expenses,
 mobilewebapp)
  do any kind of item selection when you navigate DIRECTLY to a place
 via URL,
  but this seems like a really basic feature of a web application.
 
  Thoughts?
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Google Web Toolkit group.
  To view this discussion on the web visit
  https://groups.google.com/d/msg/google-web-toolkit/-/McTGZk-A6DQJ.
 
  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.
 
 
  --
  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.

 --
 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
 

Re: Selecting list items from history actions using Activities and Places

2012-03-01 Thread Chris Price
http://code.google.com/codesearch#T04cSGC7sWI/trunk/user/src/com/google/gwt/place/shared/PlaceController.javaq=placecontroller%20goto%20package:http://google-web-toolkit%5C.googlecode%5C.coml=148

On Thu, Mar 1, 2012 at 2:38 PM, Shaun Tarves sh...@tarves.net wrote:
 It still seems like an extra event at the very least. User selects, which
 fires selection change, which fires new place, which then reselects the
 item (the loop ends here since there no selection change would be fired
 given that the item is already selected).

 BUT, in the case of history movement (back/forward), new place is requested,
 place change is fired, which selects item, which fires selectionchange,
 which then again goes to new place.

 How would you not get an extra item on the history stack with this approach?


 On Thu, Mar 1, 2012 at 9:31 AM, Chris Price pric...@gmail.com wrote:

 In my example this is caught by the following in
 SingleSelectionManager, which traps setting the selected value to be
 itself -

 http://code.google.com/codesearch#T04cSGC7sWI/trunk/user/src/com/google/gwt/view/client/SingleSelectionModel.javaq=abstractselectionmodel%20package:http://google-web-toolkit%5C.googlecode%5C.coml=106

 However, Jens raises a very good point about the potential downside of
 this approach.

 Chris

 On Thu, Mar 1, 2012 at 2:23 PM, Shaun Tarves sh...@tarves.net wrote:
  @Thomas - In the example you pointed me to, what prevents this from
  essentially creating an infinite loop? OnSelectionChange fires a new
  history
  event. The history handler responds, gets info and changes the
  selection,
  which would in turn fire a new history event. No?
 
  @Chris - I think it's the same situation...your selection handler fires
  a
  new place, which selects and item, which would in turn fire a new place
  request. Right?
 
  Am I missing something here?
 
 
  On Thu, Mar 1, 2012 at 5:14 AM, Jens jens.nehlme...@gmail.com wrote:
 
  You may also want to
 
  read: https://groups.google.com/d/topic/google-web-toolkit/dTwvMbxlFgI/discussion
 
  Its not directly related to your problem but as you are firing place
  changes by listening on the selection model it could happen that your
  UI may
  gets inconsistent. This can happen if you use Activity.mayStop() to
  provide
  warning messages and the user chooses to cancel a place change. Without
  considering this case your list will have the new item selected
  (because you
  clicked on it and CellList updates the selection model) while your
  details
  view still shows the old item (because the user cancels the place
  change).
 
  -- J.
 
 
  Am Mittwoch, 29. Februar 2012 14:30:21 UTC+1 schrieb Shaun Tarves:
 
  Hi all -
 
  First off, thanks for all the great info on this board. I've gotten so
  much out of it. However, I'm having a problem I haven't seen addressed
  before. Here's my scenario:
 
  1) I have 2 places, 2 separate activity managers/mappers (one for a
  menu display area and one for content display area).
 
  2) In the menu area is a basic CellList, with an attached selection
  handler that fires an event registered on the app's event bus to go to
  a new
  place. It also naturally selects the item in the menu.
 
  Selection of items/going to new places works naturally when the user
  is
  clicking around.
 
  My problem:
 
  When any history action is involved (via a direct URL or using
  back/forward in the browser), how to I handle selecting the
  appropriate item
  in the menu?
 
  The obvious choice is a place change handler in the menu, which, in
  turn,
  uses the menu's selection handler to select the appropriate item. BUT,
  since
  the selection handler fires an event to go to a new place upon
  selection, it
  introduces circular logic. (onPlaceChange does setSelected, then
  onSelection
  fires an event to change places)
 
  It's disconcerting that none of the sample apps (expenses,
  mobilewebapp)
  do any kind of item selection when you navigate DIRECTLY to a place
  via URL,
  but this seems like a really basic feature of a web application.
 
  Thoughts?
 
  --
  You received this message because you are subscribed to the Google
  Groups
  Google Web Toolkit group.
  To view this discussion on the web visit
  https://groups.google.com/d/msg/google-web-toolkit/-/McTGZk-A6DQJ.
 
  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.
 
 
  --
  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.

 --
 You received this 

Re: Selecting list items from history actions using Activities and Places

2012-03-01 Thread Thomas Broyer

On Thursday, March 1, 2012 3:23:01 PM UTC+1, Shaun Tarves wrote:

 @Thomas - In the example you pointed me to, what prevents this from 
 essentially creating an infinite loop? OnSelectionChange fires a new 
 history event. The history handler responds, gets info and changes the 
 selection, which would in turn fire a new history event. No?


If the value to be selected is the same as the already-selected one, then 
no SelectionChangeEvent is fired.
If the place to go to is the same as the current place, then this is a 
no-op too.

So there's no infinite loop. 

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/EMJeu1Io5yEJ.
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.



Re: Selecting list items from history actions using Activities and Places

2012-03-01 Thread Shaun Tarves
Hi Thomas/Chris -

Thanks for the responses. I was missing the part about the build-in check
for Place equality. Any idea how the equality check is implemented?

For example, if my Place has 2 fields - an integer and a string, is it
implicitly true that 2 places are equal if those values are the same in
both, or do I need to explicitly define an equals() method?


On Thu, Mar 1, 2012 at 10:28 AM, Thomas Broyer t.bro...@gmail.com wrote:


 On Thursday, March 1, 2012 3:23:01 PM UTC+1, Shaun Tarves wrote:

 @Thomas - In the example you pointed me to, what prevents this from
 essentially creating an infinite loop? OnSelectionChange fires a new
 history event. The history handler responds, gets info and changes the
 selection, which would in turn fire a new history event. No?


 If the value to be selected is the same as the already-selected one, then
 no SelectionChangeEvent is fired.
 If the place to go to is the same as the current place, then this is a
 no-op too.

 So there's no infinite loop.

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-web-toolkit/-/EMJeu1Io5yEJ.

 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.


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



Re: Selecting list items from history actions using Activities and Places

2012-03-01 Thread Chris Price
See the highlighted line in the link I posted, or here's the code -

  public void goTo(Place newPlace) {
log().fine(goTo:  + newPlace);

if (getWhere().equals(newPlace)) {
  log().fine(Asked to return to the same place:  + newPlace);
  return;
}

String warning = maybeGoTo(newPlace);
if (warning == null || delegate.confirm(warning)) {
  where = newPlace;
  eventBus.fireEvent(new PlaceChangeEvent(newPlace));
}
  }

On Thu, Mar 1, 2012 at 3:31 PM, Shaun Tarves sh...@tarves.net wrote:
 Hi Thomas/Chris -

 Thanks for the responses. I was missing the part about the build-in check
 for Place equality. Any idea how the equality check is implemented?

 For example, if my Place has 2 fields - an integer and a string, is it
 implicitly true that 2 places are equal if those values are the same in
 both, or do I need to explicitly define an equals() method?


 On Thu, Mar 1, 2012 at 10:28 AM, Thomas Broyer t.bro...@gmail.com wrote:


 On Thursday, March 1, 2012 3:23:01 PM UTC+1, Shaun Tarves wrote:

 @Thomas - In the example you pointed me to, what prevents this from
 essentially creating an infinite loop? OnSelectionChange fires a new history
 event. The history handler responds, gets info and changes the selection,
 which would in turn fire a new history event. No?


 If the value to be selected is the same as the already-selected one, then
 no SelectionChangeEvent is fired.
 If the place to go to is the same as the current place, then this is a
 no-op too.

 So there's no infinite loop.

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-web-toolkit/-/EMJeu1Io5yEJ.

 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.


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

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



Re: Selecting list items from history actions using Activities and Places

2012-03-01 Thread Shaun Tarves
I saw that...I meant in my specific Place class. Is it best practice to
explicitly implement my own equals() method even if the standard
Object.equals would suffice?

Do you see any advantage?

Furthermore, how does this relate to the cachedActivityMapper? I read in a
post on this board somewhere that's it's better to implement the
cached/filtered mappers rather than override equals(). Thoughts on this?


On Thu, Mar 1, 2012 at 10:34 AM, Chris Price pric...@gmail.com wrote:

 See the highlighted line in the link I posted, or here's the code -

  public void goTo(Place newPlace) {
log().fine(goTo:  + newPlace);

if (getWhere().equals(newPlace)) {
  log().fine(Asked to return to the same place:  + newPlace);
  return;
}

String warning = maybeGoTo(newPlace);
if (warning == null || delegate.confirm(warning)) {
  where = newPlace;
  eventBus.fireEvent(new PlaceChangeEvent(newPlace));
 }
  }

 On Thu, Mar 1, 2012 at 3:31 PM, Shaun Tarves sh...@tarves.net wrote:
  Hi Thomas/Chris -
 
  Thanks for the responses. I was missing the part about the build-in check
  for Place equality. Any idea how the equality check is implemented?
 
  For example, if my Place has 2 fields - an integer and a string, is it
  implicitly true that 2 places are equal if those values are the same in
  both, or do I need to explicitly define an equals() method?
 
 
  On Thu, Mar 1, 2012 at 10:28 AM, Thomas Broyer t.bro...@gmail.com
 wrote:
 
 
  On Thursday, March 1, 2012 3:23:01 PM UTC+1, Shaun Tarves wrote:
 
  @Thomas - In the example you pointed me to, what prevents this from
  essentially creating an infinite loop? OnSelectionChange fires a new
 history
  event. The history handler responds, gets info and changes the
 selection,
  which would in turn fire a new history event. No?
 
 
  If the value to be selected is the same as the already-selected one,
 then
  no SelectionChangeEvent is fired.
  If the place to go to is the same as the current place, then this is a
  no-op too.
 
  So there's no infinite loop.
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Google Web Toolkit group.
  To view this discussion on the web visit
  https://groups.google.com/d/msg/google-web-toolkit/-/EMJeu1Io5yEJ.
 
  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.
 
 
  --
  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.

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



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



Re: Selecting list items from history actions using Activities and Places

2012-03-01 Thread Jens
Provide a correct equals()/hashcode() implementation in your places as 
mentioned in JavaDoc for Place.java.

If you don't do so, CachingActivityMapper wont cache anything because it 
also does an oldPlace.equals(newPlace) to see if it can return the cached 
activity.

-- J.


Am Donnerstag, 1. März 2012 16:40:51 UTC+1 schrieb Shaun Tarves:

 I saw that...I meant in my specific Place class. Is it best practice to 
 explicitly implement my own equals() method even if the standard 
 Object.equals would suffice?

 Do you see any advantage?

 Furthermore, how does this relate to the cachedActivityMapper? I read in a 
 post on this board somewhere that's it's better to implement the 
 cached/filtered mappers rather than override equals(). Thoughts on this?


 On Thu, Mar 1, 2012 at 10:34 AM, Chris Price pric...@gmail.com wrote:

 See the highlighted line in the link I posted, or here's the code -

  public void goTo(Place newPlace) {
log().fine(goTo:  + newPlace);

if (getWhere().equals(newPlace)) {
  log().fine(Asked to return to the same place:  + newPlace);
  return;
}

String warning = maybeGoTo(newPlace);
if (warning == null || delegate.confirm(warning)) {
  where = newPlace;
  eventBus.fireEvent(new PlaceChangeEvent(newPlace));
 }
  }

 On Thu, Mar 1, 2012 at 3:31 PM, Shaun Tarves sh...@tarves.net wrote:
  Hi Thomas/Chris -
 
  Thanks for the responses. I was missing the part about the build-in 
 check
  for Place equality. Any idea how the equality check is implemented?
 
  For example, if my Place has 2 fields - an integer and a string, is it
  implicitly true that 2 places are equal if those values are the same in
  both, or do I need to explicitly define an equals() method?
 
 
  On Thu, Mar 1, 2012 at 10:28 AM, Thomas Broyer t.bro...@gmail.com 
 wrote:
 
 
  On Thursday, March 1, 2012 3:23:01 PM UTC+1, Shaun Tarves wrote:
 
  @Thomas - In the example you pointed me to, what prevents this from
  essentially creating an infinite loop? OnSelectionChange fires a new 
 history
  event. The history handler responds, gets info and changes the 
 selection,
  which would in turn fire a new history event. No?
 
 
  If the value to be selected is the same as the already-selected one, 
 then
  no SelectionChangeEvent is fired.
  If the place to go to is the same as the current place, then this is a
  no-op too.
 
  So there's no infinite loop.
 
  --
  You received this message because you are subscribed to the Google 
 Groups
  Google Web Toolkit group.
  To view this discussion on the web visit
  https://groups.google.com/d/msg/google-web-toolkit/-/EMJeu1Io5yEJ.
 
  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.
 
 
  --
  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.

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




-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/QdFsGvp7AOYJ.
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.



Re: Selecting list items from history actions using Activities and Places

2012-03-01 Thread Thomas Broyer


On Thursday, March 1, 2012 4:54:04 PM UTC+1, Jens wrote:

 Provide a correct equals()/hashcode() implementation in your places as 
 mentioned in JavaDoc for Place.java.

 If you don't do so, CachingActivityMapper wont cache anything because it 
 also does an oldPlace.equals(newPlace) to see if it can return the cached 
 activity.


...if you don't do this, you risk an infinite loop... (well, the loop 
should be broken by the SelectionModel, which shouldn't fire an event when 
you don't actually change the selection)

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/9n07mtAs3foJ.
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.



Selecting list items from history actions using Activities and Places

2012-02-29 Thread Shaun Tarves
Hi all -

First off, thanks for all the great info on this board. I've gotten so much 
out of it. However, I'm having a problem I haven't seen addressed before. 
Here's my scenario:

1) I have 2 places, 2 separate activity managers/mappers (one for a menu 
display area and one for content display area).

2) In the menu area is a basic CellList, with an attached selection handler 
that fires an event registered on the app's event bus to go to a new place. 
It also naturally selects the item in the menu.

Selection of items/going to new places works naturally when the user is 
clicking around. 

My problem:

When any history action is involved (via a direct URL or using back/forward 
in the browser), how to I handle selecting the appropriate item in the menu?

The obvious choice is a place change handler in the menu, which, in turn, 
uses the menu's selection handler to select the appropriate item. BUT, 
since the selection handler fires an event to go to a new place upon 
selection, it introduces circular logic. (onPlaceChange does setSelected, 
then onSelection fires an event to change places)

It's disconcerting that none of the sample apps (expenses, mobilewebapp) do 
any kind of item selection when you navigate DIRECTLY to a place via URL, 
but this seems like a really basic feature of a web application.

Thoughts?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/kLEBTO6gJuIJ.
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.



Re: Selecting list items from history actions using Activities and Places

2012-02-29 Thread Chris Price
I thought singleselectionmodel swallowed setting the selected value to
itself?
On 29 Feb 2012 16:29, Shaun Tarves sh...@tarves.net wrote:

 Hi all -

 First off, thanks for all the great info on this board. I've gotten so
 much out of it. However, I'm having a problem I haven't seen addressed
 before. Here's my scenario:

 1) I have 2 places, 2 separate activity managers/mappers (one for a menu
 display area and one for content display area).

 2) In the menu area is a basic CellList, with an attached selection
 handler that fires an event registered on the app's event bus to go to a
 new place. It also naturally selects the item in the menu.

 Selection of items/going to new places works naturally when the user is
 clicking around.

 My problem:

 When any history action is involved (via a direct URL or using
 back/forward in the browser), how to I handle selecting the appropriate
 item in the menu?

 The obvious choice is a place change handler in the menu, which, in turn,
 uses the menu's selection handler to select the appropriate item. BUT,
 since the selection handler fires an event to go to a new place upon
 selection, it introduces circular logic. (onPlaceChange does setSelected,
 then onSelection fires an event to change places)

 It's disconcerting that none of the sample apps (expenses, mobilewebapp)
 do any kind of item selection when you navigate DIRECTLY to a place via
 URL, but this seems like a really basic feature of a web application.

 Thoughts?

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-web-toolkit/-/kLEBTO6gJuIJ.
 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.


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



Re: Selecting list items from history actions using Activities and Places

2012-02-29 Thread Shaun Tarves
It does, but this is a differrent issue. The selectionmodel needs to be 
notified of selection somehow if the user isn't selecting with mouse or 
keyboard. 

My problem is when the user *navigates* to a state in the app where an item 
should appear to be selected  - directly via a URL (as supported by 
activities/places) or using back/forward buttons - rather than by clicking.

For example, I click an Item in the CellList, the onSelection change 
handler fires an event to go to a new place. The Item appears 
selected...all is good. However, when the user clicks the back button, for 
example, I now need to select a DIFFERENT item in that CellList to 
represent the last place they were on. The history manager fires some 
placeChangeEvent that I can listen for. So I attach a handler to that 
PlaceChangeEvent that tells the list to select and item.

The problem is that the selection handler, upon being told to select the 
item representing where I *actually* am, will AGAIN fire the event to go to 
a new place (as it should). Now, I've got a bad loop.

I hope that makes the problem clearer. I can't wrap my head around how to 
make this work.

- Shaun

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/oGLD5HqYR0cJ.
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.



Re: too much code: GWT Development with Activities and Places

2011-12-14 Thread David Vree

On Friday, September 23, 2011 1:48:18 PM UTC-4, Thomas Broyer wrote:

 Did almost the same, but as a Maven plugin that scans the classpath for 
 classes extending a few base classes.
 The only thing I regret: it's part of the build process, so proxies are 
 recreated each time, and therefore cannot be tweaked; which means that if 
 something needs to be tweaked, it has to be done at the code generator 
 level.
 In retrospect, I'd rather have a one shot process: generate source code 
 so you can tweak it; and when you change your domain model, either you 
 update the proxies by hand, or you re-generate them. And because the 
 sources would be checked in SVN/Git/whatever, you could easily merge/ignore 
 the changes you made that the generator would have cancelled. In other 
 words, similar to what the GPE can do in RequestFactory/AppEngine projects.


Thomas -- You can have the best of both worlds by using the generation 
gap pattern.  This is a technique we used very successfully in the Flex 
world via the GraniteDS GAS3 code generator.  The idea is that you always 
generate the base classes on every build, but you also generate the 
concrete classes once.   What is key is that the next level base inherits 
from the previous level concrete!!  Thus your manual tweaks are persisted 
and you still get regeneration on every build...it was pure awesome!

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/JBw7w2ueuagJ.
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.



Re: too much code: GWT Development with Activities and Places

2011-12-14 Thread Ed
 You can have the best of both worlds by using the generation gap pattern
Yep, that is nice way of doing that. 
Also MyEclipse for Spring of MyEclipse, that generates a Spring backend 
uses this technique.


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/B5xYsPAEj6kJ.
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.



Re: too much code: GWT Development with Activities and Places

2011-12-14 Thread Elhanan
i believe the the very nature of GWT's JRE emulation to javascript with 
combination with java's lack of closures, is the one causes the large code 
base. 
this is because the style of writing itself is extremely different then 
regular java writing.

take for example the mandate to write every function call to a server 
(RPC,JSON,RF etc..) as asynchronous, in other frameworks, you would have no 
calls to the server, just page reloads, (or jsp forwards), so it not 
exactly you gave much thought to actual process of calling a server 
resource, you just did it, it's like blinking, try to focus on each time 
you blink and becomes very annoying.

add to that, that for each AsyncCallBack you have to write 
an anonymous class (a poor standin for closures, which java scripts DOES 
have), and you get even MORE code. 

and speaking of server client, communication, because of the JRE emulation, 
you discover on many instances you can't really reuse some of the code or 
models you wrote on the server as they contain features which are not 
present client side, and the ONLY way to have some sort of linkage between 
the 2 sides is via use of annotations, so once again, something you took 
for granted, comes right back at ya.

so now you have to double the code for client server models, and use crap 
load amount of brackets just for fun of it. 

and when you try to reuse using generics , you find out the hard way that 
in some cases you have go through lots of hoops just to get that working 
right, once again because of the nature of GWT compile process.

so in a sense one might say that programming java in gwt, is unlike 
programming in other web frameworks, although the syntax is the same, you 
have to un-learn something you got used to over the years. 

so far i see that the current trend is to create generators for the 
boilerplate codes, via annotations, either to domain models or proxies, and 
i think that at least to make the work more streamlined google should 
(off-course) fix major bugs, but also load the GPE with a whole lot more of 
wizards, generators, re-factoring tools, to bridge this gap 
between regular java and gwt java, i mean it doesn't even have a wizard for 
creating RPC's  not to mention other calls like request factory. 
not to mention to COMPLETE lack of ide support the module xml file , but 
that's another rant entirely. 

and although i took a look at MVP4G and the likes, the problem is they were 
created prior to activities and places, so if you that with the current 
gwt, you actually have 2 frameworks for mvp.

also places don't really replace history, i think they actually use it 
behind the scenes.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/PEmTMp1P0iAJ.
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.



Re: too much code: GWT Development with Activities and Places

2011-12-13 Thread Riley
I use MVP straight out of the Google videos and docs, and I love it. When I 
need to swap a view in or out, or change a url structure, or change a bit 
of communication with the server, I go strictly to the 1-2 files involved, 
make the changes I need, and never fear that some hidden bug will appear 
somewhere else.  The Places/Activity framework works beautifully, and gives 
me the flexibility to navigate programmatically in response to events 
without having to put History-manipulating code anywhere but in my 
PlaceController.  We've got 46,000 lines of GWT code running now, and it's 
easy to debug, easy to maintain, and is really delivering on the 
cross-browser compatibility promise.

What I love about GWT is how loosely coupled the different frameworks are. 
 I started out with GWT-RPC, and then moved to RequestFactory.  Then I 
wanted to switch to a plain JSON format so that the API could be usable to 
others w/o RF, and so I chucked most of RF... but I could still use parts 
of it like AutoBean to make parsing a snap!  If I have to pay for this 
modularity with 3x the code size, I'll do it - I'm a one-man dev team and 
GWT helped me launch a complex data-processing app in a few months.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/3W0KCPXKhGwJ.
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.



Re: Activities and Places - Ant compilation

2011-12-02 Thread Jeanpylone
My Bad!!!
Sorry, I think I should sleep longer sometimes...
In fact I was doing it right (class compiled before gwt compile and so on 
...) But my pathelement to class files was just wrong!

Thank you all for your answers !

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/FGDrGZwZME4J.
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.



Activities and Places - Ant compilation

2011-12-01 Thread Jeanpylone
Hi there!

Is there some special flag/classpath to add when a GWT project using 
Activities and Places is compiled with Ant?
While it is compiling successfully with the GPE compilation, it fails under 
Ant with a stacktrace like this:

 

  [java] Compiling module test.MainModule

 [java]Resolving test.client.mapping.AppPlaceHistoryMapper

 [java]   Found type 'test.client.mapping.AppPlaceHistoryMapper'

 [java]  [ERROR] Annotation error: cannot resolve 
 test.client.places.HomePlace$HomePlaceTokenizer

 [java] java.lang.ClassNotFoundException: 
 test.client.places.HomePlace$HomePlaceTokenizer

 [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

 [java] ...

 [java] at com.google.gwt.dev.Compiler.main(Compiler.java:177)

 [java]  [ERROR] Annotation error: expected class 
 java.lang.Class, got null

 [java]  [ERROR] Annotation error: cannot resolve 
 test.client.places.ListPlace$ListPlaceTokenizer

 [java] java.lang.ClassNotFoundException: 
 test.client.places.ListPlace$ListPlaceTokenizer

 [java] at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

 [java] ...

 [java] at com.google.gwt.dev.Compiler.main(Compiler.java:177)

 [java]  [ERROR] Annotation error: expected class 
 java.lang.Class, got null

 [java]Scanning for additional dependencies: 
 file:/test/client/MainModule.java

 [java]   Computing all possible rebind results for 
 'test.client.mapping.AppPlaceHistoryMapper'

 [java]  Rebinding test.client.mapping.AppPlaceHistoryMapper

 [java] Invoking generator 
 com.google.gwt.place.rebind.PlaceHistoryMapperGenerator

 [java][ERROR] Generator 
 'com.google.gwt.place.rebind.PlaceHistoryMapperGenerator' threw an 
 exception while rebinding 'test.client.mapping.AppPlaceHistoryMapper'

 [java] java.lang.NullPointerException

 [java] at 
 com.google.gwt.place.rebind.PlaceHistoryGeneratorContext.getWithTokenizerEntries(PlaceHistoryGeneratorContext.java:285)

 [java] ...

 [java] at com.google.gwt.dev.Compiler.main(Compiler.java:177)

 [java]   [WARN] For the following type(s), generated source was 
 never committed (did you forget to call commit()?)

 [java]  [WARN] test.client.mapping.AppPlaceHistoryMapperImpl

 [java][ERROR] Errors in 'file:/test/client/MainModule.java'

 [java]   [ERROR] Line 33:  Failed to resolve 
 'test.client.mapping.AppPlaceHistoryMapper' via deferred binding

 [java][ERROR] Cannot proceed due to previous errors



Any idea will be appreciated :)


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/igBfAXtGZysJ.
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.



Re: Activities and Places - Ant compilation

2011-12-01 Thread Ashton Thomas
I think the problem is in your application code and not an issue with a 
flag or adding anything to the classpath. Can you include your Mapper and 
Place(s) files?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/M8M4PKAEPMsJ.
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.



Re: Activities and Places - Ant compilation

2011-12-01 Thread Thomas Broyer
Well, if it compiles with the GPE, it's likely an issue with the Ant script, 
right?

It looks like the client-side classes haven't been compiled (javac) or that the 
output from javac is not in the classpath for the GWT compiler.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/brdPqJ4_6usJ.
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.



Re: Activities and Places - Ant compilation

2011-12-01 Thread Ashton Thomas
My bad, I didn't read that part.. damn..

On Dec 1, 7:35 pm, Thomas Broyer t.bro...@gmail.com wrote:
 Well, if it compiles with the GPE, it's likely an issue with the Ant script, 
 right?

 It looks like the client-side classes haven't been compiled (javac) or that 
 the output from javac is not in the classpath for the GWT compiler.

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



Re: Activities and Places - Ant compilation

2011-12-01 Thread Karthik Reddy
*Classes referenced from annotations have to be compiled for GWT to be 
able to process them from within generators (as is the case for 
@WithTokenizers on a PlaceHistoryMapper).*

See  
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/e0209e0e57e1152b


--
Karthik Reddy
https://plus.google.com/103243388366746199136

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/7i7qRxE42hYJ.
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.



Re: Best practives to work with complex tokens with Activities and Places (MVP)

2011-11-25 Thread l3dx
I'm also very interested in this. Not necessarily adding actions to
tokens, but I guess it relates. I'm wondering how I should work with
tokens built up from several parameters.

~ l3dx$

On Nov 18, 11:12 am, Andrew Uglev andrew.ug...@gmail.com wrote:
 Hi! I read a lot about MVP,tokens, places but still newbie and need
 an advise about complex token strategy.
 For example I have a Book object (that has its activity,place, view).
 The book can be shown, edited and commented by its ID. The token need
 to be switched to smth like
 #bookPlace:234/show
 #bookPlace:234/edit
 #bookPlace:234/comment

 Switching to edit and add comment need to be done without reloading
 object (I mean that something like  getPlaceController().goTo(new
 BookPlace(edit)) will reload the object)

 To switch to comment state of book's view without reloading I'm
 trying to use
 History.newItem(History.getToken() + /comment, false);  // token
 goes to #bookPlace:234/comment, the view displays comment input form

 To properly display  #bookPlace:234/comment token In the Book activity
 constructor I need parse the token using something like:
 String[] tokenPath =place.getPlaceName().split(/);
 this.bookID = tokenPath[0];
 this.action = tokenPath[1];

 Are there some helper classes to parse and map complextokens? Am I
 right using  History.newItem(History.getToken() + /comment, false);
 to add actions to token?

 Any links on the best complextokensimplementation with Places and
 Activities are welcome.

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



Re: Best practives to work with complex tokens with Activities and Places (MVP)

2011-11-25 Thread Thomas Broyer


On Friday, November 18, 2011 11:12:58 AM UTC+1, Andrew Uglev wrote:

 Hi! I read a lot about MVP, tokens, places but still newbie and need 
 an advise about complex token strategy. 
 For example I have a Book object (that has its activity, place, view). 
 The book can be shown, edited and commented by its ID. The token need 
 to be switched to smth like 
 #bookPlace:234/show 
 #bookPlace:234/edit 
 #bookPlace:234/comment 

 Switching to edit and add comment need to be done without reloading 
 object (I mean that something like  getPlaceController().goTo(new 
 BookPlace(edit)) will reload the object)


It only reloads the object if your code reloads the object. It depends 
whether you reuse activities and/or switch their state on the go, and 
whether you use some kind of caching for your objects.
You could, for instance, return the very same activity instance but switch 
the activity to an edit (or comment, or view) state depending on the 
place. I wouldn't do that because it adds state to the activity, which can 
lead to complex activities that are hard to test and to maintain.
Or you could simply use some caching for your objects, so that even if you 
start a new EditBookActivity you can use the same Book instance as the one 
you used second before in the ViewBookActivity, without reaching the server.

For my part, I'd reload the object from the server (to have the freshest 
possible data), until it's proved to be a performance issue that needs 
solving; and then only add some caching or use more complex activities (how 
about a BookActivity that wraps the previous ViewBookActivity, 
EditBookActivity and CommentBookActivity, to switch them –mimicking an 
ActivityManager, re. activities' lifecycle– easily while providing them a 
cached Book entity?)

That's what we're doing ATM, and we haven't heard any negative feedback 
about performance (actually, even if that was the case, we couldn't do much 
about it, because going from view to edit in our case involves making a 
checkout and a lock on the server-side: the entity is either in view or 
edit mode, which drives the UI; it's not just a UI choice).
 

 To switch to comment state of book's view without reloading I'm 
 trying to use 
 History.newItem(History.getToken() + /comment, false);  // token 
 goes to #bookPlace:234/comment, the view displays comment input form 

 To properly display  #bookPlace:234/comment token In the Book activity 
 constructor I need parse the token using something like: 
 String[] tokenPath = place.getPlaceName().split(/); 
 this.bookID = tokenPath[0]; 
 this.action = tokenPath[1]; 

 Are there some helper classes to parse and map complex tokens?


No, but the parsing should be done in a PlaceTokenizer, not in activities. 
Your BookPlace should have two fields: bookId and action, and its 
PlaceTokenizer builds a bookId/action token and similarly parses it. 
You activities just see a BookPlace with two fields.
That way, you can easily change your tokens at any time (e.g. switch 
bookId;action=action or bookId:action for instance), without 
changing anything in your activities, only the PlaceTokenizer responsible 
for the BookPlace. Separation of concerns FTW!

Apart from that, no, there's no helper class in GWT: you're free to use any 
kind of token you want, and you're responsible for parsing and serializing 
them to/from places.
 

 Am I 
 right using  History.newItem(History.getToken() + /comment, false); 
 to add actions to token?


No.

If you need to change place, use PlaceController.goTo.
If you don't want a new activity, have your ActivityManager return the very 
same instance; that way it won't be onStop()ed and start()ed again, but 
simply reused as is (it won't even be notified of the place change, listen 
to the PlaceChangeEvent from within your Activity if you need to).
If you don't want to reach your server to get an object from its ID, use a 
cache.

Using History.newItem that way, you're dependent upon your tokens' format, 
and if you have another ActivityManager that would need to be notified of 
the change (maybe you don' t have one right now, but you could have a need 
later on), it won't be.
PlaceController.goTo is the way to go here.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/JJcClisInRoJ.
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.



Best practives to work with complex tokens with Activities and Places (MVP)

2011-11-18 Thread Andrew Uglev
Hi! I read a lot about MVP, tokens, places but still newbie and need
an advise about complex token strategy.
For example I have a Book object (that has its activity, place, view).
The book can be shown, edited and commented by its ID. The token need
to be switched to smth like
#bookPlace:234/show
#bookPlace:234/edit
#bookPlace:234/comment

Switching to edit and add comment need to be done without reloading
object (I mean that something like  getPlaceController().goTo(new
BookPlace(edit)) will reload the object)

To switch to comment state of book's view without reloading I'm
trying to use
History.newItem(History.getToken() + /comment, false);  // token
goes to #bookPlace:234/comment, the view displays comment input form

To properly display  #bookPlace:234/comment token In the Book activity
constructor I need parse the token using something like:
String[] tokenPath = place.getPlaceName().split(/);
this.bookID = tokenPath[0];
this.action = tokenPath[1];

Are there some helper classes to parse and map complex tokens? Am I
right using  History.newItem(History.getToken() + /comment, false);
to add actions to token?

Any links on the best complex tokens implementation with Places and
Activities are welcome.

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



Re: Sessions and Activities and Places

2011-11-14 Thread Mike Dee
I'm sorry, I don't think I understand this.  How would a separate GWT
module help?  Wouldn't a separate module (with separate URL) produce a
separate session?

On Nov 13, 9:54 pm, -sowdri- sow...@gmail.com wrote:
 Have your tried moving login part to a separate GWT module, with a
 different url (consequently a separate host html) and let the container
 handle the session management?

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



Re: Sessions and Activities and Places

2011-11-14 Thread Mike Dee
I think I've found a good way to handle this.  It really is pretty
easy.

I subclassed PlaceController and override it goTo() method.  It looks
like this:

public void goTo( Place newPlace )
{
if( isLoggedIn )
super.goTo( newPlace );
else
super.goTo( new LoginPlace() );
}

It seems to work well.  Handles pages that are bookmarked and the back
button.

On Nov 12, 5:43 pm, Mike Dee mdichiapp...@gmail.com wrote:
 What is a good way to have a GWT app redirect to a login screen when a
 session expires?  I've just hooked up a login page and a logout button
 at an Activities and Places app.  I basically handle this through the
 event bus with login and logout events (haven't hooked up a session
 time out yet).

 The events work nicely.  After logging in, the main place appears in
 the app.  When logging on, the login place appears.  Very nice.

 However, nothing prevents a user from accessing a place within the app
 - either by bookmarking or using the back button after logging out.
 I've experimented with a few things, but don't like any of them.  For
 example, in the AppActivityMapper if the user is not logged in, it
 goes to the login place regardless of the requested place.  I don't
 like this because the URL still shows the requested place.

 It looks like a central place to handle this is in
 PlaceController.goTo().  While looking at the source, it appears that
 changing places is handled via the event bus.

     String warning = maybeGoTo(newPlace);
     if (warning == null || delegate.confirm(warning)) {
       where = newPlace;
       eventBus.fireEvent(new PlaceChangeEvent(newPlace));

 Has anyone tried overriding this to handle loggin/logout?

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



Re: Sessions and Activities and Places

2011-11-13 Thread Ashton Thomas
I handle this in two areas:

1) onModuleLoad: isAuthenticated/Valid Session 

2) 

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/T6HkY06Cz_gJ.
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.



Re: Sessions and Activities and Places

2011-11-13 Thread Ashton Thomas
I handle this in two areas:

1) onModuleLoad: isAuthenticated/Valid Session 

2) 

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/47RRkzwO8OEJ.
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.



Re: Sessions and Activities and Places

2011-11-13 Thread -sowdri-
Have your tried moving login part to a separate GWT module, with a 
different url (consequently a separate host html) and let the container 
handle the session management?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/vd9ZItvamt0J.
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.



Sessions and Activities and Places

2011-11-12 Thread Mike Dee
What is a good way to have a GWT app redirect to a login screen when a
session expires?  I've just hooked up a login page and a logout button
at an Activities and Places app.  I basically handle this through the
event bus with login and logout events (haven't hooked up a session
time out yet).

The events work nicely.  After logging in, the main place appears in
the app.  When logging on, the login place appears.  Very nice.

However, nothing prevents a user from accessing a place within the app
- either by bookmarking or using the back button after logging out.
I've experimented with a few things, but don't like any of them.  For
example, in the AppActivityMapper if the user is not logged in, it
goes to the login place regardless of the requested place.  I don't
like this because the URL still shows the requested place.

It looks like a central place to handle this is in
PlaceController.goTo().  While looking at the source, it appears that
changing places is handled via the event bus.

String warning = maybeGoTo(newPlace);
if (warning == null || delegate.confirm(warning)) {
  where = newPlace;
  eventBus.fireEvent(new PlaceChangeEvent(newPlace));

Has anyone tried overriding this to handle loggin/logout?

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



Re: Activities and Places - Handling several views

2011-11-03 Thread Antoine DESSAIGNE
Hi,

I've looked into your code but it doesn't seem to fit my need. Basically I
need that a single activity update several views. Do you (or anyone else)
have a clue on how to achieve that?

Thanks a lot,

Antoine.

2011/11/3 Brandon Donnelson branflake2...@gmail.com

 My demo and source might help.
 http://code.google.com/p/gwt-examples/wiki/DemoActivitiesAndPlaces


 http://code.google.com/p/gwt-examples/source/browse/#svn%2Ftrunk%2FWalletInventory%2Fsrc%2Fcom%2Fgonevertical%2Fclient%2Fapp%2Factivity-
  activities

 Hope that helps,
 Brandon Donnelson
 http://gwt-examples.googlecode.com


  --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-web-toolkit/-/vddUxLT7DoAJ.
 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.


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



Re: Activities and Places - Handling several views

2011-11-03 Thread Patrick Julien
You need to adopt a different strategy to the problem:

http://tbroyer.posterous.com/gwt-21-activities-nesting-yagni

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/qUILl-sVQygJ.
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.



Activities and Places - Handling several views

2011-11-02 Thread Antoine DESSAIGNE
Hi everyone,

I have some trouble managing Activity and Places with several views.

The application is similar to an email client, it has 3 views:

- View A: The list of all the folders

- View B: The list of all the message within a folder

- View C: The message content

If the user loads the application, with no URL token, the views should be
defined like this:

- The View A should contain the list of all folders

- The Views B and C should be empty

If the user loads a message, let say through the URL with the
message-1234 token, all the views should be updated:

- The View A should highlight the folder that contains this message

- The View B should highlight the message within this folder

- The View C should display the content of the message

Do you have any ideas on how to do that?

Thanks a lot!

Antoine.

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



Re: Activities and Places - Handling several views

2011-11-02 Thread Brandon Donnelson
My demo and source might help. 
http://code.google.com/p/gwt-examples/wiki/DemoActivitiesAndPlaces

http://code.google.com/p/gwt-examples/source/browse/#svn%2Ftrunk%2FWalletInventory%2Fsrc%2Fcom%2Fgonevertical%2Fclient%2Fapp%2Factivity
 
- activities

Hope that helps,
Brandon Donnelson
http://gwt-examples.googlecode.com


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/vddUxLT7DoAJ.
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.



Activities and Places, how to deal with nested views ?

2011-10-26 Thread Gervais.b
Dear GWT profesionnals,

I try to create an little app who allow users to make search. The main
screen contains some inputs and a TabLayoutPanel who contains two set
of inputs.
The main screen is created with UiBinder and the two containeds into
the tabs are also described with UiBinder. I have one activity who
manage the screen and perform the search.

But now I have to add another search button into the first tab. This
search button let the user do a search and complete the inputs. The
first solution is to add another callback method to the atcivity
doNestedSearchAndFillSubset() but this nestedSearch can prompt the
user with an popup panel to select one line from the result set...

Is it a way to manage the subSearch view and action with another
activity who is nested into the main screen activity ?

Thanks

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



Re: Activities and Places, how to deal with nested views ?

2011-10-26 Thread Juan Pablo Gardella
Did you see this post
http://tbroyer.posterous.com/gwt-21-activities-nesting-yagni?


2011/10/26 Gervais.b gervai...@gmail.com

 Dear GWT profesionnals,

 I try to create an little app who allow users to make search. The main
 screen contains some inputs and a TabLayoutPanel who contains two set
 of inputs.
 The main screen is created with UiBinder and the two containeds into
 the tabs are also described with UiBinder. I have one activity who
 manage the screen and perform the search.

 But now I have to add another search button into the first tab. This
 search button let the user do a search and complete the inputs. The
 first solution is to add another callback method to the atcivity
 doNestedSearchAndFillSubset() but this nestedSearch can prompt the
 user with an popup panel to select one line from the result set...

 Is it a way to manage the subSearch view and action with another
 activity who is nested into the main screen activity ?

 Thanks

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



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



Re: Fitting Activities and Places in current architecture

2011-10-21 Thread sridhar vennela
Hi Rohan,

Thank you for your response. Can i leave current browser intractions as it
is and create new browser intractions for Activites and Places?

Sai




On Thu, Oct 20, 2011 at 9:52 PM, Rohan Aggarwal 
rohanaggarwal999...@gmail.com wrote:


 I am sure Sampath, might be u handled earlier browser history based
 HistoryToken and Fragement.  But with Acitivites an dPlace you to have write
 lot of boilerplate code, which makes sense in future but now depends on
 timeline of ur app u have to decide.

 But ya definitely you need to rewrite atleat the browser interactions.



 On Fri, Oct 21, 2011 at 6:09 AM, sampath sai vsampath@gmail.comwrote:

 Hi ,
 Right now I have app without any gwt activities and places. Can add
 activity and places in current application? Or do I need rewrite
 entire application? Please help.
 If yes, I can mix and match, best approaches.


 Thanks,
 Sai

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


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


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



Fitting Activities and Places in current architecture

2011-10-20 Thread sampath sai
Hi ,
Right now I have app without any gwt activities and places. Can add
activity and places in current application? Or do I need rewrite
entire application? Please help.
If yes, I can mix and match, best approaches.


Thanks,
Sai

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



Re: Fitting Activities and Places in current architecture

2011-10-20 Thread Rohan Aggarwal
I am sure Sampath, might be u handled earlier browser history based
HistoryToken and Fragement.  But with Acitivites an dPlace you to have write
lot of boilerplate code, which makes sense in future but now depends on
timeline of ur app u have to decide.

But ya definitely you need to rewrite atleat the browser interactions.


On Fri, Oct 21, 2011 at 6:09 AM, sampath sai vsampath@gmail.com wrote:

 Hi ,
 Right now I have app without any gwt activities and places. Can add
 activity and places in current application? Or do I need rewrite
 entire application? Please help.
 If yes, I can mix and match, best approaches.


 Thanks,
 Sai

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



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



Re: how to add custom token in URL (using Activities and Places )

2011-10-13 Thread Prakash
AFAIK, this cant be done with GWT Places. 
GWT places can only understand whatever comes after '#' sign in URL.

Check the HelloPlace class in hellpmvp tutorial available in GWT docs page. 
That will give you an idea on how to add parameters to Place.

If you really want to access/change the params in URL, then one way of doing 
is using  
http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/Window.Location.html

-Prakash M.





-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/lr80vtRSMrIJ.
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.



  1   2   >