Re: Help running DevMode with GWT 2.7 and no bookmarklets

2016-04-13 Thread shaun . tarves
Hi Thomas -

That was the missing piece. I can now get the automatic re-compile on 
browser refresh. However, the launcherDir parameter is only available in 
the gwt-maven-plugin:run-codeserver mojo. Doesn't that start Super Dev Mode 
directly? I thought that *wasn't* the correct way to do things in a 2.7+ 
world.

I'm pretty confused about how we should be debugging GWT apps at this point 
- maybe it's just a terminology thing.

Best I can tell, the GWT Super Dev Mode CodeServer is now launched either 
explicitly (using the CodeServer main or from the 
gwt-maven-plugin:run-codeserver mojo) OR implicitly by using the 
gwt-maven-plugin:run mojo (which starts DevMode, but now defaults to 
SuperDevMode and starts the code server). Is that accurate?

If so, it seems like the  parameter should be added to the run 
mojo, no?


On Tuesday, April 12, 2016 at 6:23:48 PM UTC-4, Thomas Broyer wrote:
>
> If you were already using CodeServer, then just add -launcherDir pointing 
> to the exploded war folder in your Tomcat. This will generate a new 
> nocache.js overwriting the original one that will trigger SDM on load, so 
> you have nothing to do but load your app.

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


Help running DevMode with GWT 2.7 and no bookmarklets

2016-04-12 Thread shaun . tarves
Hi guys -

I've spent more than a day now on a quest to get DevMode running properly 
for GWT 2.7 with my multi-module GWT application. NOTE: I can run SDM 
completely fine using the bookmarklets, but I'm not sure that's the right 
way to do things now.

As background, I use the gwt-maven-plugin in my project.

It started (innocently enough) with an attempt to rectify the "[ERROR] 
Current binding properties are expanding to more than one permutation but 
per-file compilation requires that each compile operate on only one 
permutation." error I was seeing when attempting to just press the "Dev 
Mode On" button after changing code without first turning off dev mode. 
That was a bit of an annoyance that I thought I could get around.

After reading this 
post: 
http://stackoverflow.com/questions/27267704/gwt-super-dev-mode-recompile-doesnt-work,
 
which led to this google group 
post: 
https://groups.google.com/forum/#!topic/google-web-toolkit-contributors/5lgtM77-1tM,
 
it appears that directly running SDM and using the bookmarklets is not the 
proper way to do things in GWT 2.7+

My "project" was set up using @tbroyer's GWT multi-module archetype back on 
GWT 2.5. I build my project, deploy to a local Tomcat instance running at 
localhost:8080, and from there, I use the mvn:run-codeserver command to 
start the SDM server at localhost:9876. I navigate my browser to 
localhost:8080, then I can hit the Dev Mode On button and compile my 
applicable modules and I'm good to go with sourcemaps and debugging in the 
browser.

How do I get standard Dev Mode with no bookmarklets (which I know starts 
SDM by default and I think is the *right 2.7 way* to do things) to work in 
this configuration?

My pom includes:
true
http://localhost:8080

and I started the code server (I think) using 
mvn gwt:debug

. This seems to start up okay and I see:

[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ 
xxx-gui-client ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] Copying 76 resources

[INFO] 

