Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-24 Thread GWTter
Hi Jens,

Yea, this is definitely a good point.

Then any widget can inherit this minimal CssResource and define on its own 
how it will look like in enabled / disabled state (= you would not add 
enableddisabled.css to the various widgets @Source annotation although you 
extend HasEnabledDisabledStateCss).

I think this really is the best practice use of @Shared and inheritance, 
and as Thomas pointed out it shouldn't be used as a CssResource directly 
but only as an actual style interface.



-- 
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: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-23 Thread GWTter
Yes, in the example I gave there's no clear need for the inheritance with 
MyCss, it's just there to show how inheritance would be setup to try to 
illustrate the issue I was referring to.

It seems more and more like it's probably best to avoid inheritance and 
just go in the @Import direction. Even if you have to make sure the 
imported css are themselves injected or that you have to add those classes 
via their actual interfaces instead of as inherited, this seems to be more 
maintainable than the @Shared+inheritance and having to redeclare the 
super's selectors in the extended css.

Thanks again for the help Thomas, it's much appreciated.

On Sunday, February 23, 2014 11:09:59 PM UTC+1, Thomas Broyer wrote:
>
>
>
> On Sunday, February 23, 2014 10:13:00 PM UTC+1, GWTter wrote:
>>
>> Hi Thomas,
>>
>> I think this part right here is the clarification I needed:
>>
>>
>>- mapping class names to/from methods is based on the method name or 
>>a @ClassName annotation (the class name in the CSS file will thus be 
>>replaced with the unique name computed for the method)
>>
>> So, if you want to reuse a class name in a selector, then use @Import or 
>> @Shared+inheritance. The difference is that with @Shared you're forced to 
>> declare rules for the inherited/shared class names (to satisfy the 4th rule 
>> above), and the class name is accessible from outside the CSS file, from 
>> the CssResource interface (because of inheritance).
>>
>> I'd like to think I wasn't misunderstanding anything as I can't find 
>> anywhere in the doc where it says if you use @Shared with inheritance then 
>> you have to declare all the super cssresource selectors in the extending 
>> cssresource's css.
>>
>
> The basic rule is that each method's class name is used at least once in 
> the stylesheet, whether this method is declared on the interface or 
> inherited from a superinterface doesn't matter. @Shared is only about the 
> unique name (obfuscated name) of the class name, it doesn't change the 
> other rules.
>

-- 
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: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-23 Thread GWTter
Hi Thomas,

I think this part right here is the clarification I needed:


   - mapping class names to/from methods is based on the method name or a 
   @ClassName annotation (the class name in the CSS file will thus be replaced 
   with the unique name computed for the method)

So, if you want to reuse a class name in a selector, then use @Import or 
@Shared+inheritance. The difference is that with @Shared you're forced to 
declare rules for the inherited/shared class names (to satisfy the 4th rule 
above), and the class name is accessible from outside the CSS file, from 
the CssResource interface (because of inheritance).

I'd like to think I wasn't misunderstanding anything as I can't find 
anywhere in the doc where it says if you use @Shared with inheritance then 
you have to declare all the super cssresource selectors in the extending 
cssresource's css. It was for this reason that I was adding the extended 
CssResource's css to the source declaration of the extending cssresource. I 
thought that redeclaring the super's selectors (as empty rules of course) 
in the extending css again to avoid the GWT errors felt like a hack 
especially if you consider that any time you add a new class to the super 
css you would have to redeclare the same class in all extending css. This 
didn't feel as going in the direction of maintainability which is why I was 
redeclaring the css in the @source (even though the leads to duplicate 
rules being inserted). But as I see that this is the state of things 
currently I'd gladly redeclare the selectors as empty ones in all the 
extending css as seeing the error to fix is much better than inserting a 
whole bunch of duplicate css.

For reference, with this in mind, the example I gave Jens above would need 
the following changes to work correctly without duplication or the 
precedence override issue:
My.css would contain:
.genButton,.genButtonOther{} /*redeclare super selectors as empty to avoid 
GWT error*/

.myButton{
background: red;
}

And the MyCss declaration in MyClientBundle would be changed simply to:
@Source("My.css")
MyCss myCss();


This is what you're referring to right? And thanks again for the detailed 
explanation, this will be extremely useful as a reference and complement to 
the doc.

-- 
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: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-23 Thread GWTter
Hi Jens,

Here's the full example of what I was trying to illustrate as it's probably 
unfair of me to have others expect that I'm setting everything up right 
from just the pseudo code alone:

public class GwtTest3 implements EntryPoint {
 public interface MyClientBundle extends ClientBundle{
public final static MyClientBundle INSTANCE = 
GWT.create(MyClientBundle.class);
 @Shared
@ImportedWithPrefix("global")
public interface GlobalCss extends CssResource{
public String genButton(); 
public String genButtonOther();
}
 /*
 * Global.css contains:
 * .genButton{
background: green;
}
.genButtonOther{
background: yellow;
}
 */
@Source("Global.css")
GlobalCss globalCss();
 public interface InitButtonCss extends CssResource{
public String initButton();
public String initButton2();
}
 /*
 * InitButton.css contains:
 * .initButton{
background: #66F;
}
.global-genButton.initButton2{
background: orange;
}
 */
@Import(GlobalCss.class)
@Source({"InitButton.css"})
InitButtonCss initButtonCss();
 public interface MyCss extends GlobalCss{
public String myButton();
}
 /*
 * My.css contains:
 * .myButton{
background: red;
}
 */
/*
 * Regardless of whether you use @Import on a CssResource that is extending 
another CssResource
 * you still need to specify the source of the extended CssResource or else 
 * gwt will error because it cannot find the selectors OR you would have to 
redefine all of the
 * selectors from the extended css in the child css. 
 * This occurs even if you use @NotStrict.
 */
@Import(GlobalCss.class)
/*
 * if specifying the source for this resource because it does not have the 
default name as well as
 * the extended css then order matters as it is the order in which gwt will 
generate the source 
 * into the final css
 */
@Source({"Global.css","My.css"}) //will cause duplicate insert of rules 
from Global.css
MyCss myCss();
}

/**
 * This is the entry point method.
 */
@Override
public void onModuleLoad() {
 MyClientBundle.INSTANCE.globalCss().ensureInjected();
 Button genButton = new Button("1.) add first buttons");
genButton.getElement().setAttribute("style", 
"position:absolute;top:50%;left:40%;");
 genButton.addClickHandler(new ClickHandler() {
 @Override
public void onClick(ClickEvent event) {
MyClientBundle.INSTANCE.initButtonCss().ensureInjected();
Button initButton = new Button("init button (overqualified)");
initButton.getElement().setAttribute("style", 
"position:absolute;top:60%;left:40%;");
initButton.addStyleName(MyClientBundle.INSTANCE.globalCss().genButton() + " 
" + MyClientBundle.INSTANCE.initButtonCss().initButton2());
 RootPanel.get().add(initButton);
 Button initButton2 = new Button("init button 2 (blue)");
initButton2.getElement().setAttribute("style", 
"position:absolute;top:70%;left:40%;");
initButton2.addStyleName(MyClientBundle.INSTANCE.globalCss().genButton() + 
" " + MyClientBundle.INSTANCE.initButtonCss().initButton());
 RootPanel.get().add(initButton2);
}
});
 RootPanel.get().add(genButton);
 
Button genButton2 = new Button("2.) add second button");
genButton2.getElement().setAttribute("style", 
"position:absolute;top:50%;left:60%;");
 genButton2.addClickHandler(new ClickHandler() {
 @Override
public void onClick(ClickEvent event) {
MyClientBundle.INSTANCE.myCss().ensureInjected();
Button myButton = new Button("My button");
myButton.getElement().setAttribute("style", 
"position:absolute;top:60%;left:60%;");
myButton.addStyleName(MyClientBundle.INSTANCE.globalCss().genButton() + " " 
+ MyClientBundle.INSTANCE.myCss().myButton());
 RootPanel.get().add(myButton);
}
});
 RootPanel.get().add(genButton2);
}
}

If you run it and click the 1st button then the 2nd button you'll see the 
background color of "init button 2 (blue)" change from blue to green.

-- 
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: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-22 Thread GWTter


On Friday, February 21, 2014 5:09:36 PM UTC+1, Thomas Broyer wrote:
>
>
>
> On Thursday, February 20, 2014 10:51:29 PM UTC+1, GWTter wrote:
>>
>> Before anything, sorry Thomas, I think I may have just replied to you 
>> instead of just the topic (buttons bugged on me a bit), no-spam intended
>>
>> You're right I guess I did misunderstand if the imported with prefix 
>> doesn't in fact use a different obfuscation
>> for the original selectors in the final css. So using the imported with 
>> prefix method isn't a viable workaround for avoid the
>> precedence override on injection after all.
>>
>> And definitely, anything that will help clear it up. I can try to clarify 
>> my original example:
>>
>> You have the following,
>>
>> === Pseudocode ===
>>
>> CssResouces:
>>
>> SuperCssResource, is injected onModuleLoad (global css) and has the 
>> following css as its source:
>> .genButton{
>> color: black;
>> }
>>
>> and
>>
>> LeafCssResource extends SuperCssResource
>>  
>> css definitions here 
>> 
>>
>
> Why are you using an "extends" here? what do you expect from it? and more 
> importantly what does your ClientBundle(s) looks like?
>

I'm just setting up viable example when working with Resources. In this 
case specifically you would expect to be able to reference the styles
from SuperCssResource via LeafCssResource and be able to use the selectors 
from SuperCssResource's css to qualify other selectors in LeafCssResource's 
css.

The client bundle would simply look like:

interface LeafClientBundle extends ClientBundle{
  @Source({"Leaf.css","Super.css"})
  LeafCssResource leafCss();
}

>  
>
>> 
>>
>> Finally, we have the following 2 widgets:
>>
>> WidgetDisplayedFirst, 
>> has the following css via uibinder:
>> MyCssResource:
>> .myButton{
>> color: red;
>> }
>>
>> And this button element:
>> 
>>
>
> Using this, it means you have to ensure SuperCssResource is always 
> injected *before* you createAndBindUi for the widget.
> Using .genButton.myButton (higher specificity) in the CSS would fix it.
>

Yes, and in this example I would make sure to inject LeafCssResource which 
would thereby inject SuperCssResource.
And adding .genButton to further the specificity of .myButton would indeed 
fix, however the point I'm trying to make is that I think it's
unreasonable to either overqualify every selector for fear of having your 
styles be overridden because of precedence or that developers
need to be aware of all the other styles they would be affecting when 
creating their own widget trying to qualify their selectors with a global 
cssresource.

 
>
>> and WidgetDisplayedSecond which uses LeafCssResource
>>
>> --
>>
>> Now if while my app is running I just display WidgetDisplayedFirst then 
>> it will display its button
>> with the correct color: red because the .myButton was declared last and 
>> thus overrides the .genButton which
>> has the same specificity.
>>
>> The issue comes into play if I then display WidgetDisplayedSecond. Since 
>> WidgetDisplayedSecond uses LeafCssResource
>> this will cause SuperCssResource and its css to be injected when 
>> LeafCssResource is injected.
>>
>
> No. Unless you have a @Shared annotation on SuperCssResource, the names 
> from LeafCssResource will be different from those of SuperCssResource (so 
> even if you referenced the same CSS file in @Source of your 2 ClientBundle 
> methods, you'd have duplicated rules with different selectors, in no way 
> would SuperCssResource be "reinjected").
> See http://www.gwtproject.org/doc/latest/DevGuideClientBundle.html#Scope
>

Yes, and I should have actually put the @Shared in the example. I didn't 
remember to add it because I was talking about reusing selectors in the 
leaf css to qualify in which case you would need to have the same names or 
else the qualifying would not work at all since the names would be 
different. So in this case I am talking about using the @Shared on the 
SuperCssResource and that you do see the selectors from SuperCssResource's 
css reinjected when you inject LeafCssResource.
 

>  
>
>> At this point because
>> SuperCssResource has now been reinjected and thus is now the last one 
>> declared between it and MyCssResource, its
>> .genButton rule now wins and causes WidgetDisplayedFirst's button to now 
>> have a color of black.
>>
>

Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-21 Thread GWTter
Hi Jens,

Yes, this duplication when extending CssResources is exactly the issue I'm 
trying to highlight above and mitigate with the @required idea. Your 
suggestion is what I was trying to cover with the third option I gave above 
on how to avoid the duplication and unintended precedence override 
(although you do go a bit more in-depth into what it would actually look 
like). And I apologize if I'm giving the impression that this is an active 
issue which I don't know how to workaround or remedy, that's not my 
intention.

I'm trying to say that I've come across this issue several times before, 
and while I'm aware of the cause and the current workarounds/remedies (as I 
try to briefly summarize in the 3 options above), I feel that they are not 
satisfactory enough when considering the scaling and maintenance of large 
webapps. This is why I'm trying to discuss the feasibility and/or 
ramifications of something like the @required because I think it's 
somewhere GWT would be able to shine and facilitate the scalability and 
maintainability of these webapps.

Thanks for you response.

On Friday, February 21, 2014 12:36:08 AM UTC+1, Jens wrote:
>
> If you write a widget and that widget uses a button and that button has a 
> default style defined in a BaseCssResource then you should use that 
> BaseCssResource directly in your widget. You should not make your 
> WidgetCssResource extend the BaseCssResource. Why? Because as soon as you 
> do so, all the CSS rules of BaseCssResource will be duplicated (even if the 
> BaseCssResource is annotated with @Shared, which will cause the issue you 
> describe) and that is not what you want. Imagine you have 50 widgets and 
> each of their CssResources extends the BaseCssResource. You would end up 
> with 50 times the same base CSS code injected in your html page (either 
> with the same CSS class names if you use @Shared on your BaseCssResource or 
> with different CSS class names if not).
>
> What you should do in all your widgets is:
>
> 
>
> 
>   .redbutton { background-color:red; }
> 
>
> 
>
> And in your custom widget constructor you would do
>
> public MyWidget() {
>   bundle.baseCss().ensureInjected();
> }
>
> That way your base CSS is only injected once into your HTML page and all 
> your widgets use these rules directly instead of duplicating them over and 
> over again. It is also clear, just by looking at the xml/code, that the 
> base CSS is shared by multiple widgets and that the  CSS is only 
> local to that single widget.
>
>
> -- 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.


Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-20 Thread GWTter
Before anything, sorry Thomas, I think I may have just replied to you 
instead of just the topic (buttons bugged on me a bit), no-spam intended

You're right I guess I did misunderstand if the imported with prefix 
doesn't in fact use a different obfuscation
for the original selectors in the final css. So using the imported with 
prefix method isn't a viable workaround for avoid the
precedence override on injection after all.

And definitely, anything that will help clear it up. I can try to clarify 
my original example:

You have the following,

=== Pseudocode ===

CssResouces:

SuperCssResource, is injected onModuleLoad (global css) and has the 
following css as its source:
.genButton{
color: black;
}

and

LeafCssResource extends SuperCssResource
 
css definitions here 



Finally, we have the following 2 widgets:

WidgetDisplayedFirst, 
has the following css via uibinder:
MyCssResource:
.myButton{
color: red;
}

And this button element:



and WidgetDisplayedSecond which uses LeafCssResource

--

Now if while my app is running I just display WidgetDisplayedFirst then it 
will display its button
with the correct color: red because the .myButton was declared last and 
thus overrides the .genButton which
has the same specificity.

The issue comes into play if I then display WidgetDisplayedSecond. Since 
WidgetDisplayedSecond uses LeafCssResource
this will cause SuperCssResource and its css to be injected when 
LeafCssResource is injected. At this point because
SuperCssResource has now been reinjected and thus is now the last one 
declared between it and MyCssResource, its
.genButton rule now wins and causes WidgetDisplayedFirst's button to now 
have a color of black.

Now, granted, this is how Css is intended to work in terms of the cascade. 
However, what I'm trying to say is that this
is an example of a case where that is not the desired outcome if you want 
the button to keep the color of red as defined
in its MyCssResource.

You really only have 3 options in order to prevent this currently as far as 
I can see:
1) You over-qualify all of your selectors to ensure that they always have 
the most specifity and nothing
will override them
=>CON: over-qualifying is not great for performance and is not as 
maintainable/cascadeable

2) You architect the app taking into account every single inheriting 
resource that is injected dynamically/on-demand to make sure
that the injection of the extended resource does not cause an override in 
widgets who are using its classes.
=>CON: extremely unrealistic for non-trivial apps much less a real web-app

3)Do not extend CssResources, this way you can ensure that all resources 
and their associated styles are ONLY injected
once in the lifetime of the app so there are no worries of unintended 
precedence overrides.
=>CON: greatly restricts selector qualifying especially when trying to 
localize css and reuse widgets

I think you can see why these 3 options are unappealing. I'd argue that 
this isn't an issue for static web pages
and the non-webapp era since you could relegate css to a page and count on 
the browser refresh to always provide
a clean slate. However, in the web-app era this seems to be a big issue 
maintainability-wise if nothing else.

This is why I was suggesting the @required functionality so the developer 
can have some assurance that styles won't be
injected more than once and thus be assured that if someone displays their 
widget anywhere then it won't break something else.

Hope that somewhat clears up what I'm trying to say.

Thanks again for the discussion.