[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ 
xxx-gui-client ---

*[INFO] Nothing to compile - all classes are up to date*

[INFO] 

[INFO] <<< gwt-maven-plugin:2.7.0:debug (default-cli) < process-classes @ 
xxx-gui-client <<<

[INFO] --- gwt-maven-plugin:2.7.0:debug (default-cli) @ xxx-gui-client ---

[INFO] starting debugger on port 8000 in suspend mode

[INFO] create exploded Jetty webapp in 
/Users/xxx/Workspace/xxx/xxx/xxx-gui/client/target/xxx-client-5.7.0-SNAPSHOT

[INFO] Listening for transport dt_socket at address: 8000


Is Dev Mode not seeing my modules? When I run 
mvn get:run-codeserver

I see similar output, but it finds all the classes it needs to compile:


[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ 
xxx-gui-client ---

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] Copying 76 resources

[INFO] 

[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ 
xxx-gui-client ---

*[INFO] Changes detected - recompiling the module!*

*[INFO] Compiling 1335 source files to 
/Users/xxx/Workspace/xxx/xxx/xxx-gui/client/target/xxx-client-5.7.0-SNAPSHOT/WEB-INF/classes*

[INFO] 

[INFO] <<< gwt-maven-plugin:2.7.0:run-codeserver (default-cli) < 
process-classes @ xxx-gui-client <<<

[INFO] 

[INFO] --- gwt-maven-plugin:2.7.0:run-codeserver (default-cli) @ 
xxx-gui-client ---

[INFO] Turning off precompile in incremental mode.

[INFO] Super Dev Mode starting up


What's the link between that and my Tomcat instance? How do I "activate" 
dev mode in the browser? I see no red refresh button, there are no 
compilations happening in the code server terminal. What am I missing? Do I 
need an IDE to get a debugger going or do I need to tell Chrome to look at 
the code server? Would I be better served moving away from the older 
gwt-mvn-plugin and using tboyer's newer version?


I feel like this step:


Compile your application once using the ant build target. Ideally, you can 
> use GWT’s -war option to generate output files directly into your external 
> server’s static content folder. Otherwise, you’ll need to copy the GWT 
> output folder from war/ to your external server’s static 
> content.


from this page: 
http://www.gwtproject.org/doc/latest/DevGuideCompilingAndDebugging.html 
could be the key, but I'm not understanding how that translates to using 
mvn gwt:debug. I've tried using the  parameter and set it 
to where my local tomcat serves the GWT-generated files from, but nothing 
seems to get written there.

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

Re: Multiple cell Renderers (or composite cells with UiRenderer/UiHandler)

2015-10-12 Thread Shaun Tarves
I never got a response and just gave up. I realized that I don't actually
understand cells all that well, and they seem to have fallen out of favor
anyway.


On Mon, Oct 12, 2015 at 6:05 AM Drew Spencer <slugmand...@gmail.com> wrote:

> Argh, I hate finding a (1 year old) post that asks exactly my question but
> has no answers!
>
> Did you find a nice solution to this in the end? I'd be interested to hear
> what you came up with or any advice anyone might have.
>
> On Thursday, 16 October 2014 13:50:12 UTC+1, Shaun Tarves wrote:
>>
>> I have a fairly complex question about using cells with UiRenderer. I'm
>> finding that for the same object type, I have several variations of the
>> cell that I render based on the view and context it's rendered in. For
>> example, sometimes the cell has a button to remove/delete, other times it
>> doesn't. Sometimes, I want to wrap text in anchor tags, other times I want
>> them to just be spans. 95% of the cell rendering template is the same in
>> these cases.
>>
>> This creates (mostly) duplicative renderer code and xml, so I am looking
>> for a better solution. My thought was to have a master renderer with some
>> elements that would contain the rendered SafeHtml of smaller partial
>> renderers.
>>
>> I have seen that I can use a SafeHtml template to render a portion of the
>> html for the cell renderer, but I would lose the ability to have UiHandlers
>> on those elements created as just SafeHtml from the Template (which is
>> really handy).
>>
>> Is there a way to make this work? Can I delegate browser events to "sub"
>> renderers? Is this better approach here?
>>
>> I suppose what I'm asking for might be UiRenderer-based composite cells,
>> but I've seen no examples of how to do this.
>>
>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "GWT Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-web-toolkit/n3c9rD-m0Ak/unsubscribe
> .
> 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.
> 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 http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


How to update cell with timer

2014-10-23 Thread Shaun Tarves
Hi -

I have created a custom cell that displays a duration of time between a 
start date and end date (public class DurationCell extends AbstractCellDate
[]). If the end date is null, I would like the duration to count up, 
like a stopwatch.

I'm stuck with how to periodically (every second) update the value of that 
cell. I would prefer to not have to alter the underlying data object every 
second, but I don't know of another approach.

Thoughts?

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


Multiple cell Renderers (or composite cells with UiRenderer/UiHandler)

2014-10-16 Thread Shaun Tarves
I have a fairly complex question about using cells with UiRenderer. I'm 
finding that for the same object type, I have several variations of the 
cell that I render based on the view and context it's rendered in. For 
example, sometimes the cell has a button to remove/delete, other times it 
doesn't. Sometimes, I want to wrap text in anchor tags, other times I want 
them to just be spans. 95% of the cell rendering template is the same in 
these cases.

This creates (mostly) duplicative renderer code and xml, so I am looking 
for a better solution. My thought was to have a master renderer with some 
elements that would contain the rendered SafeHtml of smaller partial 
renderers.

I have seen that I can use a SafeHtml template to render a portion of the 
html for the cell renderer, but I would lose the ability to have UiHandlers 
on those elements created as just SafeHtml from the Template (which is 
really handy).

Is there a way to make this work? Can I delegate browser events to sub 
renderers? Is this better approach here?

I suppose what I'm asking for might be UiRenderer-based composite cells, 
but I've seen no examples of how to do 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.
For more options, visit https://groups.google.com/d/optout.


Manipulating current history token

2014-07-24 Thread Shaun Tarves
I am using Places in my GWT app, but I've encountered a scenario in which I 
want to manually manipulate the current history token, and I'm having 
trouble:

I have a screen showing a collection of objects, where the user can click a 
button to load more results (similar to an infinite scrolling scenario). 
Each time I add more results, I want to make note of that in the current 
history token so that if a user navigates back to the page, I have that 
number and can initially load that many results.

I DON'T want to change the visible URL token whenever they load more 
results.

I've tried doing placeController.getWhere and manipulating the actual place 
to set a value, but that doesn't help when going forward/back, since the 
altered place was never hashed on the history stack.

I've also tried to alter the history item that is on the history stack by 
calling History.getValue() and just making changes to it, but that doesn't 
seem to work either.

History.newItem(string, false) also doesn't work because it will change my 
visible token, which is exactly what I don't want to do.

Thoughts?

-- 
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: Manipulating current history token

2014-07-24 Thread Shaun Tarves
It's not that simple. The user can return to the same place many times over 
the course of the application. Each time they go place X, there may be a 
different number of objects that they loaded while they were at Place X.

My idea was to just update the current place (which is the same instance 
the entire time they are at Place X, until they leave and go somewhere 
else) with the max results each time new data is loaded. That way, the 
FINAL state of the place is stored for if they navigate back to it with the 
history mechanism.

Trying to use localStorage doesn't work because each INSTANCE of the place 
doesn't have anything unique about it that I can use as a sort of map key, 
right?

-- 
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: Correct way to sink events on UiBinder Element

2013-08-30 Thread Shaun Tarves
Thanks all. The addDomHandler suggestion worked wonderfully for my needs.

On Tuesday, August 27, 2013 11:55:47 AM UTC-4, Thomas Broyer wrote:



 On Tuesday, August 27, 2013 5:01:07 PM UTC+2, Shaun Tarves wrote:

 Thomas, 

 Thanks for the heads up about the leak. How would I use uibinder for 
 cells if I am just creating a standard Composite-based widget?


 Either you compose widgets, *or* you go low-level and then you can use 
 uibinder for cells to work at the element-level.

 What would an event delegation path look like at the composite level? 
 Do I just sink the events on this.getElement() and then check if the 
 event target is my UiField Element?


 Basically, yes (you'd use addDomHandler or override onBrowserEvent though 
 rather than sink the events on this.getElement())

 With uibinder for cells (aka UiRenderer), you'd either build a Cell to 
 use in CellWidget (have a look at TextButton for an example of such widget, 
 even though it doesn't use UiRenderer) or extend Widget. In the latter 
 case, you can render() your element into some root element (say, a div) 
 using setInnerHTML, and delegate the widget's onBrowserEvent to the 
 UiRenderer's onBrowserEvent, so it will do the dispatch to the appropriate 
 @UiHandler method. And you can possibly get the inner elements to 
 manipulate them directly.
 See 
 http://www.gwtproject.org/doc/latest/DevGuideUiBinder.html#Rendering_HTML_for_Cells


-- 
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: Correct way to sink events on UiBinder Element

2013-08-27 Thread Shaun Tarves
Thomas,

Thanks for the heads up about the leak. How would I use uibinder for
cells if I am just creating a standard Composite-based widget?

What would an event delegation path look like at the composite level?
Do I just sink the events on this.getElement() and then check if the
event target is my UiField Element?


On Mon, Aug 19, 2013 at 7:59 AM, Thomas Broyer t.bro...@gmail.com wrote:


 On Thursday, August 15, 2013 9:59:48 PM UTC+2, Shaun Tarves wrote:

 I am defining several elements via UiBinder. My understanding is these are
 created as com.google.gwt.dom.client.Element during the createAndBind call.

 I would like to add a click handler to one of these elements. Is there any
 way other than casting those to com.google.gwt.dom.client.Element like this?


 @UiField
 Element clickable;

 DOM.sinkEvents((com.google.gwt.user.client.Element) clickable,
 Event.ONCLICK);
 DOM.setEventListener((com.google.gwt.user.client.Element) clickable, new
 EventListener() {
 public void onBrowserEvent(Event event) {
 //TODO: Some code
 }
 });


 Don't do that, you might leak memory on some browsers (aka, do it at your
 own risks)

 Either use widgets or use the event delegation pattern, where your widget
 listens to events and do one thing or another depending on the event's type
 and target.
 For event delegation, using uibinder for cells makes it easier as you can
 use @UiHandler and let the generator do the routing for you.

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


Correct way to sink events on UiBinder Element

2013-08-15 Thread Shaun Tarves
I am defining several elements via UiBinder. My understanding is these are 
created as com.google.gwt.dom.client.Element during the createAndBind call.

I would like to add a click handler to one of these elements. Is there any 
way other than casting those to com.google.gwt.dom.client.Element like this?


@UiField 
Element clickable;

DOM.sinkEvents((com.google.gwt.user.client.Element) clickable, 
Event.ONCLICK);
DOM.setEventListener((com.google.gwt.user.client.Element) clickable, new 
EventListener() { 
public void onBrowserEvent(Event event) { 
//TODO: Some code
} 
});

-- 
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-RPC: loose vs. tight coupling

2013-06-14 Thread Shaun Tarves
Hi Jens -

Thank you for the info. For what it's worth, I was able to successfully use 
the an interface in the Async service interface and then the implementation 
in the RemoteService interface. GWT compiled without complaint even though 
the async method signature was technically different.

That said, I saw no change in the final size of the generated .html, .rpc, 
or .js files.

Certainly something to keep exploring.

- Shaun

On Thursday, June 13, 2013 3:46:25 PM UTC-4, Jens wrote:

 Its not so much about performance its more about the resulting code size 
 of your final JS. If you use List in your interface that extends 
 RemoteService (or any DTO that is used with GWT-RPC) the GWT-RPC code 
 generator can not know which concrete types the server side may return. 
 Thus it has to generate de/serializer for all possible List 
 implementations. This bloats your final JS code.

 The interface that extends RemoteService should have the concrete type. 
 Not sure about the Async interface, but I think GWT forces you that both 
 interfaces match each other. I guess you can easily test it yourself with a 
 small GWT project.

 If you know that you use all possible implementations of an interface, 
 then its totally fine to use the interface instead of a concrete type. E.g. 
 in a command pattern you can have an execute(Command) method because at 
 some point in your app flow you have used all possible commands anyways. 

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




GWT-RPC: loose vs. tight coupling

2013-06-13 Thread Shaun Tarves
I know it has been mentioned that GWT-RPC code should be tightly coupled 
(i.e., use ArrayList vs. List), but is that true for both the RemoteService 
interface and the Async interface? Or rather, is the performance gain only 
from using it in the RemoteService and server-side implementation of it?

-- 
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: Is there a nice Birthday date picker out there?

2013-01-24 Thread Shaun Tarves
You can do this kind of thing: 
http://www.zackgrossbart.com/hackito/gwt-slider/, but with jQuery's 
datepicker instead of the slider. 

On Thursday, January 24, 2013 12:20:53 PM UTC-5, Jambi wrote:

 Hey guys, 

 I´m looking for a nice GWT birthday date picker but I can´t find a good 
 one. The normal date picker isn´t very convienient for me since you can 
 only skip month by month. Does anyone now a nice widget?

 Cheers,

 Michael


-- 
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: Are you happy with GWT?

2012-10-10 Thread Shaun Tarves
There is no doubt that what GWT does, it's really good at. However, some 
things that I've found GWT really isn't good at:

1) Producing clean HTML

The structure of GWT page views, especially with GWT widgets, is really 
poor. The DOM gets bloated with lots of extra elements that are used for 
focus and positioning. There are ways around this, but I feel like I'm 
constantly fighting with GWT to generate HTML structure on my terms.

For example, some of the most lauded constructs in GWT are the Cell-based 
widgets (CellTable, and CellList, specifically). With CellLists, you are 
stuck with divs. There's no way around it. So that means if you want to 
make a good data model-backed list and render it as a UL with LIs, you're 
SOL.

2) The history mechanism is really powerful, but it's important to get your 
URL structure correct from the start. The built-in history token parser is 
a little too rigid in that it forces the first part of your URLs to be of 
the form :yyy and then anything you want after that. When you dive 
deeper into GWT, you'll understand the limitations of the 
PlaceHistoryMapper and why you might want to avoid the tokenizers and write 
your own parser.

3) The GWT CSS compiler doesn't understand any CSS3 attributes. Also, 
browser-specific attributes (such as the * hack for IE) throw warnings on 
compiling. It's not really GWT's fault (it's a Java compiler issue), but be 
aware nonetheless.

Just a few things to keep in mind.

On Wednesday, October 10, 2012 1:53:26 PM UTC-4, Charlie Youakim wrote:

 Great posts.  I am truly gracious of all the responses to this question I 
 posted.  I feel like we have made the right move going in this direction.

 On Wednesday, October 10, 2012 1:28:05 PM UTC-4, Joseph Lust wrote:

 *Praise*

 I think it is best to assert that *GWT is to Javascript what Scala is to 
 Java*. GWT is a higher level web framework. Sure, your devs can learn 
 every browser quirk and go bare metal, writing verbose code. But they can 
 also just focus on the higher level of logic, interactions and reusability.

 Put simply, the GWT framework allows you to carry out nearly every best 
 practice in web application design, and do so in a robust, automated 
 manner. Sure, you can sprite your images, minify and obfuscate your CSS, 
 combine your JS files, then minimize them, then run them through the 
 Closure compiler, then gzip them, and repeat for each language you plan to 
 i18n for. Or you can just hit compile in GWT. And you can unit test that 
 process as well. Awesome!

 Coming from being a script kiddie in 1997, having done PHP frameworks, C# 
  ASP.Net, and raw JS with ExtJs, there is no better way to create RIA’s 
 than GWT. I used to hate my life when I fought with debuggers in FF and raw 
 HTML code to get a blasted form to come up right. Now I just put a few 
 UiBinder XML tags in with something like gwt-bootstrap and it is done and 
 pretty. Life saver. Why would you do it any other way?

 And, to note what you can do with this. My employer, a large financial 
 institution, uses GWT as their standard inhouse technology for enterprise 
 web applications. One team just finished a 400 screen application and I’m 
 currently working on a bleeding edge, HTML5/canvas based flagship product 
 which is 200kLOC strong. GWT makes these applications, their rapid 
 turnaround, and very high level of quality possible. 

 *Terms and Conditions*

 This is not for script kiddies. You should have a good grasp of OO, Java, 
 and JS. GWT itself is a bit dogmatic. This means it requires competent 
 developers.  Once they read all the docs on the Google Dev pages, they’ll 
 be in good shape. Still, becoming a serious GWTer is not a weekend effort. 
 Thus, if you want to create a simple blog, stick with PHP and WP, but if 
 you want a highly optimized, complex web application, go with GWT. 

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



CellTable sorting when updating CellTable in MVP architecture

2012-10-10 Thread Shaun Tarves
Hi - 

I have a presenter that provides data for a CellTable. The presenter holds 
the ListDataProvider, and attaches that data provider to the cell construct 
it gets from the view.

I am unsure of how to handle column sorting in this case. My presenter 
periodically refreshes the data in the ListDataProvider, but how can I get 
access to the currently sorted column from the view so that I can add the 
new data in the proper sort order?

Should the presenter listen for ColumnSortEvents and do all the data 
sorting?

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/-/6WgxO_qkOw4J.
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.



Multiple modules (how to share outer container state and structure)

2012-08-30 Thread Shaun Tarves
I have read a whole bunch of articles on multiple modules, and I'm still 
not sure I fully understand what they are (or their limitations) so I'm 
hoping someone can help.

1. Can multiple modules be loaded in the same host page?

2. Can multiple modules live inside of the same RootLayoutPanel, or do they 
each have to attach themselves to the RootLayoutPanel?

If the answers to 1. and 2. are yes, how do you switch between the modules?

Can, for example, a common event bus be used between all the modules?

My use case is that I have a rather complex outer application shell (in 
GWT) which is concerned with basic navigation, alerts, etc. I would like 
the user to be able to perform 3 distinctly different functions from within 
that same frame (managing a library, working within a community, and some 
users will have administrative tasks).

I'm struggling with the best way to layout the entire application. Do I 
continue with one monolithic app where all context switching is done by 
places/activities?

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



Multiple cells per row in CellTable (like a Cell Grid)

2012-08-21 Thread Shaun Tarves
Is there any way to have multiple cells per column in a CellTable? What I 
would really like is a grid of cells, but it only seems to be one per row.

The closest I can come is a CellList whose cells are display: inline-block.

Any ideas?

-- 
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/-/kOOPdf_A9U4J.
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: Multiple cells per row in CellTable (like a Cell Grid)

2012-08-21 Thread Shaun Tarves
My understanding is that CompositeCell is still not going to allow me to
use multiple Cell data objects per row.

An example is a data provider that is a ListPeople and I want my grid to
display my collection of People in a 4x4 grid. Is there a way to do that?

On Tue, Aug 21, 2012 at 1:05 PM, Andrea Boscolo andrew...@gmail.com wrote:

 It's up to you to create a grid of cells. Try to use a CompositeCell
 http://google-web-toolkit.googlecode.com/svn/javadoc/2.5/com/google/gwt/cell/client/CompositeCell.html


 On Tuesday, August 21, 2012 3:29:20 PM UTC+2, Shaun Tarves wrote:

 Is there any way to have multiple cells per column in a CellTable? What I
 would really like is a grid of cells, but it only seems to be one per row.

 The closest I can come is a CellList whose cells are display:
 inline-block.

 Any ideas?

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

 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: Animating DockLayoutPanel widget size change

2012-07-25 Thread Shaun Tarves
Well, that was easy. I hadn't tried that, assuming
DockLayoutPanel.setWidgetSize() was happening immediately.

Thanks.

On Wed, Jul 25, 2012 at 2:58 PM, Thomas Broyer t.bro...@gmail.com wrote:

 It should be as easy as calling the animate() method.

 Actually, all layout changes are queued and processed by a
 Scheduler#scheduleFinally command. animate() will change the behavior of
 that command to animate the layout changes.


 On Wednesday, July 25, 2012 8:40:36 PM UTC+2, Shaun Tarves wrote:

 Hi -

 Is there any way to animate the setting of a widget size within the
 DockLayoutPanel? For example, when hiding display regions, it's typical to
 set a particular region of the DockLayoutPanel to null, or set its size to
 0.

 I would like to animate the reappearance or disappearance of a widget
 within the DockLayoutPanel, but can't seem to figure out how.

 Any ideas?

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

 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.



IE hacks in CssResource

2012-06-19 Thread Shaun Tarves
I would like to include some IE-specific hacks in my CssResource. Something 
along the lines of:

*header {width:290px;height:200px;background:#000;}

However, the GWT CSS compiler throws warnings when it encounters one.

In some cases, the user.agent is not specific enough (for example, it 
doesn't have an ie7 value), and certain hacks *, /9, _, etc are necessary 
in those cases.

Is there a proper way to pass these hacks through the CSS compiler that 
doesn't include user.agent checking?

-- 
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/-/46zZg85aQ9IJ.
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: Hyperlink/Anchors: Passing data in Places

2012-06-07 Thread Shaun Tarves
Hi Thomas -

I went down the road of the PlaceHyperlink [trying to create as extension
of Hyperlink with a method setDestination(Place)]. My intention was that
PlaceHyperlink could be used in UIBinder, and my presenters wouldn't all
need to pass through a PlaceHistoryMapper.

I have GIN set up, so I'm trying to inject my PlaceHistoryMapper into my
PlaceHyperlink (as a field injection - to avoid the missing no-arg
constructor problem), but no dice. That PHM is always null (although it
works fine in other places when constructor-injected).

I don't totally understand why this doesn't work. Any thoughts how to
implement a PlaceHyperlink with UIBinder and GIN?


On Thu, May 17, 2012 at 11:11 AM, Thomas Broyer t.bro...@gmail.com wrote:



 On Thursday, May 17, 2012 4:42:13 PM UTC+2, Shaun Tarves wrote:

 It's about optimization, I guess. If you just have a shallow Place object
 (say it only knows an ID) and always fetch the data you need, that means
 more calls.

 If you let the Place object contain a lot more data, you still have to
 code for when it doesn't (eg., when the user navigates directly to a URL or
 does a right-click - Open in new tab...).

 I was just curious if there's a preferred pattern here.


 IMO you should prefer the preventDefault+PlaceController#goTo way (and
 don't forget to code the fallback in the target PlaceChangeEvent.Handler
 and/or Activities!), as it's really small overhead for the developer (you
 could even make a PlaceHyperlink(PlaceHistoryMapper, Place) to avoid
 repeating the same things again and again) and a real win for the user.

 --
 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/-/a-fAcWjwkGYJ.

 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: Hyperlink/Anchors: Passing data in Places