On Thursday, February 20, 2014 1:15:48 PM UTC+1, Thomas Broyer wrote:
>
>
>
> On Thursday, February 20, 2014 12:08:28 AM UTC+1, GWTter wrote:
>>
>>
>>
>> On Wednesday, February 19, 2014 10:59:51 AM UTC+1, Thomas Broyer wrote:
>>>
>>>
>>>
>>> On Tuesday, February 18, 2014 6:38:36 PM UTC+1, GWTter wrote:
>>>>
>>>> Hi all,
>>>>
>>>> Let me just go with an example right off the bat.
>>>>
>>>> Let's say I have the following:
>>>>
>>>> === Pseudocode ===
>>>>
>>>> SuperCssResource: This is injected onModuleLoad before anything else
>>>> .genButton{
>>>> color: black;
>>>> }
>>>>
>>>> Widget1 consists of:
>>>> --- css ---
>>>> MyCssResource:
>>>> .myButton{
>>>> color: red;
>>>> }
>>>>
>>>> --- html ---
>>>> 
>>>>
>>>> Widget2 consists of:
>>>> --- css ---
>>>> XCssResource extends SuperCssResource:
>>>> ... rules that use classes from SuperCs

Re: CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-19 Thread GWTter


On Wednesday, February 19, 2014 10:59:51 AM UTC+1, Thomas Broyer wrote:
>
>
>
> On Tuesday, February 18, 2014 6:38:36 PM UTC+1, GWTter wrote:
>>
>> Hi all,
>>
>> Let me just go with an example right off the bat.
>>
>> Let's say I have the following:
>>
>> === Pseudocode ===
>>
>> SuperCssResource: This is injected onModuleLoad before anything else
>> .genButton{
>> color: black;
>> }
>>
>> Widget1 consists of:
>> --- css ---
>> MyCssResource:
>> .myButton{
>> color: red;
>> }
>>
>> --- html ---
>> 
>>
>> Widget2 consists of:
>> --- css ---
>> XCssResource extends SuperCssResource:
>> ... rules that use classes from SuperCssResource
>>
>> --- html ---
>> ...elements
>>
>> My problem is that if I display Widget1 first and then display Widget2 
>> then the button in Widget1 will have a color of black instead of red.
>>
>> I know that this is expected behavior (GWT will merge the stylesheets 
>> together) since inheritance is basically the cssresource equivalent of CSS 
>> @import <http://www.w3.org/TR/css3-cascade/#at-import>
>>
>
> Er, no.
>
> Inheritance of CssResource interfaces only deals with that: inheriting 
> methods. The actual CSS backing the resource is given by the @Source 
> annotation on your ClientBundle method, and if you use the same CSS file 
> for 2 different CssResource interfaces, the CSS will be duplicated, because 
> obfuscation of the class names is based on the interface fully-qualified 
> name: http://www.gwtproject.org/doc/latest/DevGuideClientBundle.html#Scope 
> (the 
> order of the files in @Source will impact merging, just as they'd impact 
> precedence in CSS).
>

Hi Thomas,

I guess I should have specified that it is inheritance along with 
specifying the source css that for all intents and purposes acts like CSS 
@import. I know that GWT will error if you extend the super resource and 
don't include it's source to match the classes, unless you're 
reimplementing them in the extending css resource which is not what I'm 
after and not the best idea IMHO. 

>  
>
>> but I thought since this was GWT maybe there was a way to use inheritance 
>> in the sense that the inherited stylesheet would only be injected if
>> not injected already. Is this currently possible? or could it be done 
>> with like a @Require annotation on the extending interface which would 
>> indicate
>> that merging of the super stylesheet should not be done but rather a 
>> check would be made to see if it already exists and if not to inject it.
>> This would easily resolve the specificity overriding issue in the example 
>> when it's not the desired behavior.
>>
>> I know I could also get around this by importing with a prefix, however I 
>> still don't like the idea of essentially reinjecting the same styles.
>>
>
> If you don't want duplication, then you need a "shared scope" or "imported 
> scope". In any case, that means you should only use the shared/imported 
> class names in more complex selectors, you shouldn't change the styles 
> attached to the selector by itself.
>
> None of this applies if you use "@external" though, then it just works 
> like standard CSS.
>

I know, like you mentioned, that I could avoid the precedence override by 
importing with prefix for example. And my use case is only to increase 
specificity on the extending css resource, definitely not to change the 
super's rule def by redefining the super selector in the extending 
resource. But I'm not thrilled with essentially reinjecting all the same 
rules with just different prefixes and @external does really fit my need as 
I don't want to forgo the obfuscation. 

>
> …and no, there's no way to say "please make sure that other stylesheet is 
> injected when injecting that one", because, to begin with, it'd be hard to 
> define what "that other stylesheet" is (the interface is not enough, given 
> that the @Source is set on the ClientBundle method, so you'd have to say 
> "this method from this ClientBundle interface", but it wouldn't even be 
> enough: what if you composed that interface with another one and 
> GWT.create()d the composed interface? should that @Require mean that GWT 
> would do a GWT.create() of the lone interface, therefore duplicating 
> efforts? –in all honesty, I haven't looked closely at the impact in terms 
> of generated code and how it could be optimized, but it could limit future 
> evolutions of ClientBundle in which c

CssResource inheritance and avoiding rule repetition on injection, possibility of an @Require?

2014-02-18 Thread GWTter
Hi all,

Let me just go with an example right off the bat.

Let's say I have the following:

=== Pseudocode ===

SuperCssResource: This is injected onModuleLoad before anything else
.genButton{
color: black;
}

Widget1 consists of:
--- css ---
MyCssResource:
.myButton{
color: red;
}

--- html ---


Widget2 consists of:
--- css ---
XCssResource extends SuperCssResource:
... rules that use classes from SuperCssResource

--- html ---
...elements

My problem is that if I display Widget1 first and then display Widget2 then 
the button in Widget1 will have a color of black instead of red.

I know that this is expected behavior (GWT will merge the stylesheets 
together) since inheritance is basically the cssresource equivalent of CSS 
@import 
but I thought since this was GWT maybe there was a way to use inheritance 
in the sense that the inherited stylesheet would only be injected if
not injected already. Is this currently possible? or could it be done with 
like a @Require annotation on the extending interface which would indicate
that merging of the super stylesheet should not be done but rather a check 
would be made to see if it already exists and if not to inject it.
This would easily resolve the specificity overriding issue in the example 
when it's not the desired behavior.

I know I could also get around this by importing with a prefix, however I 
still don't like the idea of essentially reinjecting the same styles.

Any thoughts? 

Much thanks in advance.

-- 
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: RequestFactory issue with return operation processing if entities referenced in collection are processed after the collection they appear in is processed

2013-11-23 Thread GWTter
Ended up actually opening an issue so just wanted to add the link: 
https://code.google.com/p/google-web-toolkit/issues/detail?id=8465

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


RequestFactory issue with return operation processing if entities referenced in collection are processed after the collection they appear in is processed

2013-10-17 Thread GWTter
Hi all,

I'm pretty sure this is RF issue but thought I'd post here first just in 
case.

This involves the case where you update a an entity with a collection in 
which another entity is being persisted. When the response returns from the 
server and the operation messages are processed the following will occur:

The ClientId is always zero when parsed out from collections and thus the 
simpleproxyID lookup in the collection is always done by serverkey. This 
means that if the collection contains an entity that was created on the 
client and persisted is processed first then a new simple proxy will be 
created for that serverkey combo. Now when the actual related entity is 
processed (afterward) the clientId will be populated and so the system will 
do the lookup by the client ID for the simpleproxyID and then associate 
that simpleproxyID
with the serverkey which will override the simpleproxyID mapping created 
when the factory saw the serverkey first. Since that old mapping was 
overridden then the related proxy in the collection is not updated and 
returned as if it were still new with all fields unpopulated. 

This doesn't occur if the persisted entity is processed before the 
collection since after the IdFactory sees an entity that has both a clienID
and a serverID then it will retrieve the original simpleproxyID and update 
it the mapping to using the serverID, thus when the serverID is used in the 
lookup to populate the collection afterward it will find the correct 
simpleproxyID.

Again, this issue becomes all the more hard to spot since it ONLY occurs if 
the persisted entity is processed AFTER the collection it is referenced in. 
Since the order in which the operations being built client side is 
indeterminate (from the map) you can't tell when the entity will appear 
afterward.

The fix I had in mind with the big problem being that the returnedProxies 
mapping must always map from the correct simpleproxyId:
when processing the returned operations if the clientId > 0, we should 
first check if there's already a simpleproxyid for the serverid, if there 
is then we need to swap that mapping in state.returnedProxies when the 
simpleproxyid returned from using the serverid and non-zero client id. That 
way the mapping in state.returnProxies always maps from the correct 
simpleproxyid. Since a call to getId always creates a simpleproxyid then we 
would also need to be able to access the ephemeralId map in order to check 
it without creating a simpleidproxy. 


Any thoughts?

-Seth

Client ID is always zero when parsed out in collections and thus the 
simpleproxyID
lookup in the collection is always done by serverkey!!! This means that
if the collection containing an entity that was created on the client and 
persisted
is read first then a new simple proxy will be created for that serverkey combo
and thus a new proxy will be associated to it. Then when the actual related 
entity is
read (after the collection having been read) the client Id will be populated 
and so the system
will do the lookup by the client ID for the simpleproxyID and then associate 
that simpleproxyID
with the serverkey which will override the simpleproxyID mapping created when 
the factory
saw the serverkey first. Since that old mapping was overridden then the related 
proxy in the collection is
not updated and returned as if it were still new. This doesn't occur if the 
persisted entity
is read before the collection since after the IdFactory sees an entity that has 
both a clienID
and a serverID then it will store the associated simpleproxyID by then 
serverID, thus when
the serverID is used in the lookup to populate the collection afterward it will 
find the correct
simpleproxyID.

Client ID is always zero when parsed out in collections and thus the 
simpleproxyID
lookup in the collection is always done by serverkey!!! This means that
if the collection containing an entity that was created on the client and 
persisted
is read first then a new simple proxy will be created for that serverkey combo
and thus a new proxy will be associated to it. Then when the actual related 
entity is
read (after the collection having been read) the client Id will be populated 
and so the system
will do the lookup by the client ID for the simpleproxyID and then associate 
that simpleproxyID
with the serverkey which will override the simpleproxyID mapping created when 
the factory
saw the serverkey first. Since that old mapping was overridden then the related 
proxy in the collection is
not updated and returned as if it were still new. This doesn't occur if the 
persisted entity
is read before the collection since after the IdFactory sees an entity that has 
both a clienID
and a serverID then it will store the associated simpleproxyID by then 
serverID, thus when
the serverID is used in the lookup to populate the collection afterward it will 
find the correct
simpleproxyID.

Client ID is always zero when parsed out in collections and thus the 
simpl

Re: GWT + Postgres not working when deployed

2013-10-17 Thread GWTter
Sounds like your postgresjdbc is not on the classpath when building the 
war. Have you made sure that it would be included in the classpath in the 
build.xml?

On Thursday, October 17, 2013 5:20:01 PM UTC+2, Sean wrote:
>
> I have a project that talks to Postgres on the server side. I have the 
> JDBC jar in the WEB-INF/lib folder. When I run it on my machine it works 
> fine. But when I deploy it to a TOMCAT instance I get:
>
> java.sql.SQLException: No suitable driver found for 
> jdbc:postgresql://localhost/grp91-in-out
> at java.sql.DriverManager.getConnection(Unknown Source)
> at java.sql.DriverManager.getConnection(Unknown Source)
> at 
> com.ll.grp91.server.GroupInfoServiceImpl.getGroupMembers(GroupInfoServiceImpl.java:45)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> .
>
> I've also tried putting the .jar into the Tomcat/lib folder. Still no 
> good. I've also tried restarting the service.
>
> Any ideas?
>
>
>

-- 
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: Using @UiChild with Elements not widgets, is this even possible?

2013-10-05 Thread GWTter
Hi Thomas,

Just one last thing, are there still no plans for uibinder element parsing 
functionality extension like the patch in this 
issue<http://code.google.com/p/google-web-toolkit/issues/detail?id=4461>? 
Would be preeetty awesome.

On Saturday, October 5, 2013 10:54:36 PM UTC+2, Thomas Broyer wrote:
>
> Ah sorry, hadn't looked carefully at your code: with 
> @UiChild(tagname="div"), UiBinder expects a  ("my" being the same 
> as the containing widget):
>
> 
>   
> 
>   foo
> 
>   
> 
>
> That doesn't change the problem though: apparently (looking at the code), 
> only widgets are allowed. With the above XML, the "my:div" only exists to 
> call the @UiChild method, passing the HTMLPanel as argument.
>
> On Saturday, October 5, 2013 10:49:11 PM UTC+2, Thomas Broyer wrote:
>>
>> Looks like I was wrong and you can only use widgets (there's an explicit 
>> "isImportedElement" test that checks the element is within a namespace 
>> whose URI starts with “urn:import:”)
>>
>> BTW, isn't the error message rather “Expected child from a urn:import 
>> namespace, found ” ?
>>
>> On Saturday, October 5, 2013 9:56:14 PM UTC+2, GWTter wrote:
>>>
>>> Hi all,
>>>
>>> Although the 
>>> doc<http://www.gwtproject.org/javadoc/latest/com/google/gwt/uibinder/client/UiChild.html>
>>>  does 
>>> say "...add a child widget to..." in my searching it seems as if you can 
>>> also use UiChild with DOM elements that extend 
>>> com.google.gwt.dom.client.Element class. Thomas Broyer gives a brief 
>>> description 
>>> here<https://groups.google.com/d/msg/google-web-toolkit/INTb5tmTyIE/J0hfkoOCXN0J>.
>>>  
>>> Since it's Thomas I'm thinking this should indeed work, however for the 
>>> life of me I can't get it to. It always ends up in "found unexpected child 
>>> element: " when the child is a div element. 
>>>
>>> From the comments and the doc it seems that this is the setup you're 
>>> supposed to have:
>>>
>>> @UiChild(tagname = DivElement.TAG)
>>> public void addDiv(DivElement div) {  //note: I've even tried "adddiv" 
>>> just to be sure
>>>   //do something 
>>> }
>>>
>>> and in uibinder:
>>>
>>> 
>>>   foo
>>> 
>>>
>>>
>>> Do I just have code tunnel vision or is this not possible? Thanks in 
>>> advance.
>>>
>>> -Seth
>>>
>>

-- 
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: Using @UiChild with Elements not widgets, is this even possible?

2013-10-05 Thread GWTter
I see. No problem though, thanks a lot for the explanation. I have a work 
around for this, I just wanted to make sure that I wasn't going that route 
if uichild on elements was possible. Thanks again Thomas.

On Saturday, October 5, 2013 10:54:36 PM UTC+2, Thomas Broyer wrote:
>
> Ah sorry, hadn't looked carefully at your code: with 
> @UiChild(tagname="div"), UiBinder expects a  ("my" being the same 
> as the containing widget):
>
> 
>   
> 
>   foo
> 
>   
> 
>
> That doesn't change the problem though: apparently (looking at the code), 
> only widgets are allowed. With the above XML, the "my:div" only exists to 
> call the @UiChild method, passing the HTMLPanel as argument.
>
> On Saturday, October 5, 2013 10:49:11 PM UTC+2, Thomas Broyer wrote:
>>
>> Looks like I was wrong and you can only use widgets (there's an explicit 
>> "isImportedElement" test that checks the element is within a namespace 
>> whose URI starts with “urn:import:”)
>>
>> BTW, isn't the error message rather “Expected child from a urn:import 
>> namespace, found ” ?
>>
>> On Saturday, October 5, 2013 9:56:14 PM UTC+2, GWTter wrote:
>>>
>>> Hi all,
>>>
>>> Although the 
>>> doc<http://www.gwtproject.org/javadoc/latest/com/google/gwt/uibinder/client/UiChild.html>
>>>  does 
>>> say "...add a child widget to..." in my searching it seems as if you can 
>>> also use UiChild with DOM elements that extend 
>>> com.google.gwt.dom.client.Element class. Thomas Broyer gives a brief 
>>> description 
>>> here<https://groups.google.com/d/msg/google-web-toolkit/INTb5tmTyIE/J0hfkoOCXN0J>.
>>>  
>>> Since it's Thomas I'm thinking this should indeed work, however for the 
>>> life of me I can't get it to. It always ends up in "found unexpected child 
>>> element: " when the child is a div element. 
>>>
>>> From the comments and the doc it seems that this is the setup you're 
>>> supposed to have:
>>>
>>> @UiChild(tagname = DivElement.TAG)
>>> public void addDiv(DivElement div) {  //note: I've even tried "adddiv" 
>>> just to be sure
>>>   //do something 
>>> }
>>>
>>> and in uibinder:
>>>
>>> 
>>>   foo
>>> 
>>>
>>>
>>> Do I just have code tunnel vision or is this not possible? Thanks in 
>>> advance.
>>>
>>> -Seth
>>>
>>

-- 
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: what is the shortest code to make sure a dialogbox to stay inside an area when users try to move it out of that area?

2013-10-05 Thread GWTter
Actually I realized that you were asking specifically about a Dialog box 
(my initial answer was based on basic DnD). If you're overriding the 
*Dragging methods then you can just check the mouse position from the 
events like I said.

On Saturday, October 5, 2013 10:11:27 PM UTC+2, GWTter wrote:
>
> I know you said shortest code but that's too arbitrary of a request 
> considering that it would depend on your code too,
>
> On Saturday, October 5, 2013 10:09:35 PM UTC+2, GWTter wrote:
>>
>> The only way the the popup is going to drag (barring the use of native 
>> dnd) is if you adjust its top and left. If you can move your popup then you 
>> should already be adjusting the top and left in your code. The popup isn't 
>> going to be aware that it's moving (keeping in mind good design) so you 
>> should be adjusting its position based on the mouse position relative to 
>> the popup and its client coordinates. So just check your mouse position 
>> relative to the popup to see if its going out of bounds in which case you 
>> stop adjusting the popup position.
>>
>> On Saturday, October 5, 2013 7:41:43 PM UTC+2, Tom wrote:
>>>
>>> Ok, let say I want my dialogbox to be moved within an area that have 
>>> 500px width & 600px height. 
>>>
>>> The rule is that If the users move the dialogbox out of that area, then 
>>> the dialogbox will stay at where it was right at the point that it will be 
>>> about to break the rule.
>>>
>>> int currentTop=dialogBox.getPopupTop();
>>> int currentLeft=dialogBox.getPopupLeft();
>>>
>>> Ex: if the left of the dialogbox >500px & top >600px then 
>>> .setPopupPosition(500, 
>>> 600);
>>> if  the left of the dialogbox >500px & top <600px & top>0 then 
>>> .setPopupPosition(500, 
>>> currentTop);
>>> if  the left of the dialogbox <500px & >0 & top <600px & top>0 then 
>>> .setPopupPosition(currentLeft, 
>>> currentTop);
>>>  there are many other cases,
>>>
>>> So what is the shortest code to make sure a dialogbox to stay inside an 
>>> area when users try to move it out of that area, see an ex like this
>>> https://gwt-dnd.appspot.com/#WindowExample
>>>
>>> U will see that u can't move the object out of the constrained area.
>>>
>>>

-- 
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: what is the shortest code to make sure a dialogbox to stay inside an area when users try to move it out of that area?

2013-10-05 Thread GWTter
I know you said shortest code but that's too arbitrary of a request 
considering that it would depend on your code too,

On Saturday, October 5, 2013 10:09:35 PM UTC+2, GWTter wrote:
>
> The only way the the popup is going to drag (barring the use of native 
> dnd) is if you adjust its top and left. If you can move your popup then you 
> should already be adjusting the top and left in your code. The popup isn't 
> going to be aware that it's moving (keeping in mind good design) so you 
> should be adjusting its position based on the mouse position relative to 
> the popup and its client coordinates. So just check your mouse position 
> relative to the popup to see if its going out of bounds in which case you 
> stop adjusting the popup position.
>
> On Saturday, October 5, 2013 7:41:43 PM UTC+2, Tom wrote:
>>
>> Ok, let say I want my dialogbox to be moved within an area that have 
>> 500px width & 600px height. 
>>
>> The rule is that If the users move the dialogbox out of that area, then 
>> the dialogbox will stay at where it was right at the point that it will be 
>> about to break the rule.
>>
>> int currentTop=dialogBox.getPopupTop();
>> int currentLeft=dialogBox.getPopupLeft();
>>
>> Ex: if the left of the dialogbox >500px & top >600px then 
>> .setPopupPosition(500, 
>> 600);
>> if  the left of the dialogbox >500px & top <600px & top>0 then 
>> .setPopupPosition(500, 
>> currentTop);
>> if  the left of the dialogbox <500px & >0 & top <600px & top>0 then 
>> .setPopupPosition(currentLeft, 
>> currentTop);
>>  there are many other cases,
>>
>> So what is the shortest code to make sure a dialogbox to stay inside an 
>> area when users try to move it out of that area, see an ex like this
>> https://gwt-dnd.appspot.com/#WindowExample
>>
>> U will see that u can't move the object out of the constrained area.
>>
>>

-- 
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: what is the shortest code to make sure a dialogbox to stay inside an area when users try to move it out of that area?

2013-10-05 Thread GWTter
The only way the the popup is going to drag (barring the use of native dnd) 
is if you adjust its top and left. If you can move your popup then you 
should already be adjusting the top and left in your code. The popup isn't 
going to be aware that it's moving (keeping in mind good design) so you 
should be adjusting its position based on the mouse position relative to 
the popup and its client coordinates. So just check your mouse position 
relative to the popup to see if its going out of bounds in which case you 
stop adjusting the popup position.

On Saturday, October 5, 2013 7:41:43 PM UTC+2, Tom wrote:
>
> Ok, let say I want my dialogbox to be moved within an area that have 500px 
> width & 600px height. 
>
> The rule is that If the users move the dialogbox out of that area, then 
> the dialogbox will stay at where it was right at the point that it will be 
> about to break the rule.
>
> int currentTop=dialogBox.getPopupTop();
> int currentLeft=dialogBox.getPopupLeft();
>
> Ex: if the left of the dialogbox >500px & top >600px then 
> .setPopupPosition(500, 
> 600);
> if  the left of the dialogbox >500px & top <600px & top>0 then 
> .setPopupPosition(500, 
> currentTop);
> if  the left of the dialogbox <500px & >0 & top <600px & top>0 then 
> .setPopupPosition(currentLeft, 
> currentTop);
>  there are many other cases,
>
> So what is the shortest code to make sure a dialogbox to stay inside an 
> area when users try to move it out of that area, see an ex like this
> https://gwt-dnd.appspot.com/#WindowExample
>
> U will see that u can't move the object out of the constrained area.
>
>

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


Using @UiChild with Elements not widgets, is this even possible?

2013-10-05 Thread GWTter
Hi all,

Although the 
doc
 does 
say "...add a child widget to..." in my searching it seems as if you can 
also use UiChild with DOM elements that extend 
com.google.gwt.dom.client.Element class. Thomas Broyer gives a brief 
description 
here.
 
Since it's Thomas I'm thinking this should indeed work, however for the 
life of me I can't get it to. It always ends up in "found unexpected child 
element: " when the child is a div element. 

>From the comments and the doc it seems that this is the setup you're 
supposed to have:

@UiChild(tagname = DivElement.TAG)
public void addDiv(DivElement div) {  //note: I've even tried "adddiv" just 
to be sure
  //do something 
}

and in uibinder:


  foo



Do I just have code tunnel vision or is this not possible? Thanks in 
advance.

-Seth

-- 
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: Developer plugin for Firefox 23 doesn't work

2013-09-04 Thread GWTter
Has anyone tried just removing the plugin and reinstalling it? I was having 
the same issue and that seems to have remedied it.

On Thursday, August 29, 2013 4:46:04 PM UTC+2, Emil Burzo wrote:
>
> On Friday, August 16, 2013 12:42:01 PM UTC+3, Gražvydas Valeika wrote:
>
>> Hi,
>>
>> I just updated FF to 23. And I see strange behavior.
>>
>> Developer plugin properly installed and shows version 1.23 and latest 
>> update date of today,
>>
>> but while starting DevMode application I'm getting 'Development Mode 
>> requires the Google Web Toolkit Developer Plugin' prompt. I'm installing 
>> plugin again, FF restarts, but while trying again I am getting plugin 
>> install prompt as I wouldn't have plugin installed.
>>
>> :(
>>
>> Fedora 18, 64bit.
>>
>>
>> Thanks,
>>
>> Grazvydas
>>
>
> Happening to me also.
>
> If I open up the error console, I can see this message:
>
> Failed to load native module at path 
> '/home/eaglex/.mozilla/firefox/ddmltom4.default/extensions/
> gwt-dev-plu...@google.com/lib/Linux_x86_64-gcc3/ff230/libgwt_dev_ff230.so': 
> (80004005) /usr/lib/firefox/libxul.so: version `xul23.0' not found 
> (required by /home/eaglex/.mozilla/firefox/ddmltom4.default/extensions/
> gwt-dev-plu...@google.com/lib/Linux_x86_64-gcc3/ff230/libgwt_dev_ff230.so)
>
> I'm guessing it's related. 
>
> Anyone have an idea on what to look for? My google-fu is weak with this 
> one. 
>
>

-- 
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: RequestFactory .with() to access non-relation (primitive) properties?

2013-07-24 Thread GWTter
Hi Thomas,

This is great, I was hoping this was the case. I knew polymorphism worked 
well but I wasn't sure whether you could define EntityProxy super classes 
and that RF would still be able to find the super class properties from the 
child proxy without having to explicitly define them in the child 
EntityProxy. Thanks for the good news, RF just got way better.

On Wednesday, July 24, 2013 2:40:29 PM UTC+2, Thomas Broyer wrote:
>
>
> On Wednesday, July 24, 2013 2:36:34 PM UTC+2, Thomas Broyer wrote:
>>
>>
>>
>> On Wednesday, July 24, 2013 1:39:19 PM UTC+2, GWTter wrote:
>>>
>>> Will do. My approach would involve distinct proxies since I don't think 
>>> RF allows for inheritance on EntityProxys even if they both have @proxyfor 
>>> defined because it looks for the methods defined exactly on the proxy (it 
>>> definitely won't currently let you do it server-side with your locators). 
>>> This is the only drawback I can see using this approach since you'd have to 
>>> redefine fields that would be granted with inheritance. But I'll definitely 
>>> give both a try again.
>>>
>>
>> Inheritance of proxies works well; RequestFactory even supports 
>> polymorphism (o in your case you'll want to test which exact proxy RF 
>> returns, and possibly split the common properties out to an interface used 
>> as the super-interface for 2 distinct, unrelated proxies)
>> What won't work currently are generics and overrides with co-variant 
>> return types (see 
>> https://gwt-review.googlesource.com/#/c/3831/2/user/test/com/google/web/bindery/requestfactory/gwt/client/RequestFactoryGenericsTest.java
>>  for 
>> a "gory" test), but it otherwise works very well.
>>
>
> BTW, see “Polymorphic type-mapping rules” in 
> http://www.gwtproject.org/doc/latest/DevGuideRequestFactory.html#transportable
> And I'd even say that not only this is a supported use-case, it's actually 
> the approach I'd recommend. 
>

-- 
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: RequestFactory .with() to access non-relation (primitive) properties?

2013-07-24 Thread GWTter
Will do. My approach would involve distinct proxies since I don't think RF 
allows for inheritance on EntityProxys even if they both have @proxyfor 
defined because it looks for the methods defined exactly on the proxy (it 
definitely won't currently let you do it server-side with your locators). 
This is the only drawback I can see using this approach since you'd have to 
redefine fields that would be granted with inheritance. But I'll definitely 
give both a try again.

On Wednesday, July 24, 2013 1:26:31 PM UTC+2, salk31 wrote:
>
> If you try the multiple Proxies approach could you report back to the 
> group? Be interesting to hear if it works out nicely. Proxies being allowed 
> to have their own inheritance tree etc seems powerful but I'm quite sure 
> for good or evil.
>
> On Wednesday, July 24, 2013 12:20:11 PM UTC+1, GWTter wrote:
>>
>> Thanks for the reply.
>>
>> Yea :/, the work involved in fiddling with the service layer decorator 
>> and server-side RF at that level currently outweighs the benefit for my 
>> need which is what I was avoiding. I think if I fiddled at that level I 
>> might just end up making the .with() work with primitives also. It would be 
>> a nice to have as the property resolution already does this for the proxy, 
>> I can't see the extension of .with() to include this as being much more 
>> complex.
>>
>> And thanks, an annotation like PreAuthorize is something nice to keep in 
>> mind if you're going to go into the decorator. The other way I thought of 
>> doing it would be to have 2 different entity proxies for the same entity. 
>> That way you could keep and use 2 different property definitions/contracts 
>> for the same entity and use the most appropriate one. This would also keep 
>> the code cleaner and more cohesive as your functionality can be written 
>> around the appropriate contract, at least in my opinion.
>>
>> On Wednesday, July 24, 2013 9:24:40 AM UTC+2, salk31 wrote:
>>>
>>> I'm pretty sure by default you can't. If you feel the urge to fiddle you 
>>> could do something in ServiceLayerDecorator.getProperty that picks up on 
>>> some extra state with the request.
>>>
>>> I know the requirement you mean though. Some extra layer of fetch 
>>> profile. Not sure it would be worth the extra complexity though.
>>>
>>> We do something similar though for security. We have @PreAuthorize on 
>>> getters and setters and our ServiceLayerDecorator returns nulls when the 
>>> user is not allowed to read that property and ignore any requests to write 
>>> to those properties.
>>>
>>> On Wednesday, July 24, 2013 12:20:35 AM UTC+1, GWTter wrote:
>>>>
>>>> Hi all,
>>>>
>>>> I have a String username field on a user entity which I'd rather not 
>>>> populate whenever I request it which is why I have not defined the getter 
>>>> in the EntityProxy. This works fine, however there are some instances 
>>>> where 
>>>> I would like to have RequestFactory populate that string field when I 
>>>> retrieve the object. 
>>>> I know the documentation says that .with() is to be used to retrieve 
>>>> relations and in my tests I found that .with("username") does not pull it 
>>>> down either. Now I don't think it is possible but I wanted to make sure 
>>>> before implementing it another way that it  is indeed not possible. It 
>>>> would be much cleaner to just be able to retrieve that property using 
>>>> .with() and being able to use the same request. 
>>>>
>>>> Does anyone have an idea?
>>>>
>>>> Thanks in advance,
>>>>
>>>> -Seth
>>>>
>>>

-- 
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: RequestFactory .with() to access non-relation (primitive) properties?

2013-07-24 Thread GWTter
Thanks for the reply.

Yea :/, the work involved in fiddling with the service layer decorator and 
server-side RF at that level currently outweighs the benefit for my need 
which is what I was avoiding. I think if I fiddled at that level I might 
just end up making the .with() work with primitives also. It would be a 
nice to have as the property resolution already does this for the proxy, I 
can't see the extension of .with() to include this as being much more 
complex.

And thanks, an annotation like PreAuthorize is something nice to keep in 
mind if you're going to go into the decorator. The other way I thought of 
doing it would be to have 2 different entity proxies for the same entity. 
That way you could keep and use 2 different property definitions/contracts 
for the same entity and use the most appropriate one. This would also keep 
the code cleaner and more cohesive as your functionality can be written 
around the appropriate contract, at least in my opinion.

On Wednesday, July 24, 2013 9:24:40 AM UTC+2, salk31 wrote:
>
> I'm pretty sure by default you can't. If you feel the urge to fiddle you 
> could do something in ServiceLayerDecorator.getProperty that picks up on 
> some extra state with the request.
>
> I know the requirement you mean though. Some extra layer of fetch profile. 
> Not sure it would be worth the extra complexity though.
>
> We do something similar though for security. We have @PreAuthorize on 
> getters and setters and our ServiceLayerDecorator returns nulls when the 
> user is not allowed to read that property and ignore any requests to write 
> to those properties.
>
> On Wednesday, July 24, 2013 12:20:35 AM UTC+1, GWTter wrote:
>>
>> Hi all,
>>
>> I have a String username field on a user entity which I'd rather not 
>> populate whenever I request it which is why I have not defined the getter 
>> in the EntityProxy. This works fine, however there are some instances where 
>> I would like to have RequestFactory populate that string field when I 
>> retrieve the object. 
>> I know the documentation says that .with() is to be used to retrieve 
>> relations and in my tests I found that .with("username") does not pull it 
>> down either. Now I don't think it is possible but I wanted to make sure 
>> before implementing it another way that it  is indeed not possible. It 
>> would be much cleaner to just be able to retrieve that property using 
>> .with() and being able to use the same request. 
>>
>> Does anyone have an idea?
>>
>> Thanks in advance,
>>
>> -Seth
>>
>

-- 
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: RequestFactory module - queue, retry and non atomic batching..

2013-07-24 Thread GWTter
I knew you guys wouldn't be implementing it that way, but the demo sort of 
gives that impression so the clarification is helpful.

And as far as what most people are using, I'm not sure. However I have seen 
other discussions about implementing such authentication and retry queues 
via the default transport, so I think this would have a place. But we'll 
know for sure once one of the heavy hitters like Mr. Broyer weigh in.

On Wednesday, July 24, 2013 7:54:02 AM UTC+2, salk31 wrote:
>
> Thanks,
>
> We use CAS (single sign on) so what we do is hide the "retry/please wait" 
> message on auth failure and use an iframe to show the CAS login. If they 
> login with that form (or somewhere else) then on a retry the app carries on.
>
> I've very little idea what auth most GWT/RequestFactory people are 
> using... 
>
> The demo is at least confusing though. I'll try and make it a bit more 
> realistic.
>
> Cheers
>
> Sam
>

-- 
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: RequestFactory module - queue, retry and non atomic batching..

2013-07-23 Thread GWTter
Hi,

The mechanism looks pretty good from the demo, nice. I would only say that 
I'm not sure I would use the same retry message for both network and 
authentication failures. Do you really want to keep retrying 
authentications for any other reason than a network failure?

On Tuesday, July 23, 2013 12:27:58 PM UTC+2, salk31 wrote:
>
> I've added a Gmail like UI component and added it to the demo...
>
> On Thursday, July 18, 2013 6:42:15 PM UTC+1, salk31 wrote:
>>
>> Doh. Looked to see how long it would take to put it up on GAE and only 
>> took ten minutes to actually do it.
>>
>> http://gwt-rf-queue.appspot.com/
>>
>> So good old DynaTableRf but with gwt-rf-queue but with the Transport 
>> replaced and a bit of extra UI. 
>>
>

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




RequestFactory .with() to access non-relation (primitive) properties?

2013-07-23 Thread GWTter
Hi all,

I have a String username field on a user entity which I'd rather not 
populate whenever I request it which is why I have not defined the getter 
in the EntityProxy. This works fine, however there are some instances where 
I would like to have RequestFactory populate that string field when I 
retrieve the object. 
I know the documentation says that .with() is to be used to retrieve 
relations and in my tests I found that .with("username") does not pull it 
down either. Now I don't think it is possible but I wanted to make sure 
before implementing it another way that it  is indeed not possible. It 
would be much cleaner to just be able to retrieve that property using 
.with() and being able to use the same request. 

Does anyone have an idea?

Thanks in advance,

-Seth

-- 
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: Anchor does not work in IE - very strange problem!

2013-06-21 Thread GWTter
IE has had developer tools built in as far back as version 8, just press 
F12. If you're working with <=IE7 then: IE dev 
tools. 
Although it may work in other browsers or on the other anchor you want to 
see exactly what is or isn't occurring so you can narrow the scope of the 
issue, else it's a blind guessing game. I would put an alert or println in 
the onClick method to see first if the click is even registering for the 
first button, this will aid you in your analysis and you can then proceed 
from there. You haven't posted the onCommand method so we have no idea if 
the click is even registering in the first button case.

On Friday, June 21, 2013 2:14:26 PM UTC+2, Magnus wrote:
>
> Hi,
>
> my problem is that I cannot analyze what happens.
>
> In chrome (where it works), I can examine the code and it looks like the 
> code below. The two links are exactly the same, with a space between them 
> realized as " ".
> But maybe in IE the code looks different. The same for the JS code. IE 
> always shows the code from the host page, so I cannot examine anything.
>
> I would be happy If I at least were able to see what is going on.
>
> Magnus
>
> -
>
> 
>  
>   
>
>   idx="1481">Öffnen
>
> 
>   
> 
> 
>   idx="1481">Analyse
> 
>
>   
>  
>
>
>

-- 
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: Anchor does not work in IE - very strange problem!

2013-06-21 Thread GWTter
Hi Magnus,

Just for the sake of thoroughness, are you sure that onCommand is even 
being called? Or is it that the click event is not being registered at all?

On Friday, June 21, 2013 11:33:47 AM UTC+2, Magnus wrote:
>
> Hello,
>
> I have a very strange problem with some anchors, which occurrs only in IE 
> and only in certain combinations of version and browser/document modes.
> The problem is, that *some* anchors will not work, allthough *all* anchors 
> are built by the same method!
>
> There is a list of chess games and at the end of each row there are some 
> actions, like "Open" or "Analyze". The actions are realized as anchors. All 
> the anchors for a row/game are put into a single panel, which is inserted 
> into the list.
>
> When the problem occurrs, the first anchor "Open" will not work (meaning 
> that nothing happens), while the second anchor "Analyze" works just fine.
>
> I believe that there must be a side effect somewhere, but I could not find 
> it. Perhaps there is a problem with 
> "OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml". I cannot remember why 
> I decided to use it...
>
> Any ideas how to find the bug or how to do it in another way?
>
> Thanks
> Magnus
>
> -
>
>  private Panel getActions (Game game)
>  {
>   HorizontalPanel p = new HorizontalPanel ();
>   
>   addAction (p,CMD_OPEN,game.idx,"Open");
>   addAction (p,CMD_ANALYZE,game.idx,"Analyze");
> }
>
>  protected void addAction (Panel pnl,int cmd,int idx,String lbl)
>  {
>   Anchor a = createAnchor (cmd,idx,lbl,this);
>
>   if (hasWidgets (pnl))
>pnl.add(new HTML (" "));
>
>   pnl.add(a);
>  }
>
>  private Anchor createAnchor (int cmd,int idx,String lbl,ClickHandler hdl)
>  {
>   SafeHtml h = new OnlyToBeUsedInGeneratedCodeStringBlessedAsSafeHtml(lbl);
>   Anchor a = new Anchor (h);
>   
>   a.addClickHandler(hdl);
>   Element e = a.getElement();
>   
>   e.setAttribute("cmd",Integer.toString(cmd));
>   e.setAttribute("idx",Integer.toString(idx));
>   
>   return (a);
>  }
>
>  public void onClick(ClickEvent evt)
>  {
>   Object o = evt.getSource();
>   
>   if (o == null)
>return;
>   
>   if (!(o instanceof Anchor))
>return;
>
>   Anchor a = (Anchor) o;
>   String t;
>   
>   t = a.getElement().getAttribute("cmd");
>   int cmd = Integer.parseInt(t);
>   t = a.getElement().getAttribute("idx");
>   int idx = Integer.parseInt(t);
>
>   onCommand (cmd,idx);
>  }
>
>

-- 
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: RequestFactory, entity Id not populated when it reaches the server?

2013-06-18 Thread GWTter
Hi Thomas,

I just submitted the issue 
http://code.google.com/p/google-web-toolkit/issues/detail?id=8204, thanks 
again.

On Tuesday, June 18, 2013 9:39:33 AM UTC+2, Thomas Broyer wrote:
>
>
>
> On Monday, June 17, 2013 9:55:09 PM UTC+2, GWTter wrote:
>>
>> Hi,
>>
>> So I went back using the dev tools, inspected the payload, and confirmed 
>> what I had before: the ID is not set at all in the user object payload. 
>> Just to make sure I wasn't crazy or missing something I created just a User 
>> object and tried to save it. I checked the payload in that request and 
>> could clearly see the ID set in the object.
>>
>> I've persisted/sent entities that had field values set with other 
>> entities before. The only difference I can make between the two cases is 
>> that in the previous case the entity I was setting as the field value was 
>> from a request to the server (I had not created it on the client). In this 
>> case the booking entity is created on the client and the user entity is 
>> also created on the client. Could this be the reason why it's failing? 
>> maybe because RF only lets you add entities as fields if they already have 
>> stableIDs? 
>>
>> Thanks again in advance.
>>
>
> If you can make a small repro case, please file an issue; it looks like a 
> critical regression (which would also mean our test suite is weak)
>

-- 
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: RequestFactory, entity Id not populated when it reaches the server?

2013-06-17 Thread GWTter
Hi,

So I went back using the dev tools, inspected the payload, and confirmed 
what I had before: the ID is not set at all in the user object payload. 
Just to make sure I wasn't crazy or missing something I created just a User 
object and tried to save it. I checked the payload in that request and 
could clearly see the ID set in the object.

I've persisted/sent entities that had field values set with other entities 
before. The only difference I can make between the two cases is that in the 
previous case the entity I was setting as the field value was from a 
request to the server (I had not created it on the client). In this case 
the booking entity is created on the client and the user entity is also 
created on the client. Could this be the reason why it's failing? maybe 
because RF only lets you add entities as fields if they already have 
stableIDs? 

Thanks again in advance.


On Monday, June 17, 2013 6:02:53 PM UTC+2, GWTter wrote:
>
> Hi Ümit,
>
> I was actually checking the payload via the DefaultRequestTransport, I 
> could see the user proxy object but I could not see the id anywhere in the 
> payload. I had also put a println in the setID method in the DTO but it was 
> never called which is what I thought was strange since the object seemed to 
> go across the wire. I haven't checked the payload more formally with 
> Chrome's developer tools, so I'll try that next like you suggested after 
> dinner and see if that clears things up, will post back. Thanks for 
> answering.
>
> On Monday, June 17, 2013 5:21:48 PM UTC+2, Ümit Seren wrote:
>>
>> For debugging: Check the RF payload with Chrome Developer Tools and put a 
>> breakpoint in the siteId() method of your backend DTO (it should be called 
>> after the object is created). 
>>
>>
>> On Monday, June 17, 2013 3:59:02 AM UTC+2, GWTter wrote:
>>>
>>> Hi all,
>>>
>>> I have the same setup as in question 
>>> https://groups.google.com/d/msg/google-web-toolkit/GUQjZ98mL7s/MoA2gEMmS28J 
>>> . 
>>> I've included the relevant code from the question below for quick 
>>> reference. My problem is that once the booking entity gets to the server 
>>> and I look for the user, the user field is not null, but the id on the user 
>>> is? Thus I can't check for the actual user. Is the user id not being set in 
>>> the payload for some reason, or is it not building the user entity 
>>> correctly on the server? Thanks a lot in advance for any help, much 
>>> appreciated.
>>>
>>> -Seth
>>>
>>> MainRequestFactory.BookingRequest bookingRequest = 
>>> reqFactory.bookingRequest(); 
>>> BookingProxy bookingProxy = 
>>> bookingRequest.create(BookingProxy.class); 
>>> UserProxy userProxy = bookingRequest.create(UserProxy.class); 
>>>
>>> userProxy.setId(12); 
>>>
>>> bookingProxy.setUser(userProxy); 
>>>
>>> Request persistRequest = 
>>> bookingRequest.persist().using(bookingProxy); 
>>> persistRequest.fire(new Receiver() { 
>>> @Override 
>>> public void onSuccess(Void response) { 
>>> GWT.log("persisted"); 
>>> } 
>>> }); 
>>>
>>

-- 
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: RequestFactory, entity Id not populated when it reaches the server?

2013-06-17 Thread GWTter
Hi Ümit,

I was actually checking the payload via the DefaultRequestTransport, I 
could see the user proxy object but I could not see the id anywhere in the 
payload. I had also put a println in the setID method in the DTO but it was 
never called which is what I thought was strange since the object seemed to 
go across the wire. I haven't checked the payload more formally with 
Chrome's developer tools, so I'll try that next like you suggested after 
dinner and see if that clears things up, will post back. Thanks for 
answering.

On Monday, June 17, 2013 5:21:48 PM UTC+2, Ümit Seren wrote:
>
> For debugging: Check the RF payload with Chrome Developer Tools and put a 
> breakpoint in the siteId() method of your backend DTO (it should be called 
> after the object is created). 
>
>
> On Monday, June 17, 2013 3:59:02 AM UTC+2, GWTter wrote:
>>
>> Hi all,
>>
>> I have the same setup as in question 
>> https://groups.google.com/d/msg/google-web-toolkit/GUQjZ98mL7s/MoA2gEMmS28J 
>> . 
>> I've included the relevant code from the question below for quick 
>> reference. My problem is that once the booking entity gets to the server 
>> and I look for the user, the user field is not null, but the id on the user 
>> is? Thus I can't check for the actual user. Is the user id not being set in 
>> the payload for some reason, or is it not building the user entity 
>> correctly on the server? Thanks a lot in advance for any help, much 
>> appreciated.
>>
>> -Seth
>>
>> MainRequestFactory.BookingRequest bookingRequest = 
>> reqFactory.bookingRequest(); 
>> BookingProxy bookingProxy = 
>> bookingRequest.create(BookingProxy.class); 
>> UserProxy userProxy = bookingRequest.create(UserProxy.class); 
>>
>> userProxy.setId(12); 
>>
>> bookingProxy.setUser(userProxy); 
>>
>> Request persistRequest = 
>> bookingRequest.persist().using(bookingProxy); 
>> persistRequest.fire(new Receiver() { 
>> @Override 
>> public void onSuccess(Void response) { 
>> GWT.log("persisted"); 
>> } 
>> }); 
>>
>

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




RequestFactory, entity Id not populated when it reaches the server?

2013-06-16 Thread GWTter
Hi all,

I have the same setup as in question 
https://groups.google.com/d/msg/google-web-toolkit/GUQjZ98mL7s/MoA2gEMmS28J . 
I've included the relevant code from the question below for quick 
reference. My problem is that once the booking entity gets to the server 
and I look for the user, the user field is not null, but the id on the user 
is? Thus I can't check for the actual user. Is the user id not being set in 
the payload for some reason, or is it not building the user entity 
correctly on the server? Thanks a lot in advance for any help, much 
appreciated.

-Seth

MainRequestFactory.BookingRequest bookingRequest = 
reqFactory.bookingRequest(); 
BookingProxy bookingProxy = 
bookingRequest.create(BookingProxy.class); 
UserProxy userProxy = bookingRequest.create(UserProxy.class); 

userProxy.setId(12); 

bookingProxy.setUser(userProxy); 

Request persistRequest = 
bookingRequest.persist().using(bookingProxy); 
persistRequest.fire(new Receiver() { 
@Override 
public void onSuccess(Void response) { 
GWT.log("persisted"); 
} 
}); 

-- 
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: Uibinder inheriting and extending css classes (not just sharing them), best method?

2013-06-15 Thread GWTter
Hi Ryan,

I don't think you're way off, this is definitely a way to do it but there 
are a few caveats. 

You have to consider that in order to do it this way (assuming you're style 
is coming from another cssresource) you would have to:
- declare the cssresource that had the original style via ui:with and then 
make sure it is injected since uibinder only takes care of injecting the 
ui:style. 
- (maintainability): you would have to make sure to set all the styles that 
were set on the object originally (or any future ones if other classes are 
added) including your new extension since setStyleName would clear them all 
out (this would make your local style less maintainable and have to know 
more about the external one than just what it wanted to extend). With the 
extension approach even if the original style is deleted the local 
extension would still apply with no errors.

These were the things I was trying to avoid with this approach. Either way 
thanks for your reply, it should help clarify options.

-Seth

On Saturday, June 15, 2013 3:35:25 PM UTC+2, RyanZA wrote:
>
> I might be way off here, but is there any reason to extend myTestClass at 
> all? You can have multiple css classes per element, so simply doing:
>
> 
>   .myLOCALTestClass{ ...more properties specific for this binder...}
> 
>
> And then assigning both myTestClass and myLOCALTestClass to the element 
> should have the local specific changes overwriting the global ones.
>
> On Saturday, June 15, 2013 2:59:35 AM UTC+2, GWTter wrote:
>>
>> Hi Joseph,
>>
>> Thanks for the reply. You're right and I actually do this elsewhere 
>> extending cssresource interfaces and using the @shared which also works; 
>> it's definitely the way to go for larger extensions/additions that aren't 
>> as local.
>> However what I like about the ui:binder approach is you don't have to 
>> worry about ensuring the styles are injected and less boilerplate to 
>> utilize the cssresource (even though it's not THAT much of a hassle). The 
>> other really nice thing is you can override/extend styles more easily with 
>> the approach I described for local changes (at least in my opinion). That's 
>> why I just wanted to see if there was a way to extend it without having to 
>> specify the src like in the approach above, or if it's even recommended.
>>
>> Thanks again,
>>
>> -Seth
>>
>> On Friday, June 14, 2013 6:01:12 PM UTC+2, Joseph Lust wrote:
>>>
>>> Seth,
>>>
>>> Currently I can do this by setting >>> src='/MyCss.css"> in A and B and it works nicely, uibinder 
>>>> takes care of injecting the styles and everything. However I'm not sure if 
>>>> this is the best way. There's also the issue that if I move A and B then 
>>>> the relative path breaks (since absolute paths still aren't 100% 
>>>> functional 
>>>> issue#7230<http://code.google.com/p/google-web-toolkit/issues/detail?id=7230>).
>>>>  
>>>> Does anyone have a clue or is this the preferred method?
>>>>
>>>
>>> You might want to look at this previous 
>>> answer<https://groups.google.com/forum/?fromgroups#!searchin/google-web-toolkit/lust$20cssresource/google-web-toolkit/XDTiBioiIuo/ZFHeGB1jT0IJ>.
>>>  
>>> If you do the overriding in the Java class backing your UI binder, then the 
>>> refactoring worries won't be a problem. You can still handle the 
>>> refactoring in UiBinder, but you'll have to set Eclipse (or IDE of choice) 
>>> to do FQN replacements in all .xml files.
>>>
>>>
>>> Sincerely,
>>> Joseph
>>>
>>

-- 
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: Uibinder inheriting and extending css classes (not just sharing them), best method?

2013-06-14 Thread GWTter
Hi Joseph,

Thanks for the reply. You're right and I actually do this elsewhere 
extending cssresource interfaces and using the @shared which also works; 
it's definitely the way to go for larger extensions/additions that aren't 
as local.
However what I like about the ui:binder approach is you don't have to worry 
about ensuring the styles are injected and less boilerplate to utilize the 
cssresource (even though it's not THAT much of a hassle). The other really 
nice thing is you can override/extend styles more easily with the approach 
I described for local changes (at least in my opinion). That's why I just 
wanted to see if there was a way to extend it without having to specify the 
src like in the approach above, or if it's even recommended.

Thanks again,

-Seth

On Friday, June 14, 2013 6:01:12 PM UTC+2, Joseph Lust wrote:
>
> Seth,
>
> Currently I can do this by setting > src='/MyCss.css"> in A and B and it works nicely, uibinder 
>> takes care of injecting the styles and everything. However I'm not sure if 
>> this is the best way. There's also the issue that if I move A and B then 
>> the relative path breaks (since absolute paths still aren't 100% functional 
>> issue#7230).
>>  
>> Does anyone have a clue or is this the preferred method?
>>
>
> You might want to look at this previous 
> answer.
>  
> If you do the overriding in the Java class backing your UI binder, then the 
> refactoring worries won't be a problem. You can still handle the 
> refactoring in UiBinder, but you'll have to set Eclipse (or IDE of choice) 
> to do FQN replacements in all .xml files.
>
>
> Sincerely,
> Joseph
>

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




Uibinder inheriting and extending css classes (not just sharing them), best method?

2013-06-13 Thread GWTter
Hi all,

I have a Css resource that I would like to have inherited in other 
uibinders and be able to have these binders extend the css classes if need 
be. 

For example:
Let's say I have .myTestClass{ ...properties...} in MyCss.css which is 
setup as a CssResource syntactically.

Then I have UiBinder A and B. I want to inherit the class in both of them 
and extend the properties so that in binder A and B I would have

  .myTestClass{ ...more properties specific for this binder...}


finally when I would access style.myTestClass respectively in A and B all 
the properties would be available (including the inherited ones).

Currently I can do this by setting http://code.google.com/p/google-web-toolkit/issues/detail?id=7230>). 
Does anyone have a clue or is this the preferred method?

Thanks in advance,

-Seth

-- 
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: Compiling Error (not Present in Eclipse) with Generics (requestfactory related interface)

2013-05-29 Thread GWTter
Thanks yet again Thomas. 

Although I don't extend RequestContext there directly it does interact with 
it so that I have some interfaces extending both RequestContext and this 
interface which maybe causing the issue. So I think you're right. I added 
my post to the issue, hopefully it helps. I guess I can just take the long 
way for now.


On Wednesday, May 29, 2013 4:58:53 PM UTC+2, Thomas Broyer wrote:
>
>
>
> On Tuesday, May 28, 2013 7:54:29 PM UTC+2, GWTter wrote:
>>
>> Hi all,
>>
>> I can't figure this out, haven't found anything on the interwebs, and 
>> it's really, really getting to me. I have the following interface:
>>
>> public interface PersistedClassRC> Serializable> {
>> Request save(P entityProxy,int version);
>> Request delete(P entityProxy);
>> Request findById(N id);
>> }
>>
>> Now in Eclipse there are no errors, no warnings and I can run in Devmode 
>> just fine. However when I compile it I get the following error:
>>
>> .../PersistedClassRC.java:39: error: The type N cannot be used here
>> [javac] Request findById(N id);
>> [javac]
>>
>> I'm using Java 1.6.0_30 but have also tried it on 1.7.0_05 and 1.7.0_21 
>> and all yield the same error. Is there something I'm not seeing, is this 
>> illegal? Please any help would be greatly appreciated, thanks in advance.
>>
>
> Looks like issue 
> 6794<https://code.google.com/p/google-web-toolkit/issues/detail?id=6794>
>  
>

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




Compiling Error (not Present in Eclipse) with Generics (requestfactory related interface)

2013-05-28 Thread GWTter
Hi all,

I can't figure this out, haven't found anything on the interwebs, and it's 
really, really getting to me. I have the following interface:

public interface PersistedClassRC {
Request save(P entityProxy,int version);
Request delete(P entityProxy);
Request findById(N id);
}

Now in Eclipse there are no errors, no warnings and I can run in Devmode 
just fine. However when I compile it I get the following error:

.../PersistedClassRC.java:39: error: The type N cannot be used here
[javac] Request findById(N id);
[javac]

I'm using Java 1.6.0_30 but have also tried it on 1.7.0_05 and 1.7.0_21 and 
all yield the same error. Is there something I'm not seeing, is this 
illegal? Please any help would be greatly appreciated, thanks in advance.

-Seth

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




Re: RequestFactory polymorphic arguments issue, is it possible?

2013-04-15 Thread GWTter
Hi Thomas,

In my case the BarProxyExt is pretty much a wrapper on the entity proxy. I 
wasn't sure how RF checked to see if the object given was the entity proxy 
it created, but thought that if it was a check based on the ID for example 
then any class implementing it (wrapping) should work. But you confirmed 
that RF is checking to see that it's the same entity proxy it created so 
polymorphism wouldn't work in this case. I just wanted to know how much RF 
needed to know about the implementation. Thanks for the answer.

-Seth

On Saturday, April 13, 2013 11:08:12 AM UTC+2, Thomas Broyer wrote:
>
> Not sure what you're trying to do but it's not a supported usecase.
> RequestFactory only supports proxies created by its RequestContexts.
>
> On Friday, April 12, 2013 5:32:15 PM UTC+2, GWTter wrote:
>>
>> Hi all,
>>
>> I'm having an issue using an implementation of an extended EntityProxy. I 
>> have the setup below, now when I call setBarProxyExt(BarProxyExt 
>> barProxyExt) I get no errors and I am sure that the setBar method is 
>> receiving the correct bar however the field is not set. 
>>
>> This however is not the case if I inside setBarProxyExt(...) I call 
>> setBar(barProxyExt.getBarProxy()) instead of just on the barProxyExt.
>>
>> Now I'm thinking it may be because the setter is looking for a particular 
>> instance managed by the autobeans. But if that's not the case shouldn't 
>> this work?
>>
>> Many thanks in advance,
>>
>> -seth
>>
>> public interface BarProxy extends EntityProxy{...}
>> public class BarProxyExt implements BarProxy{
>> private BarProxy mutableBarProxy;
>> public BarProxy getBarProxy(){
>> return mutableBarProxy;
>> }
>> }
>>
>> public interface FooProxy extends EntityProxy{
>> public BarProxy getBar();
>> public void setBar(BarProxy bar);
>> }
>>
>> public class FooProxyExt implements FooProxy{
>> private FooProxy mutableFooProxy; //this has already been set and is 
>> editable
>> 
>> @Override
>> public BarProxy getBar(){
>> return mutableFooProxy.getBar();
>> }
>> @Override
>> public void setBar(BarProxy bar){
>> mutableFooProxy.setBar(bar);
>> }
>> 
>> 
>> //issue is using this method
>> public void setBarProxyExt(BarProxyExt barProxyExt){
>> setBar(barProxyExt);
>> }
>> 
>> ...
>> }
>>
>

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




RequestFactory polymorphic arguments issue, is it possible?

2013-04-12 Thread GWTter
Hi all,

I'm having an issue using an implementation of an extended EntityProxy. I 
have the setup below, now when I call setBarProxyExt(BarProxyExt 
barProxyExt) I get no errors and I am sure that the setBar method is 
receiving the correct bar however the field is not set. 

This however is not the case if I inside setBarProxyExt(...) I call 
setBar(barProxyExt.getBarProxy()) instead of just on the barProxyExt.

Now I'm thinking it may be because the setter is looking for a particular 
instance managed by the autobeans. But if that's not the case shouldn't 
this work?

Many thanks in advance,

-seth

public interface BarProxy extends EntityProxy{...}
public class BarProxyExt implements BarProxy{
private BarProxy mutableBarProxy;
public BarProxy getBarProxy(){
return mutableBarProxy;
}
}

public interface FooProxy extends EntityProxy{
public BarProxy getBar();
public void setBar(BarProxy bar);
}

public class FooProxyExt implements FooProxy{
private FooProxy mutableFooProxy; //this has already been set and is 
editable

@Override
public BarProxy getBar(){
return mutableFooProxy.getBar();
}
@Override
public void setBar(BarProxy bar){
mutableFooProxy.setBar(bar);
}


//issue is using this method
public void setBarProxyExt(BarProxyExt barProxyExt){
setBar(barProxyExt);
}

...
}

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




Re: Async call returning and executing before calling method finishes in Dev mode?

2013-03-14 Thread GWTter
Hi Thomas,

Yes, I was running it in Firefox, sorry for not mentioning it before. But I 
guess I stumbled onto the same bug here too. This puts me at ease now 
though since I know that there shouldn't be any concurrent execution: the 
calling method should finish before executing the async callback even if 
the async returns before the method finishes.

Thanks again Thomas, I think I can safely say on behalf of everyone that 
you're much appreciated around here.

-seth

On Thursday, March 14, 2013 10:04:49 AM UTC+1, Thomas Broyer wrote:
>
> Because the requests are made by the browser, this shouldn't be different 
> in prod vs. dev mode.
> Was it in Firefox? 'cause it has a bug where it could execute scripts 
> concurrently in some cases: 
> https://code.google.com/p/google-web-toolkit/issues/detail?id=7926
>
> On Thursday, March 14, 2013 3:13:33 AM UTC+1, GWTter wrote:
>>
>> Hi all,
>>
>> I have a situation where, although extremely rare and really should only 
>> arise while debugging, one of my Async calls returns and executes its 
>> callback before the calling function/main loop is done with its execution. 
>> This has only been done in Dev mode and not prod.
>>
>> Now I know (or at least I'm pretty pretty sure) that in JS the async 
>> callback is pushed onto the event stack to evaluate next when it returns, 
>> thus it is called only after the calling JS execution returns and would not 
>> interrupt currently running JS to execute. Even the gwt doc states 
>> "Although the code inside the onSuccess() method is defined inline with 
>> the call, it will not be executed until both the calling code returns back 
>> to the JavaScript main loop, and the result message from the server 
>> returns." at the end of 
>> https://developers.google.com/web-toolkit/doc/latest/DevGuideServerCommunication#DevGuideGettingUsedToAsyncCalls.
>>
>> So my question is "am I seeing this behavior only because it is in Dev 
>> mode and is actually just because Java is running with threads or is this 
>> actually possible in Prod too? "
>>
>> Thanks a lot in advance,
>>
>> -Seth
>>
>

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




Async call returning and executing before calling method finishes in Dev mode?

2013-03-13 Thread GWTter
Hi all,

I have a situation where, although extremely rare and really should only 
arise while debugging, one of my Async calls returns and executes its 
callback before the calling function/main loop is done with its execution. 
This has only been done in Dev mode and not prod.

Now I know (or at least I'm pretty pretty sure) that in JS the async 
callback is pushed onto the event stack to evaluate next when it returns, 
thus it is called only after the calling JS execution returns and would not 
interrupt currently running JS to execute. Even the gwt doc states 
"Although the code inside the onSuccess() method is defined inline with the 
call, it will not be executed until both the calling code returns back to 
the JavaScript main loop, and the result message from the server returns." 
at the end 
of 
https://developers.google.com/web-toolkit/doc/latest/DevGuideServerCommunication#DevGuideGettingUsedToAsyncCalls
 
.

So my question is "am I seeing this behavior only because it is in Dev mode 
and is actually just because Java is running with threads or is this 
actually possible in Prod too? "

Thanks a lot in advance,

-Seth

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




Re: Inline top and left properties cleared when removing child from parent?

2013-03-12 Thread GWTter
Yup,

You guys are totally right. Changing the parent to a FlowPanel keeps the 
positioning when removing the child. I guess I was thinking from the doc 
that it would only be cleared if the positioning was modified while the 
child was a child of the absolutepanel (even though I know there's no code 
to support this functionality, just going from the doc), but it also clears 
it out if the child already has positioning before adding it to the 
absolutepanel. 

Also I had seen the changeToStaticPositioning method staring at me in the 
face before, I'm an idiot and/or another case of coding-too-long-blindness. 

Either way a Flowpanel works just fine.

Thanks again Thomas and Jens,

-Seth

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




Inline top and left properties cleared when removing child from parent?

2013-03-12 Thread GWTter
Hi everyone,

I noticed that when removing an absolutely positioned child which has top 
and left style properties set inline from its parent that these top and 
left are cleared from the inline style of the child. Thus if you remove the 
child from the parent and then add it back the child won't be positioned 
where you had set it too before removing it.

Now I also saw that the inline style is cleared if the javascript returns 
to the browser event loop and notices that the element is no longer in the 
document. If you remove and add the child back before you return to the 
browser event loop then nothing is cleared.

I guess my question is "is that the expected behavior or is it a bug?". I 
thought it was strange and searched google and couldn't find anything 
referring to that behavior but maybe someone can enlighten me.

Also, I found the same behavior in FF, Chrome, and IE (10) in dev mode and 
prod mode.

I attached test code below: you can see that the child starts centered but 
when it is removed and then added back it is no longer centered and has no 
top and left inline properties.

Thanks a lot in advance,

-Seth

CODE:
AbsolutePanel parent = new AbsolutePanel();
SimplePanel child = new SimplePanel();

/**
 * This is the entry point method.
 */
public void onModuleLoad() {

parent.getElement().setInnerText("Parent");
parent.getElement().setAttribute("style", 
"position:relative;top:25%;left:25%;height:200px;width:200px;background:grey;color:black;");
child.getElement().setInnerText("Child");
child.getElement().setAttribute("style", 
"position:absolute;top:25%;left:25%;height:50%;width:50%;background:green;color:black;");

parent.add(child);

Button removeChildButton = new Button("Remove child from parent");
removeChildButton.getElement().setAttribute("style", 
"position:relative;");
removeChildButton.addClickHandler(new ClickHandler(){
@Override
public void onClick(ClickEvent event) {
parent.remove(child);
}
});

Button addChildButton = new Button("Add child back to parent");
addChildButton.getElement().setAttribute("style", 
"position:relative;");
addChildButton.addClickHandler(new ClickHandler(){
@Override
public void onClick(ClickEvent event) {
parent.add(child);
}
});

RootPanel.get().add(removeChildButton);
RootPanel.get().add(addChildButton);
RootPanel.get().add(parent);
}

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




Re: Best serverside architecture(framework/stack) to use with GWT for large application...please show me the light

2012-08-28 Thread GWTter
Hi Derek,

After do some more research and receiving some more advice from others and 
another helpful answer on SO I'll be going with Spring (I agree about the 
XML, but they have introduced/incorporated more annotations since the 
earlier versions). However what you detailed still makes a lot of sense, 
and also very helpful, so I won't be ignoring it :). Although Guice and 
Spring might be over doing it, I think GIN on the client side is still 
worthwhile and you've pretty much sold me. Also the Activitys and Places. 
Thanks again for all the insight, much appreciated.

-Seth

On Tuesday, August 28, 2012 4:12:43 PM UTC+2, Derek wrote:
>
> Hi Seth,
>
> I personally am not a fan of Spring. I'm generally not a fan of anything 
> that says, "First, create a bunch of XML files" (GWT excepted :) ). That's 
> why I gravitated to Guice for all my DI needs. That said, Guice and Spring 
> aren't quite the same thing, and you could leverage both of them.
>
> However, it is probably unnecessary to do both Guice and Spring in a GWT 
> app. You can do anything with one DI framework that you can do with the 
> other, and if you are leaning to Spring, you make a fine choice and you can 
> ignore the rest of my post.
>
> At my workplace, the way we do GWT projects is we create a WebXml.java in 
> the server package that implements GuiceServletContextListener and point 
> the web.xml to that class. The WebXml contains servlet mapping modules, db 
> connection modules, and other Guice modules as needed.
>
> On the client side, we generally use MVP structure with GIN. The MVP 
> structure is a lifesaver for large projects in my mind. Our more recent 
> projects have used the Activity and Places framework described on GWT's 
> website with the main exception that the ClientFactory object is 
> unnecessary since GIN provides the various resources instead of 
> ClientFactory.
>
> At my work we've got two projects that clock in around 34k and 46k lines 
> of Java (not including XML or other artifacts) as well as smaller projects 
> and they use the methodology I described.
>
> Derek
>
> On Monday, August 27, 2012 5:18:13 PM UTC-4, GWTter wrote:
>>
>> Hi Derek,
>>
>> Thanks a lot for the reply. I did consider Guice for DI on the serverside 
>> but not sure if it would be redundant if using a framework like Spring. I 
>> do want to utilize RF though as it has a nice set of features which I'd 
>> like to include, e.g. caching and only delta posts. And I'll definitely 
>> take a look at GIN again since DI on my clientside might be pretty nice 
>> too. Thanks again,
>>
>> -Seth
>>
>> On Monday, August 27, 2012 4:05:05 PM UTC+2, Derek wrote:
>>>
>>> I use Guice on the server side and GIN on the client side. I generally 
>>> use DTOs over GWT-RPC since RequestFactory isn't what I need / want to 
>>> migrate to.
>>>
>>> On Saturday, August 25, 2012 7:48:12 PM UTC-4, GWTter wrote:
>>>>
>>>> Hi all,
>>>>
>>>> I've been doing research on this for the past 2, almost 3 days now. I 
>>>> feel like I've googled everything under the sun on the matter (including 
>>>> these forums) and am almost all tutorialed-out. Before I go into any more 
>>>> details on the question I just want to give a quick overview of the scope 
>>>> and plan for the project to see what will suit it best:
>>>>
>>>> -Large application, non-trivial
>>>> -50+ DB tables
>>>> -Large user base
>>>> -User management/authentication/sessions
>>>> -transactions
>>>> -security
>>>> -MVP (as per GWT recommendation)
>>>> -focus on performance and scalability (naturally :), am using GWT after 
>>>> all)
>>>>
>>>> I've also read and watched all of the best practices on architecture 
>>>> for large applications (Google/GWT).
>>>>
>>>> Now in the last talk I could find on best architecture practices 
>>>> involving GWT was back in 2010 by Ray Ryan in which he states that they 
>>>> don't think JavaBeans and property change events work terribly well so 
>>>> it's 
>>>> better to use DTOs for the Model.
>>>>
>>>> My big questions are if this is still the belief and the recommended 
>>>> route, and if so, what should I be looking at in order to achieve this? a 
>>>> Framework?
>>>>
>>>> My preference would be to keep coding in Java on the serverside since 
>>>> I'm alre

Re: Best serverside architecture(framework/stack) to use with GWT for large application...please show me the light

2012-08-27 Thread GWTter
Hi all,

I also posted this question on SO and revised it a little since, but 
received one really great response so far if anyone is interested:

http://stackoverflow.com/questions/12132213/recommended-serverside-architectureframework-stack-to-use-with-gwt-for-large-a



-- 
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/-/8O06mXQjVUwJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Best serverside architecture(framework/stack) to use with GWT for large application...please show me the light

2012-08-27 Thread GWTter
Hi Derek,

Thanks a lot for the reply. I did consider Guice for DI on the serverside 
but not sure if it would be redundant if using a framework like Spring. I 
do want to utilize RF though as it has a nice set of features which I'd 
like to include, e.g. caching and only delta posts. And I'll definitely 
take a look at GIN again since DI on my clientside might be pretty nice 
too. Thanks again,

-Seth

On Monday, August 27, 2012 4:05:05 PM UTC+2, Derek wrote:
>
> I use Guice on the server side and GIN on the client side. I generally use 
> DTOs over GWT-RPC since RequestFactory isn't what I need / want to migrate 
> to.
>
> On Saturday, August 25, 2012 7:48:12 PM UTC-4, GWTter wrote:
>>
>> Hi all,
>>
>> I've been doing research on this for the past 2, almost 3 days now. I 
>> feel like I've googled everything under the sun on the matter (including 
>> these forums) and am almost all tutorialed-out. Before I go into any more 
>> details on the question I just want to give a quick overview of the scope 
>> and plan for the project to see what will suit it best:
>>
>> -Large application, non-trivial
>> -50+ DB tables
>> -Large user base
>> -User management/authentication/sessions
>> -transactions
>> -security
>> -MVP (as per GWT recommendation)
>> -focus on performance and scalability (naturally :), am using GWT after 
>> all)
>>
>> I've also read and watched all of the best practices on architecture for 
>> large applications (Google/GWT).
>>
>> Now in the last talk I could find on best architecture practices 
>> involving GWT was back in 2010 by Ray Ryan in which he states that they 
>> don't think JavaBeans and property change events work terribly well so it's 
>> better to use DTOs for the Model.
>>
>> My big questions are if this is still the belief and the recommended 
>> route, and if so, what should I be looking at in order to achieve this? a 
>> Framework?
>>
>> My preference would be to keep coding in Java on the serverside since I'm 
>> already doing so with GWT on the client. I've been investigating serverside 
>> frameworks and seem to have arrive at 2: Seam or Spring? However I can 
>> figure out which of these are best suited for the task. All of the doc I've 
>> found out there discussing the issue is at the most recent about a year old 
>> but most of it is from <=2010 so it makes it even harder to tell 
>> considering that both of these frameworks have evolved considerably since 
>> then. There's also been the coming of JEE 6.
>>
>> Can anyone give any insight on who's best suited for the task, or what I 
>> should do to fulfill my requirements but stay inline with what is 
>> recommended by GWT? I know I only mentioned Seam and Spring since that's 
>> what I've been led to mostly, but I'm open to any suggestions that fit what 
>> I'm looking for. I've already ruled a couple of solutions such as Spring 
>> Roo for this kind of task.
>>
>> This is my first project of this scale and the last thing I want to do is 
>> head down a path and figure out that I've wasted a lot of my and my team's 
>> time and energy because of some wrong decisions I made at the get-go.
>>
>> Thanks a lot in advance for your help, I really just want to figure this 
>> out so I can get back to coding instead of googling the ends of the earth 
>> ;).
>>
>> -Seth
>>
>

-- 
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/-/zhSt9Mez-HcJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Best serverside architecture(framework/stack) to use with GWT for large application...please show me the light

2012-08-25 Thread GWTter
Hi all,

I've been doing research on this for the past 2, almost 3 days now. I feel 
like I've googled everything under the sun on the matter (including these 
forums) and am almost all tutorialed-out. Before I go into any more details 
on the question I just want to give a quick overview of the scope and plan 
for the project to see what will suit it best:

-Large application, non-trivial
-50+ DB tables
-Large user base
-User management/authentication/sessions
-transactions
-security
-MVP (as per GWT recommendation)
-focus on performance and scalability (naturally :), am using GWT after all)

I've also read and watched all of the best practices on architecture for 
large applications (Google/GWT).

Now in the last talk I could find on best architecture practices involving 
GWT was back in 2010 by Ray Ryan in which he states that they don't think 
JavaBeans and property change events work terribly well so it's better to 
use DTOs for the Model.

My big questions are if this is still the belief and the recommended route, 
and if so, what should I be looking at in order to achieve this? a 
Framework?

My preference would be to keep coding in Java on the serverside since I'm 
already doing so with GWT on the client. I've been investigating serverside 
frameworks and seem to have arrive at 2: Seam or Spring? However I can 
figure out which of these are best suited for the task. All of the doc I've 
found out there discussing the issue is at the most recent about a year old 
but most of it is from <=2010 so it makes it even harder to tell 
considering that both of these frameworks have evolved considerably since 
then. There's also been the coming of JEE 6.

Can anyone give any insight on who's best suited for the task, or what I 
should do to fulfill my requirements but stay inline with what is 
recommended by GWT? I know I only mentioned Seam and Spring since that's 
what I've been led to mostly, but I'm open to any suggestions that fit what 
I'm looking for. I've already ruled a couple of solutions such as Spring 
Roo for this kind of task.

This is my first project of this scale and the last thing I want to do is 
head down a path and figure out that I've wasted a lot of my and my team's 
time and energy because of some wrong decisions I made at the get-go.

Thanks a lot in advance for your help, I really just want to figure this 
out so I can get back to coding instead of googling the ends of the earth 
;).

-Seth

-- 
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/-/ug9W05bFTUQJ.
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: Spring Roo, relationship status with GWT? recommended for more apps more complex than basic CRUD?

2012-08-25 Thread GWTter
Hi Thomas,

Thanks for the suggestion, I'll definitely see if if the Spring community 
can shed a little more light.

-seth

On Saturday, August 25, 2012 10:29:53 AM UTC+2, Thomas Broyer wrote:
>
>
>
> On Saturday, August 25, 2012 4:23:44 AM UTC+2, GWTter wrote:
>>
>> Hi all,
>>
>> I came across Spring Roo recently and have put in a considerable amount 
>> of research as far as whether to use it for my app or not. However, I'm 
>> running into a couple of issues in my consideration.
>>
>> 1) GWT support:
>>   Spring Roo integration with GWT (more specifically the gwt addon for 
>> Roo to make MVP life easier) was presented back in 2010 in the IO keynote (
>> http://www.youtube.com/watch?v=GQHlhIIxCIc) and in a talk by Ray Ryan (
>> http://www.youtube.com/watch?v=M5x6E6ze1x8) and it seemed promising. 
>> However, in all my googling it seems like the gwt-roo presence/community 
>> has been sorely lacking, is it just me? Is GWT still on the Roo bandwagon?
>
>
> AFAICT the GWT add-on for Roo was a joint effort, but Google has not been 
> involved after the first release (milestone?).
>
> For all your other questions, you'd rather ask the Spring Roo community 
> then.
>

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



Spring Roo, relationship status with GWT? recommended for more apps more complex than basic CRUD?

2012-08-24 Thread GWTter
Hi all,

I came across Spring Roo recently and have put in a considerable amount of 
research as far as whether to use it for my app or not. However, I'm 
running into a couple of issues in my consideration.

1) GWT support:
  Spring Roo integration with GWT (more specifically the gwt addon for Roo 
to make MVP life easier) was presented back in 2010 in the IO keynote 
(http://www.youtube.com/watch?v=GQHlhIIxCIc) and in a talk by Ray Ryan 
(http://www.youtube.com/watch?v=M5x6E6ze1x8) and it seemed promising. 
However, in all my googling it seems like the gwt-roo presence/community 
has been sorely lacking, is it just me? Is GWT still on the Roo bandwagon? 
The last doc on it by gwt 
(https://developers.google.com/web-toolkit/doc/latest/tutorial/roo-sts) 
still references 2.1, and if you following it currently, all the STS side 
stuff doesn't run properly (at least it didn't for me).

2) My app is going to be more complex than simple CRUD. Ideally, if I were 
to use Roo, I would only want it to do it's "magic" for the Model/domain 
layer, but leave the Presenter and View layers to me and not interfere with 
them. In all my searching I couldn't find any docs referencing this 
specifically (aside from some obscure blog posts which are even direct). Is 
it that it's not possible or too hairy? Or am I trying to have my cake and 
eat it too?

3) Finally, does the GWT community even recommend using Roo instead of just 
going with RequestFactory and just writing the services yourself (for 
Model/domain interaction)? Do the benefits of using Roo outweigh the 
drawbacks when aiming for a more-than-CRUD app?

I love the idea of being able to declare a field in my entity and having 
compile time shell create the corresponding boilerplate stuff for the model 
and services communication, but not if it's going to be a huge headache 
trying to set it up so that it will do that properly.

Thanks in advance for any suggestions, comments, help, I know this was a 
little longI really appreciate it.

-Seth

-- 
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/-/P1aVHQb73K8J.
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: Animation frame rate, possible to increase?

2012-04-17 Thread GWTter
Sounds good, I'll give that a shot. Thanks again Aidan.

-Seth

On Tuesday, April 17, 2012 2:16:52 PM UTC-4, Aidan OK wrote:
>
> Dynamic positions work fine with transitions, how it works is you just say 
> (by setting the transition property) 'I want to animate any changes to 
> top,left,width,height' . You don't even need to specify the positions at 
> that time, but from that point on, any-time you set the 
> left/top/right/width, it will animate the changes automatically.
>
> They have some nice properties like automatically reversing a transition 
> if you set some new values while the element is still animating too.. I 
> guess it really comes down if you're prepared to have it not work in ie6-9, 
> and deal with the inevitable quirks that come up due to css3 still being a 
> work in progress :( 
>
> On Tue, Apr 17, 2012 at 6:49 PM, GWTter  wrote:
>
>> Hi Aidan,
>>
>> Thanks for the suggestion. I actually considered this initially, however 
>> the move positions are dynamic/I wouldn't know the positions ahead of time. 
>> Do you think it would be possible to do this by setting the element's 
>> transition attribute or would it have to be the animation attribute? Thanks 
>> again.
>>
>> -Seth
>>
>>
>> On Tuesday, April 17, 2012 1:07:40 PM UTC-4, Aidan OK wrote:
>>>
>>> Depending on your needs, you could consider using css3 transitions (or 
>>> even css3 animations, though they are much less supported) to get smoother 
>>> animations. (they are generally hardware accelerated) 
>>> http://css3.**bradshawenterprises.com/<http://css3.bradshawenterprises.com/>
>>> Its not a very 'GWT way'  of course, as it doesn't support old browsers, 
>>> but it does degrade gracefully, the elements will just move with no 
>>> animation on these browsers. 
>>>
>>> On Tue, Apr 17, 2012 at 5:44 PM, GWTter  wrote:
>>>
>>>> Hi Thomas,
>>>>
>>>> I'm testing on FF. I thought it was probably just that I'm doing the 
>>>> impossible like you said too because the code I have for the animation is 
>>>> as concise as can be, the onUpdate() is just 2 lines of code which are 
>>>> just 
>>>> updating the top and left of the element. Maybe if I make the duration a 
>>>> function of the distance so that the achieved frame rate would stay below 
>>>> 60Hz it would work out nicely. But thanks again for the back info you 
>>>> supplied, very helpful, really appreciate it.
>>>>
>>>> -Seth
>>>>
>>>>
>>>>
>>>> On Tuesday, April 17, 2012 12:07:36 PM UTC-4, Thomas Broyer wrote:
>>>>>
>>>>>
>>>>>
>>>>> On Tuesday, April 17, 2012 6:05:19 PM UTC+2, Thomas Broyer wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Tuesday, April 17, 2012 5:43:03 PM UTC+2, GWTter wrote:
>>>>>>>
>>>>>>> Hi all,
>>>>>>>
>>>>>>> I've written a move animation using the gwt way (extending animation 
>>>>>>> class etc.) and it works great but I've noticed that when that if I 
>>>>>>> keep 
>>>>>>> the duration the same say 1000ms the longer the move distance is the 
>>>>>>> choppier the animation seems (the animation is smoother the shorter the 
>>>>>>> move distance is). I figured that this is because of the frame rate. In 
>>>>>>> the 
>>>>>>> doc the frame rate is stated to be "non-fixed". 
>>>>>>>
>>>>>>> Does anyone know if it is possible to increase the frame rate on the 
>>>>>>> animation
>>>>>>
>>>>>>
>>>>>> No, it's not possible.
>>>>>>  
>>>>>>
>>>>>>> and if not can anyone suggest or have an idea on how to make the 
>>>>>>> animation smoother?
>>>>>>>
>>>>>>
>>>>>> Which browser were you testing this in? In Firefox and Chrome it 
>>>>>> should use requestAnimationFrame whose role is to defer to the browser 
>>>>>> the 
>>>>>> choice of the frame rate so that it stays responsive 
>>>>>> See https://developer.mozilla.org/en/DOM/window.**requestAnima**
>>>>>> tionFrame<https:

Re: Animation frame rate, possible to increase?

2012-04-17 Thread GWTter
Hi Aidan,

Thanks for the suggestion. I actually considered this initially, however 
the move positions are dynamic/I wouldn't know the positions ahead of time. 
Do you think it would be possible to do this by setting the element's 
transition attribute or would it have to be the animation attribute? Thanks 
again.

-Seth

On Tuesday, April 17, 2012 1:07:40 PM UTC-4, Aidan OK wrote:
>
> Depending on your needs, you could consider using css3 transitions (or 
> even css3 animations, though they are much less supported) to get smoother 
> animations. (they are generally hardware accelerated) 
> http://css3.bradshawenterprises.com/
> Its not a very 'GWT way'  of course, as it doesn't support old browsers, 
> but it does degrade gracefully, the elements will just move with no 
> animation on these browsers. 
>
> On Tue, Apr 17, 2012 at 5:44 PM, GWTter  wrote:
>
>> Hi Thomas,
>>
>> I'm testing on FF. I thought it was probably just that I'm doing the 
>> impossible like you said too because the code I have for the animation is 
>> as concise as can be, the onUpdate() is just 2 lines of code which are just 
>> updating the top and left of the element. Maybe if I make the duration a 
>> function of the distance so that the achieved frame rate would stay below 
>> 60Hz it would work out nicely. But thanks again for the back info you 
>> supplied, very helpful, really appreciate it.
>>
>> -Seth
>>
>>
>>
>> On Tuesday, April 17, 2012 12:07:36 PM UTC-4, Thomas Broyer wrote:
>>>
>>>
>>>
>>> On Tuesday, April 17, 2012 6:05:19 PM UTC+2, Thomas Broyer wrote:
>>>>
>>>>
>>>>
>>>> On Tuesday, April 17, 2012 5:43:03 PM UTC+2, GWTter wrote:
>>>>>
>>>>> Hi all,
>>>>>
>>>>> I've written a move animation using the gwt way (extending animation 
>>>>> class etc.) and it works great but I've noticed that when that if I keep 
>>>>> the duration the same say 1000ms the longer the move distance is the 
>>>>> choppier the animation seems (the animation is smoother the shorter the 
>>>>> move distance is). I figured that this is because of the frame rate. In 
>>>>> the 
>>>>> doc the frame rate is stated to be "non-fixed". 
>>>>>
>>>>> Does anyone know if it is possible to increase the frame rate on the 
>>>>> animation
>>>>
>>>>
>>>> No, it's not possible.
>>>>  
>>>>
>>>>> and if not can anyone suggest or have an idea on how to make the 
>>>>> animation smoother?
>>>>>
>>>>
>>>> Which browser were you testing this in? In Firefox and Chrome it should 
>>>> use requestAnimationFrame whose role is to defer to the browser the choice 
>>>> of the frame rate so that it stays responsive 
>>>> See https://developer.mozilla.**org/en/DOM/window.**
>>>> requestAnimationFrame<https://developer.mozilla.org/en/DOM/window.requestAnimationFrame>
>>>>  and http**://code.google.com/p/google-**web-toolkit/source/browse/**
>>>> trunk/user/src/com/google/gwt/**animation/Animation.gwt.xml<http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/animation/Animation.gwt.xml>
>>>> (and http://code.google.com/p/**google-web-toolkit/source/**
>>>> browse/trunk/user/src/com/**google/gwt/animation/client/**
>>>> AnimationSchedulerImplTimer.**java<http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/animation/client/AnimationSchedulerImplTimer.java>
>>>>  which 
>>>> uses a timer that tries to achieve 60Hz frame rate)
>>>>
>>>> If your animation is not smooth, it's probably that it doesn't run at 
>>>> approx. 60Hz, which means that either your code in the animation or some 
>>>> other code runs too slowly to achieve that rate. Because timers and 
>>>> requestAnimationFrame (and basically everything in a browser) go through 
>>>> the event loop and task queues <http://www.whatwg.org/specs/**
>>>> web-apps/current-work/**multipage/webappapis.html#**event-loops<http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#event-loops>>
>>>>  
>>>> it can be that something else than the animation is pushing too many tasks 
>>>> in the queue and/or that those task run slowly, delaying other tasks and 
>>>> 

Re: Animation frame rate, possible to increase?

2012-04-17 Thread GWTter
Hi Thomas,

Actually, just had one last question. I went actually tested to make sure. 
I'm running my animation 1000ms like above and kept track of the number of 
times the onUpdate() function is being called. I'm getting an average of 12 
calls/updates, this would mean that I'm achieving 12fps? Does that mean 
there's a problem? Thanks again.

-Seth

On Tuesday, April 17, 2012 12:07:36 PM UTC-4, Thomas Broyer wrote:
>
>
>
> On Tuesday, April 17, 2012 6:05:19 PM UTC+2, Thomas Broyer wrote:
>>
>>
>>
>> On Tuesday, April 17, 2012 5:43:03 PM UTC+2, GWTter wrote:
>>>
>>> Hi all,
>>>
>>> I've written a move animation using the gwt way (extending animation 
>>> class etc.) and it works great but I've noticed that when that if I keep 
>>> the duration the same say 1000ms the longer the move distance is the 
>>> choppier the animation seems (the animation is smoother the shorter the 
>>> move distance is). I figured that this is because of the frame rate. In the 
>>> doc the frame rate is stated to be "non-fixed". 
>>>
>>> Does anyone know if it is possible to increase the frame rate on the 
>>> animation
>>
>>
>> No, it's not possible.
>>  
>>
>>> and if not can anyone suggest or have an idea on how to make the 
>>> animation smoother?
>>>
>>
>> Which browser were you testing this in? In Firefox and Chrome it should 
>> use requestAnimationFrame whose role is to defer to the browser the choice 
>> of the frame rate so that it stays responsive 
>> See https://developer.mozilla.org/en/DOM/window.requestAnimationFrame
>>  and 
>> http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/animation/Animation.gwt.xml
>> (and 
>> http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/animation/client/AnimationSchedulerImplTimer.java
>>  which 
>> uses a timer that tries to achieve 60Hz frame rate)
>>
>> If your animation is not smooth, it's probably that it doesn't run at 
>> approx. 60Hz, which means that either your code in the animation or some 
>> other code runs too slowly to achieve that rate. Because timers and 
>> requestAnimationFrame (and basically everything in a browser) go through 
>> the event loop and task queues <
>> http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#event-loops>
>>  
>> it can be that something else than the animation is pushing too many tasks 
>> in the queue and/or that those task run slowly, delaying other tasks and 
>> therefore prevent reaching the 60Hz target rate.
>>
>> Oh, of course, it can also be that you're trying to do the impossible, 
> and the only solution would be to run the animation for a longer duration 
> so that the moves between each frame (at the same frame rate) are smaller. 
>

-- 
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/-/sAsfTo2dYoYJ.
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: Animation frame rate, possible to increase?

2012-04-17 Thread GWTter
Hi Thomas,

I'm testing on FF. I thought it was probably just that I'm doing the 
impossible like you said too because the code I have for the animation is 
as concise as can be, the onUpdate() is just 2 lines of code which are just 
updating the top and left of the element. Maybe if I make the duration a 
function of the distance so that the achieved frame rate would stay below 
60Hz it would work out nicely. But thanks again for the back info you 
supplied, very helpful, really appreciate it.

-Seth


On Tuesday, April 17, 2012 12:07:36 PM UTC-4, Thomas Broyer wrote:
>
>
>
> On Tuesday, April 17, 2012 6:05:19 PM UTC+2, Thomas Broyer wrote:
>>
>>
>>
>> On Tuesday, April 17, 2012 5:43:03 PM UTC+2, GWTter wrote:
>>>
>>> Hi all,
>>>
>>> I've written a move animation using the gwt way (extending animation 
>>> class etc.) and it works great but I've noticed that when that if I keep 
>>> the duration the same say 1000ms the longer the move distance is the 
>>> choppier the animation seems (the animation is smoother the shorter the 
>>> move distance is). I figured that this is because of the frame rate. In the 
>>> doc the frame rate is stated to be "non-fixed". 
>>>
>>> Does anyone know if it is possible to increase the frame rate on the 
>>> animation
>>
>>
>> No, it's not possible.
>>  
>>
>>> and if not can anyone suggest or have an idea on how to make the 
>>> animation smoother?
>>>
>>
>> Which browser were you testing this in? In Firefox and Chrome it should 
>> use requestAnimationFrame whose role is to defer to the browser the choice 
>> of the frame rate so that it stays responsive 
>> See https://developer.mozilla.org/en/DOM/window.requestAnimationFrame
>>  and 
>> http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/animation/Animation.gwt.xml
>> (and 
>> http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/gwt/animation/client/AnimationSchedulerImplTimer.java
>>  which 
>> uses a timer that tries to achieve 60Hz frame rate)
>>
>> If your animation is not smooth, it's probably that it doesn't run at 
>> approx. 60Hz, which means that either your code in the animation or some 
>> other code runs too slowly to achieve that rate. Because timers and 
>> requestAnimationFrame (and basically everything in a browser) go through 
>> the event loop and task queues <
>> http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#event-loops>
>>  
>> it can be that something else than the animation is pushing too many tasks 
>> in the queue and/or that those task run slowly, delaying other tasks and 
>> therefore prevent reaching the 60Hz target rate.
>>
>> Oh, of course, it can also be that you're trying to do the impossible, 
> and the only solution would be to run the animation for a longer duration 
> so that the moves between each frame (at the same frame rate) are smaller. 
>

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



Animation frame rate, possible to increase?

2012-04-17 Thread GWTter
Hi all,

I've written a move animation using the gwt way (extending animation class 
etc.) and it works great but I've noticed that when that if I keep the 
duration the same say 1000ms the longer the move distance is the choppier 
the animation seems (the animation is smoother the shorter the move 
distance is). I figured that this is because of the frame rate. In the doc 
the frame rate is stated to be "non-fixed". 

Does anyone know if it is possible to increase the frame rate on the 
animation and if not can anyone suggest or have an idea on how to make the 
animation smoother?

Really appreciate it, much thanks in advance.

-Seth

-- 
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/-/QmocBe-kB48J.
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: CustomScrollPanel issue (extra div overlays generated impacting performance?)

2012-04-10 Thread GWTter
Hi Deepak,

Sure, I'll let you know once I add that functionality. Could be a little 
while as that currently is not a priority compared to my other items, but 
it definitely is needed and will be added.

-Seth

On Wednesday, April 4, 2012 4:30:01 PM UTC-4, Deepak Singh wrote:
>
> Ok.
>
> So request you to update me when you add this drag functionality. OR you 
> can give me some hints/suggestion so that i could also try a bit.
>
> Will be waiting for this one.
>
> Thanks
> Deepak
>
> On Thu, Apr 5, 2012 at 12:47 AM, GWTter  wrote:
>
>> Hi Deepak,
>>
>> Yes, sorry, I forgot to mention that I hadn't added the drag 
>> functionality to the scrollbar since I had put that on hold to focus on 
>> some other issues. So you should see the functionality with the scroll 
>> wheel only currently.
>>
>> -Seth
>>
>>
>> On Wednesday, April 4, 2012 1:26:44 PM UTC-4, Deepak Singh wrote:
>>>
>>> Hi Seth,
>>>
>>> It works. Thanks.
>>>
>>> But the scrolling happens only through the mouse wheel movement, it does 
>>> not scroll by dragging the bar in up and down direction.
>>> It simply gets dragged like an image. 
>>>
>>>
>>> On Wed, Apr 4, 2012 at 8:53 AM, GWTter  wrote:
>>>
>>>> Hi Deepak,
>>>>
>>>> The most you should need to do is the following:
>>>>
>>>> AbsolutePanel absPanel = new AbsolutePanel();
>>>> for(int i = 0; i < 10; i++){
>>>>  SimplePanel simp = new SimplePanel();
>>>>  simp.setHeight("100px");
>>>>  simp.setWidth("500px");
>>>>  simp.getElement().getStyle().**setBackgroundColor("green");
>>>>  absPanel.add(simp);
>>>> }
>>>>
>>>> MyScrollPanel scrollPanel = new MyScrollPanel();
>>>> scrollPanel.setHeight("500px")**;
>>>> scrollPanel.setWidth("100px");
>>>>
>>>> scrollPanel.add(absPanel);
>>>>
>>>> RootPanel.get().add(**scrollPanel);
>>>>
>>>> If the above code does not give you a green scrollable box then you 
>>>> should recheck your code. With the code I sent you and the above code, you 
>>>> should have a custom scroll bar (not native). You should at the very least 
>>>> have the above code working. Hope this helps. Let me know.
>>>>
>>>> -Seth
>>>>
>>>>
>>>>
>>>> On Tuesday, April 3, 2012 1:59:33 PM UTC-4, Deepak Singh wrote:
>>>>>
>>>>> Hi Seth,
>>>>>
>>>>> I added the styles to myVerticalScrollBar. and added the entire page 
>>>>> content to MyScrollpanel but still the default scrollbar is there.
>>>>>
>>>>> Its not overridden.
>>>>>
>>>>>
>>>>> On Mon, Apr 2, 2012 at 9:39 PM, GWTter  wrote:
>>>>>
>>>>>> Hi Deepak,
>>>>>>
>>>>>> Yes, you would need to apply some style to your scrollbar so that it 
>>>>>> at least has width (or height if you were using the horizontal 
>>>>>> scrollbar). 
>>>>>> If you look at the MyVerticalScrollBar constructor, the line 
>>>>>> 'this.setStyleName("**verticalSc**rollBar")' sets the style for the 
>>>>>> scrollbar. This style is not defined in the myScrollPanel.css as that 
>>>>>> CSS 
>>>>>> file is only meant for the cornerpanel styling. You would need to define 
>>>>>> the style "verticalScrollBar" in your main CSS file. For example: 
>>>>>>
>>>>>> .verticalScrollBar{
>>>>>>   width: 10px;
>>>>>>   background: blue;
>>>>>> }
>>>>>>
>>>>>> Also, make sure that the content you're scrolling is within the 
>>>>>> MyScrollPanel, since only content within the MyScrollPanel will have the 
>>>>>> custom scroll bars, anything not within a CustomScrollPanel will still 
>>>>>> default to the native implementation. Hope this helps.
>>>>>>
>>>>>> -Seth
>>>>>>
>>>>>> -Seth
>>>>>>
>>>>>>
>>>>>> On Monday, April 2, 2012 11:44:57 AM UTC-4, Deepak Singh wrote:
>>>>>>>
>>>>>>> Nothing more than what i sent you.
&g

Re: CustomScrollPanel issue (extra div overlays generated impacting performance?)

2012-04-04 Thread GWTter
Hi Deepak,

Yes, sorry, I forgot to mention that I hadn't added the drag functionality 
to the scrollbar since I had put that on hold to focus on some other 
issues. So you should see the functionality with the scroll wheel only 
currently.

-Seth

On Wednesday, April 4, 2012 1:26:44 PM UTC-4, Deepak Singh wrote:
>
> Hi Seth,
>
> It works. Thanks.
>
> But the scrolling happens only through the mouse wheel movement, it does 
> not scroll by dragging the bar in up and down direction.
> It simply gets dragged like an image. 
>
>
> On Wed, Apr 4, 2012 at 8:53 AM, GWTter  wrote:
>
>> Hi Deepak,
>>
>> The most you should need to do is the following:
>>
>> AbsolutePanel absPanel = new AbsolutePanel();
>> for(int i = 0; i < 10; i++){
>>  SimplePanel simp = new SimplePanel();
>>  simp.setHeight("100px");
>>  simp.setWidth("500px");
>>  simp.getElement().getStyle().setBackgroundColor("green");
>>  absPanel.add(simp);
>> }
>>
>> MyScrollPanel scrollPanel = new MyScrollPanel();
>> scrollPanel.setHeight("500px");
>> scrollPanel.setWidth("100px");
>>
>> scrollPanel.add(absPanel);
>>
>> RootPanel.get().add(scrollPanel);
>>
>> If the above code does not give you a green scrollable box then you 
>> should recheck your code. With the code I sent you and the above code, you 
>> should have a custom scroll bar (not native). You should at the very least 
>> have the above code working. Hope this helps. Let me know.
>>
>> -Seth
>>
>>
>>
>> On Tuesday, April 3, 2012 1:59:33 PM UTC-4, Deepak Singh wrote:
>>>
>>> Hi Seth,
>>>
>>> I added the styles to myVerticalScrollBar. and added the entire page 
>>> content to MyScrollpanel but still the default scrollbar is there.
>>>
>>> Its not overridden.
>>>
>>>
>>> On Mon, Apr 2, 2012 at 9:39 PM, GWTter  wrote:
>>>
>>>> Hi Deepak,
>>>>
>>>> Yes, you would need to apply some style to your scrollbar so that it at 
>>>> least has width (or height if you were using the horizontal scrollbar). If 
>>>> you look at the MyVerticalScrollBar constructor, the line 
>>>> 'this.setStyleName("**verticalScrollBar")' sets the style for the 
>>>> scrollbar. This style is not defined in the myScrollPanel.css as that CSS 
>>>> file is only meant for the cornerpanel styling. You would need to define 
>>>> the style "verticalScrollBar" in your main CSS file. For example: 
>>>>
>>>> .verticalScrollBar{
>>>>   width: 10px;
>>>>   background: blue;
>>>> }
>>>>
>>>> Also, make sure that the content you're scrolling is within the 
>>>> MyScrollPanel, since only content within the MyScrollPanel will have the 
>>>> custom scroll bars, anything not within a CustomScrollPanel will still 
>>>> default to the native implementation. Hope this helps.
>>>>
>>>> -Seth
>>>>
>>>> -Seth
>>>>
>>>>
>>>> On Monday, April 2, 2012 11:44:57 AM UTC-4, Deepak Singh wrote:
>>>>>
>>>>> Nothing more than what i sent you.
>>>>>
>>>>> I have just myScrollPanel.css as mention above.
>>>>>
>>>>> Could you pls guide me with css if i need to apply some css over 
>>>>> vertical scrollbar?
>>>>>
>>>>> Thanks in advance
>>>>> Deepak
>>>>>
>>>>> On Mon, Apr 2, 2012 at 8:19 PM, GWTter  wrote:
>>>>>
>>>>>> Hi Deepak,
>>>>>>
>>>>>> This looks good to me. What style are you using for the vertical 
>>>>>> scrollbar?
>>>>>>
>>>>>> And thanks for the repost.
>>>>>>
>>>>>> -Seth
>>>>>>
>>>>>>
>>>>>> On Sunday, April 1, 2012 3:50:12 PM UTC-4, Deepak Singh wrote:
>>>>>>>
>>>>>>> Hi Seth,
>>>>>>>
>>>>>>> I am posting my code here:
>>>>>>>
>>>>>>> myScrollPanel.css
>>>>>>> @CHARSET "ISO-8859-1";
>>>>>>>
>>>>>>> .customScrollPanel{
>>>>>>> }
>>>>>>> .customScrollPanelCorner{
>>>>>>> opacity: 0.0;
>

Re: CustomScrollPanel issue (extra div overlays generated impacting performance?)

2012-04-03 Thread GWTter
Hi Deepak,

The most you should need to do is the following:

AbsolutePanel absPanel = new AbsolutePanel();
for(int i = 0; i < 10; i++){
 SimplePanel simp = new SimplePanel();
 simp.setHeight("100px");
 simp.setWidth("500px");
 simp.getElement().getStyle().setBackgroundColor("green");
 absPanel.add(simp);
}

MyScrollPanel scrollPanel = new MyScrollPanel();
scrollPanel.setHeight("500px");
scrollPanel.setWidth("100px");

scrollPanel.add(absPanel);

RootPanel.get().add(scrollPanel);

If the above code does not give you a green scrollable box then you should 
recheck your code. With the code I sent you and the above code, you should 
have a custom scroll bar (not native). You should at the very least have 
the above code working. Hope this helps. Let me know.

-Seth


On Tuesday, April 3, 2012 1:59:33 PM UTC-4, Deepak Singh wrote:
>
> Hi Seth,
>
> I added the styles to myVerticalScrollBar. and added the entire page 
> content to MyScrollpanel but still the default scrollbar is there.
>
> Its not overridden.
>
>
> On Mon, Apr 2, 2012 at 9:39 PM, GWTter  wrote:
>
>> Hi Deepak,
>>
>> Yes, you would need to apply some style to your scrollbar so that it at 
>> least has width (or height if you were using the horizontal scrollbar). If 
>> you look at the MyVerticalScrollBar constructor, the line 
>> 'this.setStyleName("verticalScrollBar")' sets the style for the scrollbar. 
>> This style is not defined in the myScrollPanel.css as that CSS file is only 
>> meant for the cornerpanel styling. You would need to define the style 
>> "verticalScrollBar" in your main CSS file. For example: 
>>
>> .verticalScrollBar{
>>   width: 10px;
>>   background: blue;
>> }
>>
>> Also, make sure that the content you're scrolling is within the 
>> MyScrollPanel, since only content within the MyScrollPanel will have the 
>> custom scroll bars, anything not within a CustomScrollPanel will still 
>> default to the native implementation. Hope this helps.
>>
>> -Seth
>>
>> -Seth
>>
>>
>> On Monday, April 2, 2012 11:44:57 AM UTC-4, Deepak Singh wrote:
>>>
>>> Nothing more than what i sent you.
>>>
>>> I have just myScrollPanel.css as mention above.
>>>
>>> Could you pls guide me with css if i need to apply some css over 
>>> vertical scrollbar?
>>>
>>> Thanks in advance
>>> Deepak
>>>
>>> On Mon, Apr 2, 2012 at 8:19 PM, GWTter  wrote:
>>>
>>>> Hi Deepak,
>>>>
>>>> This looks good to me. What style are you using for the vertical 
>>>> scrollbar?
>>>>
>>>> And thanks for the repost.
>>>>
>>>> -Seth
>>>>
>>>>
>>>> On Sunday, April 1, 2012 3:50:12 PM UTC-4, Deepak Singh wrote:
>>>>>
>>>>> Hi Seth,
>>>>>
>>>>> I am posting my code here:
>>>>>
>>>>> myScrollPanel.css
>>>>> @CHARSET "ISO-8859-1";
>>>>>
>>>>> .customScrollPanel{
>>>>> }
>>>>> .customScrollPanelCorner{
>>>>> opacity: 0.0;
>>>>> }
>>>>>
>>>>> MyScrollPanel.java
>>>>>
>>>>> public class MyScrollPanel extends CustomScrollPanel {
>>>>>  /**
>>>>>  * Extends the CustomScrollPanel Resources interface so that we can 
>>>>> add our own css file and still reuse the Resources and Style interfaces 
>>>>> from CustomScrollPanel
>>>>>  * @author SL
>>>>>  *
>>>>>  */
>>>>>  public interface MyScrollResources extends Resources{
>>>>>
>>>>> @Source("com/pdstechi/client/**m**yScrollPanel.css")
>>>>>  Style customScrollPanelStyle();
>>>>> }
>>>>>  public MyScrollPanel(){
>>>>> super((MyScrollResources)GWT.**c**reate(MyScrollResources.**class)**);
>>>>>  this.setVerticalScrollbar(new MyVerticalScrollBar(), 
>>>>> MyVerticalScrollBar.**getScrollB**arWidth());
>>>>> // this.setHorizontalScrollbar(**ne**w MyHorizontalScrollBar(), 
>>>>> MyHorizontalScrollBar.**getScrol**lBarHeight());
>>>>>  }
>>>>>
>>>>> }
>>>>>
>>>>>
>>>>> MyVerticalScrollBar.java
>>>>>
>>>>> public class MyVerticalScrollBar extends Widget implements 
>>>

Re: CustomScrollPanel issue (extra div overlays generated impacting performance?)

2012-04-02 Thread GWTter
Hi Deepak,

Yes, you would need to apply some style to your scrollbar so that it at 
least has width (or height if you were using the horizontal scrollbar). If 
you look at the MyVerticalScrollBar constructor, the line 
'this.setStyleName("verticalScrollBar")' sets the style for the scrollbar. 
This style is not defined in the myScrollPanel.css as that CSS file is only 
meant for the cornerpanel styling. You would need to define the style 
"verticalScrollBar" in your main CSS file. For example: 

.verticalScrollBar{
  width: 10px;
  background: blue;
}

Also, make sure that the content you're scrolling is within the 
MyScrollPanel, since only content within the MyScrollPanel will have the 
custom scroll bars, anything not within a CustomScrollPanel will still 
default to the native implementation. Hope this helps.

-Seth

-Seth

On Monday, April 2, 2012 11:44:57 AM UTC-4, Deepak Singh wrote:
>
> Nothing more than what i sent you.
>
> I have just myScrollPanel.css as mention above.
>
> Could you pls guide me with css if i need to apply some css over vertical 
> scrollbar?
>
> Thanks in advance
> Deepak
>
> On Mon, Apr 2, 2012 at 8:19 PM, GWTter  wrote:
>
>> Hi Deepak,
>>
>> This looks good to me. What style are you using for the vertical 
>> scrollbar?
>>
>> And thanks for the repost.
>>
>> -Seth
>>
>>
>> On Sunday, April 1, 2012 3:50:12 PM UTC-4, Deepak Singh wrote:
>>>
>>> Hi Seth,
>>>
>>> I am posting my code here:
>>>
>>> myScrollPanel.css
>>> @CHARSET "ISO-8859-1";
>>>
>>> .customScrollPanel{
>>> }
>>> .customScrollPanelCorner{
>>> opacity: 0.0;
>>> }
>>>
>>> MyScrollPanel.java
>>>
>>> public class MyScrollPanel extends CustomScrollPanel {
>>>  /**
>>>  * Extends the CustomScrollPanel Resources interface so that we can add 
>>> our own css file and still reuse the Resources and Style interfaces from 
>>> CustomScrollPanel
>>>  * @author SL
>>>  *
>>>  */
>>>  public interface MyScrollResources extends Resources{
>>>
>>> @Source("com/pdstechi/client/**myScrollPanel.css")
>>>  Style customScrollPanelStyle();
>>> }
>>>  public MyScrollPanel(){
>>> super((MyScrollResources)GWT.**create(MyScrollResources.**class));
>>>  this.setVerticalScrollbar(new MyVerticalScrollBar(), 
>>> MyVerticalScrollBar.**getScrollBarWidth());
>>> // this.setHorizontalScrollbar(**new MyHorizontalScrollBar(), 
>>> MyHorizontalScrollBar.**getScrollBarHeight());
>>>  }
>>>
>>> }
>>>
>>>
>>> MyVerticalScrollBar.java
>>>
>>> public class MyVerticalScrollBar extends Widget implements 
>>> VerticalScrollbar {
>>> private double scrollBarHeight = 0.0;
>>>  private double scrollBarPosition = 0.0;
>>> private double scrollWindowPercentage = 1.0;
>>>  private double scrollWindowHeight = 0;
>>>  private int totalScrollContentHeight = 0;
>>>  private static final int SCROLL_BAR_WIDTH = 10;
>>> private Element elem;
>>>   public MyVerticalScrollBar(){
>>>  this.elem = Document.get().**createDivElement();
>>> setElement(this.elem);
>>> this.setStyleName("**verticalScrollBar");
>>>  }
>>>  public static int getScrollBarWidth(){
>>>  return SCROLL_BAR_WIDTH;
>>> }
>>>
>>> @Override
>>>  public int getMaximumVerticalScrollPositi**on() {
>>> return (int)(this.scrollWindowHeight-**this.scrollBarHeight);
>>>  }
>>>
>>> @Override
>>> public int getMinimumVerticalScrollPositi**on() {
>>>  return 0;
>>> }
>>>
>>> @Override
>>>  public int getVerticalScrollPosition() {
>>> return (int)this.scrollBarPosition;
>>>  }
>>>  @Override
>>>  public void setVerticalScrollPosition(int position) {
>>> this.scrollBarPosition = Math.floor(position*this.**
>>> scrollWindowPercentage);
>>>  //make sure we don't go out of bounds with the scrollbar
>>> if(this.scrollBarPosition > this.**getMaximumVerticalScrollPositi**
>>> on()){
>>>  this.scrollBarPosition = this.**getMaximumVerticalScrollPositi**on();
>>> }
>>>  this.elem.getStyle().setTop(**this.scrollBarPosition, Unit.PX);
>>> }
>>>
>>>  @Override
>>> public HandlerRegistration addScrollHandler(ScrollHandler handler) {
>>>  Event.sinkEvents(this.*

Re: CustomScrollPanel issue (extra div overlays generated impacting performance?)

2012-04-02 Thread GWTter
Hi Deepak,

This looks good to me. What style are you using for the vertical scrollbar?

And thanks for the repost.

-Seth

On Sunday, April 1, 2012 3:50:12 PM UTC-4, Deepak Singh wrote:
>
> Hi Seth,
>
> I am posting my code here:
>
> myScrollPanel.css
> @CHARSET "ISO-8859-1";
>
> .customScrollPanel{
> }
> .customScrollPanelCorner{
> opacity: 0.0;
> }
>
> MyScrollPanel.java
>
> public class MyScrollPanel extends CustomScrollPanel {
>  /**
>  * Extends the CustomScrollPanel Resources interface so that we can add 
> our own css file and still reuse the Resources and Style interfaces from 
> CustomScrollPanel
>  * @author SL
>  *
>  */
>  public interface MyScrollResources extends Resources{
>
> @Source("com/pdstechi/client/myScrollPanel.css")
>  Style customScrollPanelStyle();
> }
>  public MyScrollPanel(){
> super((MyScrollResources)GWT.create(MyScrollResources.class));
>  this.setVerticalScrollbar(new MyVerticalScrollBar(), 
> MyVerticalScrollBar.getScrollBarWidth());
> // this.setHorizontalScrollbar(new MyHorizontalScrollBar(), 
> MyHorizontalScrollBar.getScrollBarHeight());
>  }
>
> }
>
>
> MyVerticalScrollBar.java
>
> public class MyVerticalScrollBar extends Widget implements 
> VerticalScrollbar {
> private double scrollBarHeight = 0.0;
>  private double scrollBarPosition = 0.0;
> private double scrollWindowPercentage = 1.0;
>  private double scrollWindowHeight = 0;
>  private int totalScrollContentHeight = 0;
>  private static final int SCROLL_BAR_WIDTH = 10;
> private Element elem;
>   public MyVerticalScrollBar(){
>  this.elem = Document.get().createDivElement();
> setElement(this.elem);
> this.setStyleName("verticalScrollBar");
>  }
>  public static int getScrollBarWidth(){
>  return SCROLL_BAR_WIDTH;
> }
>
> @Override
>  public int getMaximumVerticalScrollPosition() {
> return (int)(this.scrollWindowHeight-this.scrollBarHeight);
>  }
>
> @Override
> public int getMinimumVerticalScrollPosition() {
>  return 0;
> }
>
> @Override
>  public int getVerticalScrollPosition() {
> return (int)this.scrollBarPosition;
>  }
>  @Override
>  public void setVerticalScrollPosition(int position) {
> this.scrollBarPosition = Math.floor(position*this.scrollWindowPercentage);
>  //make sure we don't go out of bounds with the scrollbar
> if(this.scrollBarPosition > this.getMaximumVerticalScrollPosition()){
>  this.scrollBarPosition = this.getMaximumVerticalScrollPosition();
> }
>  this.elem.getStyle().setTop(this.scrollBarPosition, Unit.PX);
> }
>
>  @Override
> public HandlerRegistration addScrollHandler(ScrollHandler handler) {
>  Event.sinkEvents(this.getElement(), Event.ONSCROLL);
> return this.addHandler(handler, ScrollEvent.getType());
>  }
>
> @Override
> public Widget asWidget() {
>  return this;
> }
>
> @Override
>  public int getScrollHeight() {
> return this.totalScrollContentHeight;
> }
>  @Override
> public void setScrollHeight(int height) {
>  //TODO: HAVE TO FIND A WAY TO GET THE SIZE OF THE CORNER BOX, OR BETTER 
> YET, IF THE CORNER BOX IS ENABLED BECAUSE THE HORIZONTAL SCROLL BAR IS ALSO 
> VISIBLE
>  this.totalScrollContentHeight = height;
> this.scrollWindowHeight = this.elem.getParentElement().getOffsetHeight();
>  this.scrollWindowPercentage = (height > 0) ? 
> Math.min(1.0,this.scrollWindowHeight/height):1.0;
> this.scrollBarHeight = 
> Math.max(SCROLL_BAR_WIDTH,Math.floor(this.scrollWindowHeight*this.scrollWindowPercentage));
>  this.elem.getStyle().setHeight(this.scrollBarHeight, Unit.PX);
> }
>  }
>
>
> All these classes are in my client package.
>
> I just want that browser default varticalscrollbar should change its look.
>
>
> Also, I am reposting the original msg with attached code again to the 
> group.
>
> Thanks
> Deepak 
>
>
>
>
>
> On Sun, Apr 1, 2012 at 11:01 PM, GWTter  wrote:
>
>> Hi Deepak,
>>
>> You would have to post your code. Did you make sure to style your 
>> vertical scrollbar, create the MyScrollPanel and set its verticalScrollbar 
>> with the one you created? In the code I sent you the vertical scrollbar has 
>> a width of 10px, you should style the vertical scrollbar to be within that 
>> width.
>>
>> Also, I can't seem to find the repost of the original message with the 
>> attached code I sent you anywhere in this thread, am I looking in the wrong 
>> place. Thanks.
>>
>> -Seth
>>
>>
>> On Saturday, March 31, 2012 4:27:42 PM UTC-4, Deepak Singh wrote:
>>>
>>> Hi Seth,
>>>
>>> I copied your cl

Re: CustomScrollPanel issue (extra div overlays generated impacting performance?)

2012-04-01 Thread GWTter
Hi Deepak,

You would have to post your code. Did you make sure to style your vertical 
scrollbar, create the MyScrollPanel and set its verticalScrollbar with the 
one you created? In the code I sent you the vertical scrollbar has a width 
of 10px, you should style the vertical scrollbar to be within that width.

Also, I can't seem to find the repost of the original message with the 
attached code I sent you anywhere in this thread, am I looking in the wrong 
place. Thanks.

-Seth

On Saturday, March 31, 2012 4:27:42 PM UTC-4, Deepak Singh wrote:
>
> Hi Seth,
>
> I copied your classes and css in my client package. It compiled fine.
> When i run the applicatio in dev mode, the browser default scrollbar is 
> not overridden.
>
> It is same as default.
>
> What can i do to override the native one ?
>
> On Sun, Apr 1, 2012 at 1:05 AM, Deepak Singh wrote:
>
>> Thank you Seth. I would give it a try.
>>
>> Thats already reposted and is in the thread.
>>
>> Thanks
>> Deepak
>>
>>
>> On Sat, Mar 31, 2012 at 10:59 PM, GWTter  wrote:
>>
>>> Hi Deepak,
>>>
>>> This is all that's in the css file as the only important class is the 
>>> corner that I've set to be transparent:
>>>
>>> .customScrollPanel{
>>> }
>>>
>>> .customScrollPanelCorner{
>>> opacity: 0.0;
>>> }
>>>
>>> As for how to use the vertical scroll bar to override the native (or the 
>>> transparent one CustomScrollPanel uses by default) if you look at the line
>>>
>>> "this.setVerticalScrollbar(new 
>>> MyVerticalScrollBar(),MyVerticalScrollBar.getScrollBarWidth());"
>>>
>>> in MyScrollPanel class in the code I sent, this is what actually does 
>>> the overriding. This method is available on the CustomScrollPanel class 
>>> which MyScrollPanel extends.
>>>
>>> Hope that answers your question. Also can you please repost my initial 
>>> reply with the code to this thread, it would save me the time of having to 
>>> rewrite it :) Thanks.
>>>
>>>
>>> -Seth
>>>
>>>  -- 
>>> 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/-/g-x4PrKzgjoJ.
>>>
>>> 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.
>>>
>>
>>
>>
>> -- 
>> Deepak Singh
>>  
>
>
>
> -- 
> Deepak Singh
>  

-- 
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/-/ukY2df0M7DsJ.
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: CustomScrollPanel issue (extra div overlays generated impacting performance?)

2012-03-31 Thread GWTter
Hi Deepak,

This is all that's in the css file as the only important class is the 
corner that I've set to be transparent:

.customScrollPanel{
}

.customScrollPanelCorner{
opacity: 0.0;
}

As for how to use the vertical scroll bar to override the native (or the 
transparent one CustomScrollPanel uses by default) if you look at the line

"this.setVerticalScrollbar(new 
MyVerticalScrollBar(),MyVerticalScrollBar.getScrollBarWidth());"

in MyScrollPanel class in the code I sent, this is what actually does the 
overriding. This method is available on the CustomScrollPanel class which 
MyScrollPanel extends.

Hope that answers your question. Also can you please repost my initial 
reply with the code to this thread, it would save me the time of having to 
rewrite it :) Thanks.

-Seth

-- 
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/-/g-x4PrKzgjoJ.
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: CustomScrollPanel issue (extra div overlays generated impacting performance?)

2012-03-30 Thread GWTter
Hi Deepak,

Sorry, I think I just replied to you personally, can you repost my reply 
here? Thanks.

-Seth

-- 
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/-/PB5g6_TVZAUJ.
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: CustomScrollPanel issue (extra div overlays generated impacting performance?)

2012-03-30 Thread GWTter
Hi Thomas,

Thanks so much for all of your suggestions and for explaining the extra 
DIVs, it makes a lot more sense now. I'll try what you said and let you 
know. Thanks again.

-Seth

On Friday, March 30, 2012 5:40:47 AM UTC-4, Thomas Broyer wrote:
>
>
>
> On Thursday, March 29, 2012 5:43:55 AM UTC+2, GWTter wrote:
>>
>> Hi all,
>>
>> I've used the CustomScrollPanel in order to implement some custom 
>> scrollbars, everything was working great until I added DnD (gwt-dnd, not 
>> native) functionality
>> to an element in the scrollpanel. The dragging action on the elements 
>> within is extremely laggy. After a good amount of testing I found that the 
>> issue had to do with
>> the CustomScrollPanel since using a regular ScrollPanel performs just 
>> fine with minimal lag if any. I then looked at what is generated for the 
>> customscrollpanel to 
>> work and found some divs had been generated which I couldn't attribute 
>> any specific functionality to (ITEMs 1 & 2 below). They're basically just 
>> overlaying the whole
>> scrollpanel area and deleting them with firebug did not affect the 
>> customscrollpanel functionality, but deleting them did improve the dnd 
>> performance considerably. I see that
>> the more elements that are layered between the mouse click and the target 
>> element affect the performance to a good degree.
>>
>> My question is does anyone know if these extra DIVs are needed, and if so 
>> is there a way to workaround so I can still have the custom scroll bars 
>> with good DnD.
>>
>
> The DIVs are added by the ResizeLayoutPanel.ImplStandard to detect when 
> the content grows or shrinks, so the CustomScrollPanel can update the 
> scrollbars.
>
> BTW, the ITEM3 div is used by the Layout to detect changes of the font 
> size so ti can update its layers when they're positioned using EM or EX 
> units.
>
> Does changing the z-index of the various divs (ITEM1, ITEM2 and 
> dragdrop-dropTarget) changes anything performance-wise?
>
> DIRTY HACK: You could also try calling onDetach() on the 
> containerResizeImpl when entering the scroll panel (while dragging) and 
> calling onAttach() when leaving or dropping (use JSNI to access the private 
> containerResizeImpl). You might have to explicitly call 
> maybeUpdateScrollbars() after calling containerResizeImpl.onAttach(), as 
> I'm not sure onAttach() would call the ResizeLayoutPanel.Impl.Delegate), 
> and you might have to call it from a Scheduler.get().scheduleDeferred(), as 
> ResizeLayoutPanel.ImplStandard uses it.
>

-- 
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/-/rs-N4h0_ED4J.
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.



CustomScrollPanel issue (extra div overlays generated impacting performance?)

2012-03-29 Thread GWTter
Hi all,

I've used the CustomScrollPanel in order to implement some custom 
scrollbars, everything was working great until I added DnD (gwt-dnd, not 
native) functionality
to an element in the scrollpanel. The dragging action on the elements 
within is extremely laggy. After a good amount of testing I found that the 
issue had to do with
the CustomScrollPanel since using a regular ScrollPanel performs just fine 
with minimal lag if any. I then looked at what is generated for the 
customscrollpanel to 
work and found some divs had been generated which I couldn't attribute any 
specific functionality to (ITEMs 1 & 2 below). They're basically just 
overlaying the whole
scrollpanel area and deleting them with firebug did not affect the 
customscrollpanel functionality, but deleting them did improve the dnd 
performance considerably. I see that
the more elements that are layered between the mouse click and the target 
element affect the performance to a good degree.

My question is does anyone know if these extra DIVs are needed, and if so 
is there a way to workaround so I can still have the custom scroll bars 
with good DnD.

There's also a good reason for my using gwt-dnd over native.
I've been struggling with this for over a week now and it's driving me 
crazy, so hopefully someone can help. Thanks a lot in advance for any help 
and sorry for the long post.

The generated elements for the customscrollpanel are in the code below.

-Seth




> 
>   
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  style="position: relative; overflow: hidden;">
>  style="width: 100%; table-layout: fixed;">
> 
> Hello 
> World
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>

Thanks again.

-- 
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/-/kID-qZLB47UJ.
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.