2012-06-07 Thread Shaun Tarves
Thanks for the suggestions.

I'm still perplexed why the field injection of the PHM doesn't work in a
PlaceHyperlink.

On Thu, Jun 7, 2012 at 11:35 AM, Thomas Broyer t.bro...@gmail.com wrote:



 On Thursday, June 7, 2012 4:43:40 PM UTC+2, Shaun Tarves wrote:

 Hi Thomas -

 I went down the road of the PlaceHyperlink [trying to create as extension
 of Hyperlink with a method setDestination(Place)]. My intention was that
 PlaceHyperlink could be used in UIBinder, and my presenters wouldn't all
 need to pass through a PlaceHistoryMapper.

 I have GIN set up, so I'm trying to inject my PlaceHistoryMapper into my
 PlaceHyperlink (as a field injection - to avoid the missing no-arg
 constructor problem), but no dice. That PHM is always null (although it
 works fine in other places when constructor-injected).

 I don't totally understand why this doesn't work. Any thoughts how to
 implement a PlaceHyperlink with UIBinder and GIN?


 You can either use a @UiFactory or use @UiField(provided=true) in your
 views (but that's a lot of boilerplate) or use a static field and
 requestStaticInjection(PlaceHyperlink.class) in your GinModule. I don't
 quite like it but it works, and I've been using it for the past year on a
 few widgets (particularly SuggestBox-like widgets, providing them the
 RequestFactory).
 There's an issue on the tracker about making UiBinder more GIN-friendly
 but that's not an easy patch…

 --
 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/-/6EBTyXa-ek0J.

 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: Hyperlink/Anchors: Passing data in Places

2012-06-07 Thread Shaun Tarves
Duh. Completely looked past that little fact.

So, something along the lines of a PlaceHyperlink Factory using @Assisted
to get the Place into the PlayHyperlink and a provided=true should get the
job done.



On Thu, Jun 7, 2012 at 12:13 PM, Thomas Broyer t.bro...@gmail.com wrote:



 On Thursday, June 7, 2012 5:58:10 PM UTC+2, Shaun Tarves wrote:

 Thanks for the suggestions.

 I'm still perplexed why the field injection of the PHM doesn't work in a
 PlaceHyperlink.


 Depends how you do it; but given that it's created by UiBinder and not by
 GIN (unless you use @UiFactory or @UiField(provided=true)), you have to
 take explicit action to inject it with GIN. You should be able to do
 instance injection instead of static injection if you prefer (declare a
 method on your Ginjector taking a PlaceHyperlink as argument and with a
 void return-type, then call it with a PlaceHyperlink for an equivalent to
 Guice's injectMembers)

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

 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: ScrollPanel inside HeaderPanel // Another option for an auto-resizable DockLayoutPanel?

2012-05-24 Thread Shaun Tarves
No, I can't get the header panel to work at all. The header block shows up, 
but nothing in the content area is visible.

-- 
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/-/j3tDFEbo08sJ.
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: ScrollPanel inside HeaderPanel // Another option for an auto-resizable DockLayoutPanel?

2012-05-23 Thread Shaun Tarves
Did you ever figure out a solution to this?

On Sunday, June 5, 2011 4:21:17 PM UTC-4, Ernesto Oltra wrote:

 The title says all. I have the following structure:

 - DockLayoutPanel
  - north
  - north
  - center
 - HeaderPanel
- header: [ Here I have a HTMLPanel, it can change, and so its 
 height ]
- content: ScrollPanel

 The problem is ScrollPanel extends beyond the screen (HeaderPanel content 
 has overflow:hidden in its CSS)

 If it has no solution, is there any alternatives in order to have an 
 auto-resizable north panel in a DockLayoutPanel?




-- 
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/-/aBCOb8rkmJoJ.
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: Hyperlink/Anchors: Passing data in Places

2012-05-17 Thread Shaun Tarves
Sorry, the alternative below would be to have the URL contain enough
information about the new place (such as an ID if that's sufficient to
get all the data we need) and then always populate from scratch. I would
call that a shallow place - it doesn't contain all the data we need, but it
contains enough data to go fetch it.


On Thu, May 17, 2012 at 6:14 AM, Thomas Broyer t.bro...@gmail.com wrote:



 On Tuesday, May 15, 2012 10:13:56 PM UTC+2, Shaun Tarves wrote:

 When using activities and places, what is a proper approach to passing
 data through places on link clicks, but still keeping the good behavior
 associated with real links.

 Is it best to use an Anchor, set an href using the placeHistoryMapper,
 and then preventDefault on the DOM when the anchor is clicked? That way, we
 still operate on the actual Place (which would contain some data,
 conceivably) unless the user directly navigates to that link in the URL bar
 or does a right-click - Open in...


 Yes.

 (though I actually didn't understand the alternative below ;-) )



 Or is it best to encode only the data necessary in the Place token and
 fetch what is required from the server based on that shallow Place?

  --
 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/-/UdwC9D_-OuoJ.

 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: Hyperlink/Anchors: Passing data in Places

2012-05-17 Thread Shaun Tarves
It's about optimization, I guess. If you just have a shallow Place object
(say it only knows an ID) and always fetch the data you need, that means
more calls.

If you let the Place object contain a lot more data, you still have to code
for when it doesn't (eg., when the user navigates directly to a URL or does
a right-click - Open in new tab...).

I was just curious if there's a preferred pattern here.

On Thu, May 17, 2012 at 10:31 AM, Thomas Broyer t.bro...@gmail.com wrote:



 On Thursday, May 17, 2012 2:56:40 PM UTC+2, Shaun Tarves wrote:

 Sorry, the alternative below would be to have the URL contain enough
 information about the new place (such as an ID if that's sufficient to
 get all the data we need) and then always populate from scratch. I would
 call that a shallow place - it doesn't contain all the data we need, but it
 contains enough data to go fetch it.


 How is that different from the other suggestion (set an href using the
 placeHistoryMapper), besides letting the browser do the navigation rather
 than using preventDefault and calling PlaceController#goTo yourself? (that
 last bit is actually mostly an optimization 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/-/9tdo2nSwBPUJ.

 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: Advice using activities/places in MVP with some self-contained widgets

2012-05-15 Thread Shaun Tarves
Sorry for not being clearer - self-contained wasn't the correct 
description. Modular is more what I meant; widgets in the sense that they 
could be used in multiple views, but still have the ability to interact 
with the rest of the app (fire events mostly). If they're widgets as used 
in uiBinder templates, how to I control the construction of them to include 
an event bus. Should I make the event bus static, declare a UiConstructor, 
or use injection?

Some of the examples (mobilewebapp) use a container and pass a presenter 
that implements IsWidget into it (for example the piechartpresenter), but 
others declare the actual widget in the uibinder files (expenses).

I'm mostly looking for a design pattern that others have found helpful with 
actual implementation (where/how to declare/construct) of MVP widgets. 



On Tuesday, May 15, 2012 7:26:43 AM UTC-4, Thomas Broyer wrote:


 On Monday, May 14, 2012 9:48:14 PM UTC+2, Shaun Tarves wrote:

 I have an application utilizing AP with an MVP set-up. There are some 
 situations where I want to create some self-contained widgets (think, a 
 small alert window that needs to fire and event or a box that might want to 
 pull some data from a server). They aren't whole views and don't occupy 
 entire display regions, but I want to maintain the MVP approach.

 I've seen a few approaches that include specifying a callback interface 
 in the widget that your presenters (the one driving the view that holds the 
 widget) would implement, but that would mean writing the same code multiple 
 times if you use the widget in more than one view.

 I'm curious what people are doing when faced with this situation.


 If they're self-contained, why would your presenter need to do anything 
 special with them? Can't they simply be implementation details of your 
 views?

 As far as MVP is concerned, your self-contained widget could use MVP 
 itself, it does not mean it has to be exposed and/or, if it is, the view 
 should belong to the view of the containing component, and its presenter to 
 the presenter of the containing component.
 As an example, CellList, CellTable, et al. use MVP internally, but they 
 don't expose it; it's an implementation detail that allows fast 
 (non-GWTTestCase) unit-testing of the algorithms.


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



Hyperlink/Anchors: Passing data in Places

2012-05-15 Thread Shaun Tarves
When using activities and places, what is a proper approach to passing data 
through places on link clicks, but still keeping the good behavior 
associated with real links.

Is it best to use an Anchor, set an href using the placeHistoryMapper, and 
then preventDefault on the DOM when the anchor is clicked? That way, we 
still operate on the actual Place (which would contain some data, 
conceivably) unless the user directly navigates to that link in the URL bar 
or does a right-click - Open in...

Or is it best to encode only the data necessary in the Place token and 
fetch what is required from the server based on that shallow Place?

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



Advice using activities/places in MVP with some self-contained widgets

2012-05-14 Thread Shaun Tarves
I have an application utilizing AP with an MVP set-up. There are some 
situations where I want to create some self-contained widgets (think, a 
small alert window that needs to fire and event or a box that might want to 
pull some data from a server). They aren't whole views and don't occupy 
entire display regions, but I want to maintain the MVP approach.

I've seen a few approaches that include specifying a callback interface in 
the widget that your presenters (the one driving the view that holds the 
widget) would implement, but that would mean writing the same code multiple 
times if you use the widget in more than one view.

I'm curious what people are doing when faced with this situation.

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



Handling History items when using FilteredActivityMapper and CachingActivityMapper

2012-04-03 Thread Shaun Tarves
I am using a FilteredActivityMapper to redirect requests, in front of a 
CachingActivityMapper, but I'm getting strange behavior.

My filter has defined the following:

if (agreement not accepted): return Place B
if (not logged in): return Place C
return Place A

I initialize my browser history in the standard way, with a default place 
(say, Place A) to go to. Navigation to that place gets interrupted by the 
filter and returns a different place (Place B). Place B has a button to 
accept an agreement. On click, I call placeController.goTo(Place A). 
However, if the filter tries to redirect to Place C, I get stopped by the 
CachingActivityMapper saying that I'm attempting to return to the same 
(Place A) so nothing happens. It looks like the history isn't updated for 
the new place, only the original place.

I guess my general question is, do I need to manually add History items if 
a FilteredActivityMapper redirects to a new place? That is, should I be 
listening for PlaceChangeEvents somewhere. If so, where's the best place to 
do that?

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



Using CssResource @def inside some css property with parenthesis not working

2012-03-08 Thread Shaun Tarves
Hi -

I'm having trouble using a defined constant inside of a css property that 
has its own parenthetical reference. What I mean is:

@def HEADER_ROW_BACKGROUND_COLOR #b2bbc9;
This works:

background: HEADER_ROW_BACKGROUND_COLOR;

This does not work.
background-image: linear-gradient(top, HEADER_ROW_BACKGROUND_COLOR literal( 
0%), HEADER_ROW_BACKGROUND_COLOR literal( 97%), #7a808a literal( 100%))
;

The property shows up in web inspector totally fine, EXCEPT that the 2 
references to the constant are never translated. They just appear as is, 
strings in all caps. (see attachment)

Is this a known bug of some kind?

-- 
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/-/UUqeB7AP_MIJ.
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: Screen Shot 2012-03-08 at 10.42.49 AM.png

Re: Using CssResource @def inside some css property with parenthesis not working

2012-03-08 Thread Shaun Tarves
But using them without the constant definitions works fine. If I put in
explicit colors everywhere, my gradients show up.

- Shaun

On Mar 8, 2012, at 12:25 PM, Thomas Broyer t.bro...@gmail.com wrote:

This is because the gradient functions are not valid CSS2, and GWT uses a
CSS2 parser for CssResources.
See http://code.google.com/p/google-web-toolkit/issues/detail?id=5771

On Thursday, March 8, 2012 4:43:52 PM UTC+1, Shaun Tarves wrote:

 Hi -

 I'm having trouble using a defined constant inside of a css property that
 has its own parenthetical reference. What I mean is:

 @def HEADER_ROW_BACKGROUND_COLOR #b2bbc9;
 This works:

 background: HEADER_ROW_BACKGROUND_COLOR;

 This does not work.
 background-image: linear-gradient(top, HEADER_ROW_BACKGROUND_COLOR literal(
 0%), HEADER_ROW_BACKGROUND_COLOR literal( 97%), #7a808a literal(
 100%));

 The property shows up in web inspector totally fine, EXCEPT that the 2
 references to the constant are never translated. They just appear as is,
 strings in all caps. (see attachment)

 Is this a known bug of some kind?

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



Using Anchor/Hyperlink in Cell Widget constructs

2012-03-08 Thread Shaun Tarves
It looks like Anchors/Hyperlinks are the most full-featured and link like 
way to provide user navigation (right-click context menu support, etc.) Is 
there a way to integrate these with the notion of CellLists or CellTrees? 
For example, if I wanted each cell to be a GWT Anchor (or at least wrapped 
in one), what's the best way to implement that?

Can there be Anchors in the cell render() method, or would it be best to 
use the result of the render() method as the HTML for the Anchor?

Has anyone done this? I haven't seen any examples like this out there, so 
maybe they're mutually exclusive (i.e., what would the cell object's 
selection handler actually do?)

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/-/1rVMaWKQ5LQJ.
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.



Can someone clear up the use of ClientBundle?

2012-03-06 Thread Shaun Tarves
My understanding was that ClientBundle could be used to create a 
global-type style/image package that would be delivered when needed. I am 
not sure that is a correct interpretation. Let me explain my use-case:

1) I have an app with 3 implementations (Desktop/Mobile/Table). My hope was 
to have 3 client bundles that would each serve as the definition for all 
the images/styles needed in those implementations.

2) In each ui bindler file in a given implementation (for example, 
shell.ui.xml, viewX.ui.xml, etc.), I use the ui:with field=resources type
=...Resources / and their corresponding .java files each have members 
like:

@UiField(provided = true) final Resources resources = GWT.create(Resources.
class);

3) I call Resources.INSTANCE.style().ensureInjected() in the constructor of 
each widget class.

4) However, the styles that are ONLY used in viewX.ui.xml (that don't 
appear in shell.ui.xml) are never injected (presumably because the 
ensureInjected() is called for the shell and then each subsequent call is a 
no-op, per the docs).

Am I missing the point of the ClientBundle? Would the proper thing to do be 
to define any styles specific to viewX in the viewX.ui.xml file using 
ui:style? Am I just using this incorrectly?

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



How to add custom styles to custom cells

2012-03-06 Thread Shaun Tarves
Hi -

I have a custom cell definition that I want to add a custom style 
definition (.quiet) for. In this case, it's a cell that goes into a cell 
table. What I have done (and is NOT working) is the following:

interface CellTableResources extends CellTable.Resources {

 @Source({CellTable.Style.DEFAULT_CSS, DesktopServiceTable.css})

 CellTableStyle cellTableStyle();

}

interface CellTableStyle extends CellTable.Style {

 String quiet();

}

I added a .quiet{} rule to my DesktopServiceTable.css

Then, the render() method of my cell class uses the quiet class: @
SafeHtmlTemplates.Template(strong{0}/strongbr/em 
class=\quiet\Updated: {1}/em)

The class name is on the em element in the DOM (within the td of the 
table), but there is no style associated with it - it's almost like it 
wasn't injected or something.


Any ideas?

-- 
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/-/BLlhV8o2rH4J.
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 styles to custom cells

2012-03-06 Thread Shaun Tarves
Hi Jens -

Completely overlooked that. Your solution worked correctly with the
String/class name approach. Thanks!

- Shaun

On Tue, Mar 6, 2012 at 11:49 AM, Jens jens.nehlme...@gmail.com wrote:

 As soon as you use ClientBundle with CssResource all css classes defined
 by a CssResource are obfuscated (unless you disable it in your gwt.xml
 file). That means something like .SXYDSS is injected in your website but
 you have hardcoded quite in your cell. Obviously this wont work.

 So you have to call CellTableStyle.quiet() and put the output (the method
 returns the obfuscated class name) into the class attribute of em. As
 SafeHtmlTemplates are defined through annotations and you cant access
 CssResource methods in a static way you have to make your class attribute
 value a method parameter [and you probably have to use SafeStyles (see
 SafeStyleUtils and SafeStyleBuilder)], e.g.

 @SafeHtmlTemplate(em class=\{2}\ )
 SafeHtml template(SafeHtml first, SafeHtml second, String cssClass);

 or if GWT complains because of a variable as class attribute value:

 @SafeHtmlTemplate(em class=\{2}\ )
 SafeHtml template(SafeHtml first, SafeHtml second, SafeStyles cssClass);


 -- J.



 Am Dienstag, 6. März 2012 17:10:41 UTC+1 schrieb Shaun Tarves:

 Hi -

 I have a custom cell definition that I want to add a custom style
 definition (.quiet) for. In this case, it's a cell that goes into a cell
 table. What I have done (and is NOT working) is the following:

 interface CellTableResources extends CellTable.Resources {

  @Source({CellTable.Style.DEFAU**LT_CSS, DesktopServiceTable.css})

  CellTableStyle cellTableStyle();

 }

 interface CellTableStyle extends CellTable.Style {

  String quiet();

 }

 I added a .quiet{} rule to my DesktopServiceTable.css

 Then, the render() method of my cell class uses the quiet class: @
 SafeHtmlTemplates.Temp**late(strong{0}/strongbr/**em
 class=\quiet\Updated: {1}/em)

 The class name is on the em element in the DOM (within the td of the
 table), but there is no style associated with it - it's almost like it
 wasn't injected or something.


 Any ideas?


 Am Dienstag, 6. März 2012 17:10:41 UTC+1 schrieb Shaun Tarves:

 Hi -

 I have a custom cell definition that I want to add a custom style
 definition (.quiet) for. In this case, it's a cell that goes into a cell
 table. What I have done (and is NOT working) is the following:

 interface CellTableResources extends CellTable.Resources {

  @Source({CellTable.Style.DEFAU**LT_CSS, DesktopServiceTable.css})

  CellTableStyle cellTableStyle();

 }

 interface CellTableStyle extends CellTable.Style {

  String quiet();

 }

 I added a .quiet{} rule to my DesktopServiceTable.css

 Then, the render() method of my cell class uses the quiet class: @
 SafeHtmlTemplates.Temp**late(strong{0}/strongbr/**em
 class=\quiet\Updated: {1}/em)

 The class name is on the em element in the DOM (within the td of the
 table), but there is no style associated with it - it's almost like it
 wasn't injected or something.


 Any ideas?

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

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

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



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