Re: Digest for google-web-toolkit@googlegroups.com - 1 update in 1 topic

2022-12-05 Thread Tom Van Eetvelde
Yes

Op zo 4 dec. 2022 14:01 schreef :

> google-web-toolkit@googlegroups.com
> 
>  Google
> Groups
> 
> 
> Topic digest
> View all topics
> 
>
>- List or ArrayList/concrete type
><#m_-3498534033173789625_group_thread_0> - 1 Update
>
> List or ArrayList/concrete type
> 
> Hua Zhang : Dec 04 03:30AM -0800
>
> Is this 'concrete type' als valid for a DTO object in GWT-RPC?
>
> For example, I have a TestDTO object, which needs to be transferred via
> GWT-RPC.
>
>
>
>
>
>
>
> *public class TestDTO implements IsSerializable { public
> ArrayList data; public List operation() {
> return null; }}*
>
> If I understand correctly, data field needs to be a concrete type. How
> about the method operation, can I return here a generic List interface?
>
> Best regards,
>
> Hua
>
>
> Back to top <#m_-3498534033173789625_digest_top>
> You received this digest because you're subscribed to updates for this
> group. You can change your settings on the group membership page
> 
> .
> To unsubscribe from this group and stop receiving emails from it send an
> email to google-web-toolkit+unsubscr...@googlegroups.com.
>

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


Re: Running locally in Dev mode with Eclipse

2020-11-20 Thread Tom Van Eetvelde
Hi,

Did you install the ' Google Plugin for Eclipse ' as mentioned in the 
instructions in http://www.gwtproject.org/usingeclipse.html ?
 It leads you to https://cloud.google.com/eclipse/docs/migrating-gpe saying 
that this plugin is no longer supported. So you have to go for the GWT 
eclipse plugin as mentioned on that site. Without it, you won't have the 
option ' Debug As > Web Application.'

Personally, I am more a fan of the maven way and the tbroyer maven plugin 
:https://tbroyer.github.io/gwt-maven-plugin/
Also check out https://github.com/tbroyer/gwt-maven-archetypes/  for maven 
archetypes. You can easily create sample maven projects with these. Well 
documented. 
The archetypes are made such that you run the devmode in the command 
prompt, while still able to do code changes in eclipse and getting them 
reflected through browser refresh.

Eclipse integrates with maven by default. You can even run maven builds in 
eclipse. If you go the maven way, your project is immediately ready to be 
taken up in some automatic build system. 

Hope this helps.

Greets,

Tom.
Op donderdag 19 november 2020 om 23:56:47 UTC+1 schreef 
ronaldob...@gmail.com:

> Hello all,
>
> I'm new to GWT and while following the Get Started page tutorial to 
> install it I got stuck in the step "Run locally in Development mode with 
> Eclipse", since there's no option showing for me in Eclipse to Debug As > 
> Web Application.´
>
> Thought it could be a problem of software packages for Eclipse, installed 
> the Eclipse Web Developer Tools 3.19 from the Eclipse Marketplace, but 
> still no Debug as Web Application option is available.
>
> Besides this, everytime I try to run it from the build command from 
> Command prompt in Windows I'm able to compile the project and get into 
> Development Mode with the command "ant devmode", where I get the GWT Dev 
> Mode window, but every time I try to launch the application in the browser 
> I always get error 503, not being able to reach the file.
>
> Could this be any missing step on the Get Started page like setting up the 
> server side or some step I did wrong? Any hint would be appreciated.
>
> Thanks for the help!
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/f4dda2a6-946f-496b-8d1b-82c6ff55abe7n%40googlegroups.com.


Just saying thanks

2020-10-19 Thread Tom Van Eetvelde
Hi,

I just wanted to say that I have been using GWT since 2009 and I never 
thought about sharing how much fun GWT has brought to my developer life. So 
I am doing it now :-)

To be honest, there are some libraries/toolkits out there that rise above 
the others. They have this intrinsic quality, they are open instead of 
restrictive on your coding style and when you need to take the extra mile 
in your dev work, the framework goes along, providing what you need. GWT is 
definitely among these.

GWT is the reason that I started browser UI development as a Java backend 
profile.
I am so happy GWT is still among us and I will be continuing to use this 
framework for many years to come. 

Thanks for this great framework!

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit/63a54346-f3fd-45b9-86d9-c1fe3ef9298dn%40googlegroups.com.


Re: Client to client communication

2018-03-06 Thread Tom Davies
A GWT client is a web page in a browser, which can't talk to another 
browser instance, because a browser can't listen on a socket, as far as I'm 
aware. So clients don't really have 'port numbers'.

I think that the right way to do what you want to do would be to have 
clients send messages to a server side queue which would store the messages 
until a client polled the server for messages addressed to that client.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


gwt-maven-plugin: how can I chnage the Jetty port?

2017-02-23 Thread Tom Pijl
I am using the gwt-maven-plug of Thomas Broyer.
I would like to change the Jetty server port from (default)  to e.g. 
4200 when running mvn gwt:devmode.
Any pointers on how to configure that?

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: GWT RPC in GWT 3.0+

2016-02-06 Thread Tom Davies


On Sunday, 7 February 2016 18:07:12 UTC+11, Vassilis Virvilis wrote:
>
> AFAIK RestyGWT does not include a server component. You have to rely on 
> another jax-rs server-side stack in order to serve RestyGWT requests.
>
> Here is a list of java implementations although nobody forces to stay on 
> java server side 
> https://en.wikipedia.org/wiki/Java_API_for_RESTful_Web_Services
>

I mean that it allows the same interface to be used to specify the client 
and the server -- see "Reusing server interfaces" at the bottom of this 
page: https://resty-gwt.github.io/documentation/restygwt-user-guide.html

When I say that I want an RPC implementation to be statically typed, I mean 
that the Java type system must enforce that the GWT client matches the 
server implementation, and that if I change either I will get compile time 
errors. This can be done either via Java or via some intermediate 
specification language, I don't mind.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: GWT RPC in GWT 3.0+

2016-02-06 Thread Tom Davies
I didn't realise that RestyGWT did the server side too -- thanks for 
getting me to look at it again!

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


Re: GWT RPC in GWT 3.0+

2016-02-06 Thread Tom Davies
I'm not actively using GWt at present, unfortunately, but I second the 
importance of GWT-RPC.

For me the ability to statically type the interfaces is very important, and 
the tooling support that Intellij IDEA provides makes it easy to use.

Are there any statically typed alternatives? It's a shame that grpc doesn't 
have browser support.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.


How to add back the “loading” Element after removed it from Parent?

2015-01-12 Thread Tom
 

Ok, in war/MyProject.html, I have:


  




  
...


in MyProject.java

public class OfflineMatching implements EntryPoint {
   @Override
   public void onModuleLoad() {
// this code works fine
if(DOM.getElementById("loading")!=null){

DOM.getElementById("loading").removeFromParent();
}


Button myButton=new Button("Enter Main Page");
RootPanel.get().add(myButton);
myButton.addClickHandler(new ClickHandler(){

   @Override
   public void onClick(ClickEvent event) {
   // this code does not work
   if(DOM.getElementById("loading")==null){
 DOM.appendChild(RootPanel.getBodyElement(), 
DOM.createElement("loading"));
   }
   }
});
   }
}

So, did i do anything wrong? Why this code does not work?

 // this code does not work
   if(DOM.getElementById("loading")==null){
 DOM.appendChild(RootPanel.getBodyElement(), 
DOM.createElement("loading"));
   }


http://stackoverflow.com/questions/27901577/how-to-add-back-the-loading-element-after-removed-it-from-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.
For more options, visit https://groups.google.com/d/optout.


Re: How to make your GWT app loading fast by using gzip in .htaccess file?

2015-01-12 Thread Tom
Thank you very much for your answer. Ok, I got it but I still did not see 
it quicker after putting compression="on" into connector of conf/server.xml 
file. Something is wrong here.


On Monday, January 12, 2015 at 5:31:50 PM UTC+7, Thomas Broyer wrote:
>
> .htaccess is an Apache HTTPD configuration file. Apache Tomcat won't honor 
> it. The expected name is also ".htaccess", not "1.htaccess".
>
> On Monday, January 12, 2015 at 5:16:59 AM UTC+1, Tom wrote:
>>
>> My GWT app got a problem . That is the Initial downloading file is quite 
>> big. So I want to make it smaller. SO I heard that we can put the gzip 
>> configuration into .htaccess file in ROOT folder and then all the 
>> .cache.html files will be zipped when downloaded from Server to user 
>> personal PCs.
>>
>> So, here is my project structure. The project name Vala
>>
>> tomcat7/vala/ROOT/
>>
>> in the ROOT folder there are:
>>
>> ROOT/images
>> ROOT/vala
>> ROOT/WEB-INF
>> ROOT/vala.css
>> ROOT/vala.html
>>
>> in ROOT/vala folder there are:
>>
>> ROOT/vala/deferredjs/
>> ROOT/vala/gwt/
>> ROOT/1BGcache.html
>> ROOT/5Dcache.html
>> ... more cache.html file
>>
>> Now I create a 1.htaccess file as following (I copied this code from 
>> internet and don't understand it much):
>>
>> 
>> mod_gzip_on Yes
>> mod_gzip_dechunk Yes
>> mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
>> mod_gzip_item_include handler ^cgi-script$
>> mod_gzip_item_include mime ^text/.*
>> mod_gzip_item_include mime ^application/x-javascript.*
>> mod_gzip_item_exclude mime ^image/.*
>> mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
>> 
>>
>> Then i put this 1.htaccess file into ROOT folder ROOT/1.htaccess
>>
>> However, nothing happened. 
>>
>> SO , how to make your GWT app loading fast by using gzip in .htaccess 
>> file  
>>
>>
>> http://stackoverflow.com/questions/27895197/how-to-make-your-gwt-app-loading-fast-by-using-gzip-in-htaccess-file
>>
>

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


How to make your GWT app loading fast by using gzip in .htaccess file?

2015-01-11 Thread Tom
 

My GWT app got a problem . That is the Initial downloading file is quite 
big. So I want to make it smaller. SO I heard that we can put the gzip 
configuration into .htaccess file in ROOT folder and then all the 
.cache.html files will be zipped when downloaded from Server to user 
personal PCs.

So, here is my project structure. The project name Vala

tomcat7/vala/ROOT/

in the ROOT folder there are:

ROOT/images
ROOT/vala
ROOT/WEB-INF
ROOT/vala.css
ROOT/vala.html

in ROOT/vala folder there are:

ROOT/vala/deferredjs/
ROOT/vala/gwt/
ROOT/1BGcache.html
ROOT/5Dcache.html
... more cache.html file

Now I create a 1.htaccess file as following (I copied this code from 
internet and don't understand it much):


mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*


Then i put this 1.htaccess file into ROOT folder ROOT/1.htaccess

However, nothing happened. 

SO , how to make your GWT app loading fast by using gzip in .htaccess file  

http://stackoverflow.com/questions/27895197/how-to-make-your-gwt-app-loading-fast-by-using-gzip-in-htaccess-file

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


how to correctly remove element in gwt (both `DOM.isOrHasChild` & `DOM.removeChild` were deprecated)?

2015-01-02 Thread Tom
 

Ok, this code works

if(DOM.isOrHasChild(RootPanel.getBodyElement(), DOM.getElementById("loading"))){
DOM.removeChild(RootPanel.getBodyElement(), 
DOM.getElementById("loading"));
}

However, both DOM.isOrHasChild & DOM.removeChild were deprecated. Then, the 
question is:

What are the undeprecated code that can do the same task as the bove code? 
maybe use releaseCapture or something likes that?

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


Re: GWT 2.7.0 is here

2014-11-20 Thread Tom Legrand
Great news! We're going to switch to 2.7 in our next sprint
Great to see it compiles even faster in the super dev mode

On Thursday, November 20, 2014 11:59:06 AM UTC+1, Daniel Kurka wrote:
>
> Today we are excited to announce the GWT 2.7.0 release.  Thanks to 
> everyone who contributed to this release, especially our non-Google open 
> source contributors.
>
> One major feature of this release is a new super fast compilation path in 
> Super Dev mode that replaces the old dev mode.
> For a run-down of all changes since GWT 2.6.1, read the release notes 
> .
>
> The release is available for download here 
>  or on maven central.
>
> If you find any issues with this release, please file a bug in our issue 
> tracker.
>
> Daniel,
> on behalf of the GWT team at Google
>
>

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


How to config so that the Server can see the image location of GWT app when the app was not put into ROOT folder of Tomcat?

2014-10-06 Thread Tom
 

Ok, I built an GWT app. It has images folder located inside war folder.

In my UiBinder I have something likje this

 

I compiled my project and bring all the compiled files into Root folder of 
tomcat then all imagea are fine as I can see them

But if I copy the compiled files into a folder that is not Root folder like 
ABC, then i can not see the image though the app works fine. This time the 
image location will be ABC/images

I do not want to change ABC/images/.. for all the image url in my Gwt app, 
then the question is how to config the server so that i can see my images?

http://stackoverflow.com/questions/26215380/how-to-config-so-that-the-server-can-see-the-image-location-of-gwt-app-when-the

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


Where to call an Action when user remove an uploaded image in GWTUpload?

2014-09-30 Thread Tom
 

I am using GWTUpload , the library is in here 
https://code.google.com/p/gwtupload/

The Example code at client side found on that website has this structure:

 // Attach an image to the pictures viewer
private OnLoadPreloadedImageHandler showImage = new 
OnLoadPreloadedImageHandler() {
public void onLoad(PreloadedImage image) {
  //showImageFlowPanel code solution 1
  image.setWidth("75px");
  showImageFlowPanel.add(image);
}
};


private IUploader.OnFinishUploaderHandler onFinishUploaderHandler = new 
IUploader.OnFinishUploaderHandler() {
  public void onFinish(IUploader uploader) {
if (uploader.getStatus() == Status.SUCCESS) {

  new PreloadedImage(uploader.fileUrl(), showImage);

  UploadedInfo info = uploader.getServerInfo();

  String headShotImageUrl="http://"+Window.Location.getHost()+"/" 
+"images/uploaded/"+info.message;
  //headShotImage code solution 2
  if(!"".equals(headShotImageUrl) && 
UriUtils.isSafeUri(headShotImageUrl)){
  headShotImage.setUrl(UriUtils.fromString(headShotImageUrl));
  }



}
  }
};

The example uses showImageFlowPanel (solution 1) to store the image but I 
want to store the image inside headShotImage which take the url after user 
uploaded image successfully, see the headShotImage (solution 2) code above. 

Ok, the headShotImage code work fine but I dont know how to remove it when 
users remove the image. If I use showImageFlowPanel as in the solution 1 
then the program remove the image automatically for me and I do not need to 
do anything.

So my question is "*Where to call an Action when user remove an uploaded 
image in GWTUpload?*"

http://stackoverflow.com/questions/26117517/where-to-call-an-action-when-user-remove-an-uploaded-image-in-gwtupload

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


How to calculate ages correctly in GWT?

2014-09-29 Thread Tom
 

This is what I did, but it did not take into account the leap years

public static int calculateAge(String MMddBirthDate){
DateTimeFormat fmt = DateTimeFormat.getFormat("-MM-dd");
Date birthDateDate = fmt.parse(MMddBirthDate);
Date nowDate=new Date();
long differenceInMillis=nowDate.getTime()-birthDateDate.getTime();
int days=(int)Math.abs(differenceInMillis/(1000*60*60*24));
int ages=(int)days/365;
System.out.println(days+" days");


return ages;
}

I heard we have to use Joda time to calculate ages, but seem GWT does not 
support Joda time.

Can we just simply use simple code to calculate ages in GWT rather than 
using library?

http://stackoverflow.com/questions/26112354/how-to-calculate-ages-correctly-in-gwt

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


Confusing about Single Quote of MyMessages and MyConstants properties file Do and DONT need escape in different GWT versions

2014-09-27 Thread Tom
 

Ok, let say, I got MyMesssages.peroperties file that has:

myText=I don''t

Ok, I used to run my app under GWT 2.5 and it required me to escape the 
Single Quote, ie i have to type 2 Single Quote otherwise I will have a 
RunTime error.

Now I using GWT2.6 & I don't need to escape just 1 Single Quote is ok. If I 
use '' in GWT2.6 it will show 2 single quotes ''.

I don't get it. Did Google change the escape rule for "Single Quote"? What 
if i try to run my GWT2.5 app under GWT 2.6, then will it change all Single 
Quote to 2 Single Quotes ?

http://stackoverflow.com/questions/26075721/confusing-about-single-quote-of-mymessages-and-myconstants-properties-file-do-an

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


Re: How to effectively add Constants values into a ListBox in GWT?

2014-09-27 Thread Tom
 

Found a simple solution, but not sure I am doing correctly:

In MyConstants.properties file

countryArray=England, America, Japan,...

in MyConstants.java

String[] countryArray();

in Presenter or View

for(String s : myConstants.countryArray()){
   countryListBox.addItem(s);
}


On Saturday, September 27, 2014 10:37:31 PM UTC+10, Tom wrote:
>
> Ok, say I have a Label and a ListBox in UiBinder
>
> 
> 
>
> In MyConstants.properties file
>
> country=Country
> england=England
> america=America
> japan=Japan
> 
>
> in Presenter or View
>
> countryLabel.setText(myConstants.country()); 
>
> This is so easy for Label since we only need to set Text 1 time but it 
> will be very time consuming if we do the ListBox
>
> countryListBox.addItem(myConstants.england());
> countryListBox.addItem(myConstants.america());
> etc... there will have 200 countries out there
>
> So my question is, is there any quicker way to effectively add Constants 
> values into a ListBox in GWT? 
>
>
> http://stackoverflow.com/questions/26074732/how-to-effectively-add-constants-values-into-a-listbox-in-gwt
>

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


How to effectively add Constants values into a ListBox in GWT?

2014-09-27 Thread Tom
 

Ok, say I have a Label and a ListBox in UiBinder




In MyConstants.properties file

country=Country
england=England
america=America
japan=Japan


in Presenter or View

countryLabel.setText(myConstants.country()); 

This is so easy for Label since we only need to set Text 1 time but it will 
be very time consuming if we do the ListBox

countryListBox.addItem(myConstants.england());
countryListBox.addItem(myConstants.america());
etc... there will have 200 countries out there

So my question is, is there any quicker way to effectively add Constants 
values into a ListBox in GWT? 

http://stackoverflow.com/questions/26074732/how-to-effectively-add-constants-values-into-a-listbox-in-gwt

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


How to change the Size of the ListBox of the datePicker in GWT?

2014-09-24 Thread Tom
 

I am building a mobile website and thus I have a need to many all GWT Gui 
to become bigger. 

For example, my css in my gwt mobile app is like this:

.myNormalMobileFont{
font-size: 500%;
}

.myNormalLargeFont{
font-size: 700%;
 }

And Here is Css code of DateBox and DatePicker

.gwt-DateBox {
  padding: 15px 16px;
  border: 3px solid #ccc;
  border-top: 3px solid #999;
  font-size: 500%;
}
.gwt-DateBox input {
  width: 8em;
}
.dateBoxFormatError {
  background: #ff;
}
.dateBoxPopup {
}

.gwt-DatePicker {
  border: 3px solid #ccc;
  border-top:3px solid #999;
  cursor: default;
}
.gwt-DatePicker td,
.datePickerMonthSelector td:focus {
  outline: none;
}
.datePickerDays {
  width: 100%;
  background: white;
}
.datePickerDay,
.datePickerWeekdayLabel,
.datePickerWeekendLabel {
  font-size: 255%;
  text-align: center;
  padding: 12px;
  outline: none;
  font-weight:bold;
  color:#333;
  border-right: 3px solid #EDEDED;
  border-bottom: 3px solid #EDEDED;
}
.datePickerWeekdayLabel,
.datePickerWeekendLabel {
  background: #fff;
  padding: 0px 12px 6px;
  cursor: default;
  color:#666;
  font-size:210%;
  font-weight:normal;
}
.datePickerDay {
  padding: 12px 21px;
  cursor: hand;
  cursor: pointer;
}
.datePickerDayIsWeekend {
  background: #f7f7f7;
}
.datePickerDayIsFiller {
  color: #999;
  font-weight:normal;
}
.datePickerDayIsValue {
  background: #d7dfe8;
}
.datePickerDayIsDisabled {
  color: #AA;
  font-style: italic;
}
.datePickerDayIsHighlighted {
  background: #F0E68C;
}
.datePickerDayIsValueAndHighlighted {
  background: #d7dfe8;
}
.datePickerDayIsToday {
  padding: 3px;
  color: #fff;
  background: url(images/hborder.png) repeat-x 0px -2607px;
}

.datePickerMonthSelector {
  width: 100%;
  padding: 3px 0 15px 0;
  background: #fff;
}
td.datePickerMonth {
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  font-size: 300%;
  font-weight: bold;
  color: #333;
}
.datePickerPreviousButton,
.datePickerNextButton {
  font-size: 360%;
  line-height: 1em;
  color: #3a6aad;
  cursor: hand;
  cursor: pointer;
  font-weight: bold;
  padding: 0px 12px;
  outline: none;
}

After that, the GuiLookLike this [image: enter image description here]

Ass u can see the Text inside the Year and Month listbox is very small, so 
how to style them to make them bigger?, probally using font-size.


http://stackoverflow.com/questions/26015314/how-to-change-the-size-of-the-listbox-of-the-datepicker-in-gwt

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


How to simply add more years into DatePicker in GWT and use the format to DD-MM-YYYY when a date was selected?

2014-09-23 Thread Tom
 

Look at this code,

DateBox myDateBox=new DateBox();
myDateBox.getDatePicker().setYearAndMonthDropdownVisible(true);
DateTimeFormat dateFormat = DateTimeFormat.getFormat("DD-MM-");
myDateBox.setFormat(new DateBox.DefaultFormat(dateFormat));

Ok, when I clicked on the DateBox the DatePicker got popped up but I could 
not see years like from 1600, so How to add more years into DatePicker?

Alos, I want to use the format to DD-MM- when a date was selected but 
when clicked on a date nothing appeared in the DateBox?


http://stackoverflow.com/questions/26005633/how-to-simply-add-more-year-into-datepicker-in-gwt-and-use-the-format-to-dd-mm-y

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


Can we build GWT app that does not have Captcha function but is still able to prevent spam?

2014-09-22 Thread Tom
 

I am building Gwt site for mobile devices. The screen size of the mobile 
devices is very small, so I think if i require users to enter Captcha when 
they register then it could be quite cumbersome.

I heard that we can use some Javascript technique to prevent the Spam 
without needing to use captcha.

GWT is all about Javascript, so I am not sure if GWT has any technology to 
prevent spam without using Captcha?

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


Which GWT Layout Panel is perfect for building Mobile Friendly Website?

2014-09-21 Thread Tom
 

Ok, A Mobile Friendly Website should be very short and focus on the task, 
so it wont need to show the headers as in Desktop Website.

Here is What I want to design.

When user open mydomain.com in Mobile devices like Smartphone or Tablet. 
They Will see

Email:
Pass:
Login

Registration

Explanation

About

When they CLick Login they will go to a page that lists all the products, 
the Page Should has "Home" link the Back button

Home  Back

Product 1 , some other info
Product 2 , some other info
Product 3 , some other info
..

When user clicks on a product, it will show the details of the products

Home  Back

This is Product 1 

Detail info of product 1..


If user hits "Back" button then it will go back to the previous page (ie, 
the list of products page).

Note that: in the home page, we also have "Registration", "Explanation" & 
"About" Buttons, but we will never show these buttons in any other pages 
except the home page.

So, my question is:

Is there any Gwt Layout panel that can help me to achieve that Simple 
Design for Mobile Friendly Website?

The only 1 I can see is the TabLayoutPanel, but the headers are always 
appear in all pages.

What about "StackLayoutPanel"? How it look like? & is it good for Mobile 
Website?


http://stackoverflow.com/questions/25959731/which-gwt-layout-panel-is-perfect-for-building-mobile-friendly-website

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


Re: How to let Hermes to switch to other properties file rather the default one?

2014-08-06 Thread Tom
 

found solution that is to use MyConstants

in client, 

public interface MyConstants extends ConstantsWithLookup{
String id();
}


MyConstants_de.properties

id=2121 


MyConstants.properties

id=4545

In server

MyConstants myConstants = Hermes.get(MyConstants.class, "");
myConstants.id(); //will print id=4545


MyConstants myConstants = Hermes.get(MyConstants.class, "de");
myConstants.id(); //will print id=2121



On Wednesday, August 6, 2014 12:35:52 PM UTC+10, Tom wrote:
>
> Ok, I am building GWT app and I am using Hermes to manage the constants 
> at Server side.
>
> Here is what I did:
>
> I created MyConstantsWithLookup.properties (default English version) & 
> MyConstantsWithLookup_de.properties (German version) & 
> MyConstantsWithLookup.java in client package
>
> -MyConstantsWithLookup.properties has
>
> id=1245
>
>
> -MyConstantsWithLookup_de.properties has
>
> id=4556 
>
> -MyConstantsWithLookup.java
>
> public interface MyConstantsWithLookup extends ConstantsWithLookup {
>int id();
> }
>
> There is Data.java in Server package. Data.java has 
>
> public static int id(){
> try {
> MyConstantsWithLookup myConstantsWithLookup = 
> Hermes.get(MyConstantsWithLookup.class, "");
> return myConstantsWithLookup.id();
> } catch (IOException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> return "";
> }
>
> Ok, it works fine if i open the page in English. Ex, myDomain.com it will 
> show correctly the id=1245. However, if i open the page in German 
> language myDomain.com?locale=de then it did not pick up the id=4556 but 
> still use the old id.
>
> Did i do anything wrong here?
>
> How to fix it?
>
>
> http://stackoverflow.com/questions/25151383/how-to-let-hermes-to-switch-to-other-properties-file-rather-the-default-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/d/optout.


Re: How to let Hermes to switch to other properties file rather the default one?

2014-08-06 Thread Tom
I did use ur code, but it didn't work as it still pick the default ID 
(id=1245)


On Wednesday, August 6, 2014 5:21:31 PM UTC+10, Fabien Dumay wrote:
>
> Hi Tom,
>
> Did you think to enable the i18n permutations? 
> To to setup the german permutation, you have to add few lines in gwt 
> module file (.gwt.xml):
>
> 
> …
> 
>  "queryparam,cookie,meta,useragent"/>
> …
> 
> 
>  
>
> Hoping it helps.
>
> Regards,
>
> —
> Fabien
> http://pwt.putnami.org/
>
> Le 6 août 2014 à 04:35, Tom > a écrit :
>
> Ok, I am building GWT app and I am using Hermes to manage the constants 
> at Server side.
>
> Here is what I did:
>
> I created MyConstantsWithLookup.properties (default English version) & 
> MyConstantsWithLookup_de.properties (German version) & 
> MyConstantsWithLookup.java in client package
>
> -MyConstantsWithLookup.properties has
>
> id=1245
>
>
> -MyConstantsWithLookup_de.properties has
>
> id=4556 
>
> -MyConstantsWithLookup.java
>
> public interface MyConstantsWithLookup extends ConstantsWithLookup {
>int id();
> }
>
> There is Data.java in Server package. Data.java has 
>
> public static int id(){
> try {
> MyConstantsWithLookup myConstantsWithLookup = 
> Hermes.get(MyConstantsWithLookup.class, "");
> return myConstantsWithLookup.id();
> } catch (IOException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> return "";
> }
>
> Ok, it works fine if i open the page in English. Ex, myDomain.com it will 
> show correctly the id=1245. However, if i open the page in German 
> language myDomain.com?locale=de then it did not pick up the id=4556 but 
> still use the old id.
>
> Did i do anything wrong here?
>
> How to fix it?
>
>
> http://stackoverflow.com/questions/25151383/how-to-let-hermes-to-switch-to-other-properties-file-rather-the-default-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-we...@googlegroups.com 
> .
> Visit this group at http://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>
>
>

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


How to let Hermes to switch to other properties file rather the default one?

2014-08-05 Thread Tom
 

Ok, I am building GWT app and I am using Hermes to manage the constants at 
Server side.

Here is what I did:

I created MyConstantsWithLookup.properties (default English version) & 
MyConstantsWithLookup_de.properties (German version) & 
MyConstantsWithLookup.java in client package

-MyConstantsWithLookup.properties has

id=1245


-MyConstantsWithLookup_de.properties has

id=4556 

-MyConstantsWithLookup.java

public interface MyConstantsWithLookup extends ConstantsWithLookup {
   int id();
}

There is Data.java in Server package. Data.java has 

public static int id(){
try {
MyConstantsWithLookup myConstantsWithLookup = 
Hermes.get(MyConstantsWithLookup.class, "");
return myConstantsWithLookup.id();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return "";
}

Ok, it works fine if i open the page in English. Ex, myDomain.com it will 
show correctly the id=1245. However, if i open the page in German language 
myDomain.com?locale=de then it did not pick up the id=4556 but still use 
the old id.

Did i do anything wrong here?

How to fix it?

http://stackoverflow.com/questions/25151383/how-to-let-hermes-to-switch-to-other-properties-file-rather-the-default-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/d/optout.


Why Cookies will not be stored if setting Timeout = 30 days in GWT?

2014-07-30 Thread Tom
 

This is very weird. Ok, the below code works fine

public void setCookie(String cookiesName, String cookiesValue){
final int COOKIE_TIMEOUT = 1000 * 60 * 60 * 24;//1 days
Date expires = new Date((new Date()).getTime() + COOKIE_TIMEOUT);
Cookies.setCookie(cookiesName, cookiesValue, expires);
}
//then
setCookie("currentLang","de");
Collection cookies = Cookies.getCookieNames();
for(String cookie : cookies){
if("currentLang".equals(cookie)){
  System.out.println("got currentlang");
}
}

If i run the above code then I can see output: "*got currentlang*" However, 
if I set timeout=30 days final int COOKIE_TIMEOUT = 1000 * 60 * 60 * 24 * 
30;//30 days, then nothing got printed out, so "currentLang" has not even 
been stored if we set 30 days?

Why is that? does Gwt prevent that to happen?

http://stackoverflow.com/questions/25049270/why-cookies-will-not-be-stored-if-setting-timeout-30-days-in-gwt

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


How to make Div and Image flow inline in GWT?

2014-07-30 Thread Tom
 

There is following code in UiBinder


   
   
   
   

in Css

.flowInline{
display:inline-block;}

This is the requirement. I want the *text1, image1, text2, image2*, flow in 
the same line.

text1Div.setInnerSafeHtml(SafeHtmlUtils.fromSafeConstant("Please: Click"));
text2Div.setInnerSafeHtml(SafeHtmlUtils.fromSafeConstant("and Click"));

It should show the result:

Please:
Click [image1] and
Click [image2]

But somehow it didn't work

If I don't use Div in UiBinder


   Please: 
   Click  and 
   Click 

Then it work fine

So, how to fix it?

http://stackoverflow.com/questions/25033666/how-to-make-div-and-image-flow-inline-in-gwt

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


Re: How to get the Url string before & after “#” that works both in eClipse Development & in deployed real domain name in GWT?

2014-07-29 Thread Tom
Thank you very much Jen, this is exactly what I need as it change thes 
current url & not remove the name token & other params of the current url. 

On Tuesday, July 29, 2014 10:31:37 PM UTC+10, Jens wrote:
>
> String newUrl = Window.Location.createUrlBuilder().setParameter("locale", 
> ).buildString();
> Window.Location.assign(newUrl); *OR* Window.Location.replace(newUrl);
>
> -- 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/d/optout.


How to get the Url string before & after “#” that works both in eClipse Development & in deployed real domain name in GWT?

2014-07-29 Thread Tom
 

Ok, I am deveoping a GWT app using eClipse,

Everytime I run my app in eClipse the it return this format of url

http://127.0.0.1:/MyProject.html?gwt.codesvr=127.0.0.1:9997#!getOrder

Ok, if I deploy my app into a real domain then it will be like this 
http://dm.com#!getOrder

I have no ide of what this string MyProject.html?gwt.codesvr=127.0.0.1:9997 
in development mode for?

Currently I doing the internationalization. It will works If I type 
http://127.0.0.1:/MyProject.html?gwt.codesvr=127.0.0.1:9997&locale=de#!getOrder
 
then it will show German version

But I don't want user to type &locale=de in the url, so I created a listbox 
in my header page and when user selects other language, for ex German, then 
the url should capture the url part before # & append &locale=de & then 
append the url part after #. If doing correctly it will be 
http://127.0.0.1:/MyProject.html?gwt.codesvr=127.0.0.1:9997&locale=de#!getOrder

SO i tried Window.Location.getHost()+"&locale=de" then the url become 
http://127.0.0.1:/myproject/&locale=de which does not work in eclipse

So How to get the Url string before & after "#" that works both in eClipse 
Development & in deployed real domain name in GWT?

http://stackoverflow.com/questions/25014638/how-to-get-the-url-string-before-after-that-works-both-in-eclipse-developm

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


Re: How to access “locale” value (of an Internationalization App) in server side in GWT?

2014-07-29 Thread Tom
I found the currect solution that is to use LocaleInfo

LocaleInfo localeInfo=LocaleInfo.getCurrentLocale();
String locale=localeInfo.getLocaleName();
addToPopupSlot(loadingPresenter);
SetLanguage action=new SetLanguage(locale);

dispatchAsync.execute(action, setLanguageCallback);


On Tuesday, July 29, 2014 4:07:47 PM UTC+10, Tom wrote:
>
> Ok, I am developing an app that supports Internationalization. I am using 
> Static 
> String Internationalization method for my app.
>
> Let say my app can have English & German version, so -1st, I created 
> MyMessages.java which has all message texts written in English. Then I 
> created an MyMessages_ge which is almost the same as MyMessages.java 
> except that the text written in German
>
> -2nd, in MyProject.html i have  content="text/html; charset=UTF-8"> to make sure it will support all 
> languages
>
> -3rd, in MyProject.gwt.xml I have  values="ge"/>
>
> Now I run my app in eclipse 
> http://localhost:/MyProject.html?gwt.codesvr=127.0.0.1:9997&locale=ge 
> & it shows all the German text as I expected.
>
> However, I have a need to know that my app is German At Server Side. That 
> means whenever my GWT Gui in German version then my server will know that 
> languageCode=1 if it is in English so server will use the default 
> language languageCode=0
>
> Here is what I did. At HeaderPresenter.java
>
> @Override
> public void prepareFromRequest(PlaceRequest request){
> super.prepareFromRequest(request);
> String locale=request.getParameter("locale", "");
> setLanguage(locale); // servercall back here
> }
>
> so when my app run first time it should let server to know which language 
> the Gwt app is using
>
> @Override
> public SetLanguageResult execute(SetLanguage action, ExecutionContext context)
> throws ActionException {
> String locale=action.getLocale();
> if("ge".equals(locale)){
> Data.languageType=1;
> }
> return null;
> }
>
> However, it doesn't seem work When I go to orderPage the url will be 
> http://localhost:/MyProject.html?gwt.codesvr=127.0.0.1:9997&locale=ge#!orderPage
>  
> it not in the form 
> http://localhost:/MyProject.html?gwt.codesvr=127.0.0.1:9997#!orderPage;locale=ge
>  
> that is why server couldn't capture the locale value.
>
> I think I misunderstood something here. I'm quite confusing.
>
> So How to access "locale" value (of an Internationalization App) in server 
> side in GWT?
>
>
> http://stackoverflow.com/questions/25009115/how-to-access-locale-value-of-an-internationalization-app-in-server-side-in
>

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


Re: How to access “locale” value (of an Internationalization App) in server side in GWT?

2014-07-29 Thread Tom


On Tuesday, July 29, 2014 7:46:12 PM UTC+10, Jens wrote:
>
> The internationalization works fine if i open 
> *http://127.0.0.1:/Ekajati.html?gwt.codesvr=127.0.0.1:9997;locale=de#!orderPage
>  
>> 
>>  *
>>
>> But it doesn't work if i open 
>> *http://127.0.0.1:/Ekajati.html?gwt.codesvr=127.0.0.1:9997#!orderPage 
>> *
>> *;locale=de*
>>
>
> A server can only see query parameters. It can not see the hash fragment 
> of an URL. So if you want to propagate information from the client to the 
> server via URL then you must use the first approach with the query 
> parameter.
>
> -- J.
>

Hi Jen, thankl you for your info this link work 
*http://127.0.0.1:/Ekajati.html?gwt.codesvr=127.0.0.1:9997;locale=de#!orderPage
 

 , 
but how can i capture the "locale"value in this url? that is a question*
also if we put ; or ? or & in front of *locale 
,
 
*it's all works 

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


Re: How to access “locale” value (of an Internationalization App) in server side in GWT?

2014-07-29 Thread Tom
Thax you very much for your info,
 this link work 
*http://127.0.0.1:/Ekajati.html?gwt.codesvr=127.0.0.1:9997;locale=de#!orderPage
 
<http://127.0.0.1:/Ekajati.html?gwt.codesvr=127.0.0.1:9997;locale=de#!orderPage>
 , 
but how can i capture the "locale"value in this url?*

On Tuesday, July 29, 2014 7:47:42 PM UTC+10, Cerberus wrote:
>
> Am 29.07.2014 11:41, schrieb Tom: 
> > The internationalization works fine if i open 
> > *
> http://127.0.0.1:/Ekajati.html?gwt.codesvr=127.0.0.1:9997;locale=de#!orderPage
>  
> * 
> > 
> > But it doesn't work if i open 
> > *
> http://127.0.0.1:/Ekajati.html?gwt.codesvr=127.0.0.1:9997#!orderPage**;locale=de*
>  
>
> Technically these are different URLs. Use the one that works. 
>
>
> Cheers, Lothar 
>

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


Re: How to access “locale” value (of an Internationalization App) in server side in GWT?

2014-07-29 Thread Tom
The internationalization works fine if i open 
*http://127.0.0.1:/Ekajati.html?gwt.codesvr=127.0.0.1:9997;locale=de#!orderPage
 *

But it doesn't work if i open 
*http://127.0.0.1:/Ekajati.html?gwt.codesvr=127.0.0.1:9997#!orderPage*
*;locale=de*


On Tuesday, July 29, 2014 6:44:12 PM UTC+10, Cerberus wrote:
>
> Am 29.07.2014 08:07, schrieb Tom: 
>
> > However, I have a need to know that my app is German |At Server Side|. 
> > That means whenever my GWT Gui in German version then my server will 
> > know that |languageCode=1| if it is in English so server will use the 
> > default language |languageCode=0| 
>
> I solved it by adding the language code to the signature of the 
> methods of the servlet. The localization-file contains an entry 
> CURR_LANGUAGE (=de in the german resource, =en in the english one), 
> so a call on the client-side always look something like this 
> doSomething(param1, param2, param3, CONSTANTS.CURRLANGUAGE(), new 
> Async...) 
>
> > However, it doesn't seem work When I go to orderPage the url will 
> > be |
> http://localhost:/MyProject.html?gwt.codesvr=127.0.0.1:9997&locale=ge#!orderPage|
>  
> > it not in the form |
> http://localhost:/MyProject.html?gwt.codesvr=127.0.0.1:9997#!orderPage;locale=ge|
>  
> > that is why server couldn't capture the |locale| value. 
>
> The Querystring of the URL starts with the gwt.codesvr, so I 
> assume the #!orderPage is in the wrong place. As well, sepa- 
> rating query-parameters by ; isn't correct, it must be &. So 
> the correct url should in my eyes be 
>
> http://localhost:/MyProject.html#!orderPage?gwt.codesvr=127.0.0.1:9997&locale=ge
>  
>
> BTW. GE is not the correct iso-value for german, it's de. You 
> should use these rather than inventing your own. 
>
>
> Cheers, Lothar 
>

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


How to access “locale” value (of an Internationalization App) in server side in GWT?

2014-07-28 Thread Tom
 

Ok, I am developing an app that supports Internationalization. I am using 
Static 
String Internationalization method for my app.

Let say my app can have English & German version, so -1st, I created 
MyMessages.java which has all message texts written in English. Then I 
created an MyMessages_ge which is almost the same as MyMessages.java except 
that the text written in German

-2nd, in MyProject.html i have  to make sure it will support all 
languages

-3rd, in MyProject.gwt.xml I have 

Now I run my app in eclipse 
http://localhost:/MyProject.html?gwt.codesvr=127.0.0.1:9997&locale=ge & 
it shows all the German text as I expected.

However, I have a need to know that my app is German At Server Side. That 
means whenever my GWT Gui in German version then my server will know that 
languageCode=1 if it is in English so server will use the default language 
languageCode=0

Here is what I did. At HeaderPresenter.java

@Override
public void prepareFromRequest(PlaceRequest request){
super.prepareFromRequest(request);
String locale=request.getParameter("locale", "");
setLanguage(locale); // servercall back here
}

so when my app run first time it should let server to know which language 
the Gwt app is using

@Override
public SetLanguageResult execute(SetLanguage action, ExecutionContext context)
throws ActionException {
String locale=action.getLocale();
if("ge".equals(locale)){
Data.languageType=1;
}
return null;
}

However, it doesn't seem work When I go to orderPage the url will be 
http://localhost:/MyProject.html?gwt.codesvr=127.0.0.1:9997&locale=ge#!orderPage
 
it not in the form 
http://localhost:/MyProject.html?gwt.codesvr=127.0.0.1:9997#!orderPage;locale=ge
 
that is why server couldn't capture the locale value.

I think I misunderstood something here. I'm quite confusing.

So How to access "locale" value (of an Internationalization App) in server 
side in GWT?

http://stackoverflow.com/questions/25009115/how-to-access-locale-value-of-an-internationalization-app-in-server-side-in

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


Re: How to get the Total of current tabs in TabLayoutPanel?

2014-07-26 Thread Tom
Awesome, it works Thax u very much

On Saturday, July 26, 2014 9:27:46 PM UTC+10, Jens wrote:
>
> TabLayoutPanel.getWidgetCount()
>
> -- 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/d/optout.


How to get the Total of current tabs in TabLayoutPanel?

2014-07-25 Thread Tom
 

We have tabLayoutPanel.selectTab(1) to select the the 2nd tab of the 
tabLayoutPanel However, we need to make sure that the tabLayoutPanel must 
currently have 2 tabs otherwise it will have "out of bound" error.

And if it has "out of bound" error & the rest of the code will not be 
implemented.

But there is no getTotalTabs method in tabLayoutPanel

do we need to get the Tab header and found the total tabs from the tab 
header? How to fix it?

http://stackoverflow.com/questions/24967240/how-to-get-the-total-of-current-tabs-in-tablayoutpanel

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


Can we have both ClickableTextCell and ButtonCell on the same column in GWT?

2014-07-21 Thread Tom
 

Ok, I have an IndexedColumn

public class IndexedColumn extends Column, String>{
public IndexedColumn(int index){
   super(new ClickableTextCell()); // by default it is ClickableTextCell
}
}

When creating column

IndexedColumn objectColumn=new IndexedColumn(6){
@Override
public String getCellStyleNames(Context context, List object) {
if (object.get(12).equals("button")){
return getView().getRes().css().gwtCellButton();
}
else if(object.get(12).equals("1")){
return getView().getRes().css().redColor();
}
return getView().getRes().css().myClickableTextCellStyle();
}
}

//css

.myClickableTextCellStyleBold{
font-weight:bold;
}
.myClickableTextCellStyleNormal{
font-weight:normal !important;
}

.myClickableTextCellStyle, .myClickableTextCellStyleBold, 
.myClickableTextCellStyleNormal
{
cursor: pointer;
cursor: hand;
}
.gwt-Button, .gwtCellButton button, .gwtCellButtonSmall button {
  margin: 0;
  padding: 5px 7px;
  text-decoration: none;
  cursor: pointer;
  cursor: hand;
  font-size:small;
  background: black;
  border:1px solid #bbb;
  border-bottom: 1px solid #a0a0a0;
  border-radius: 3px;
 -moz-border-radius: 3px;
  color: white;

}

after ran, it can pick up the getView().getRes().css().redColor() but 
didn't pick up the getView().getRes().css().gwtCellButton().

Is it possible to have both ClickableTextCell and ButtonCell on the same 
column, if it is, then how to do it?

http://stackoverflow.com/questions/24868496/can-we-have-both-clickabletextcell-and-buttoncell-on-the-same-column-in-gwt

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


Re: How to create the Horizontal ScrollBar at the bottom of DataGrid as in GWT CellSampler example?

2014-07-17 Thread Tom
Someone suggested me to use 

myDataGrid.setMinimumTableWidth(600, Unit.PX);

That works but my table was created dynamically. Sometimes there are 5 
columns sometimes it can be 50 columns.

 can we make it dynamically? also 
can we calculate the width of column so that it will fit all data in that 
column?

For ex, if a column has a header "The Article Name" & a cell "This is 
article title of the book" then the column should find the longest data 
& set the width accordingly so that the text  "This is article title of the 
book" will be fit into the column.

Other ex, if the header is "ID" & cell is "1" then the column width should 
contain the whole word "ID" which is the longest data in the column.
 

On Friday, July 18, 2014 2:03:00 PM UTC+10, Tom wrote:
>
> I like DataGrid since it has fixed header so wen user scrolldown they are 
> still be able to see the column header. 
>
> However, if there are too many columns then the DataGrid will manage to 
> fit all columns within the Fixed Width of the widget that contain it. 
>
> For example, if a 30 column DataGrid was put inside a center (with 100px) 
> of a DockLayoutPanel then all 30 columns will be divided evenly within 
> 100px, which is make it unreadable cos the with of each column is too small.
>
> So, I would love to use DataGrid but the DataGrid should have a 
> Horizontal ScrollBar at the bottom so if there are many column then the 
> user can just scroll horizontally to the right to see the data. 
>
> If we do correctly, then it should be like the *GWT CellSampler example* 
> http://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwCellSampler
>
> Clearly, the CellSampler used DataGid, but I didn't see any Horizontal 
> ScrollBar code in there.
>
> So how to make DataGrid to display as in the CellSampler example?
>
>
> http://stackoverflow.com/questions/24817026/how-to-create-the-horizontal-scrollbar-at-the-bottom-of-datagrid-as-in-gwt-cells
>

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


How to create the Horizontal ScrollBar at the bottom of DataGrid as in GWT CellSampler example?

2014-07-17 Thread Tom
 

I like DataGrid since it has fixed header so wen user scrolldown they are 
still be able to see the column header. 

However, if there are too many columns then the DataGrid will manage to fit 
all columns within the Fixed Width of the widget that contain it. 

For example, if a 30 column DataGrid was put inside a center (with 100px) 
of a DockLayoutPanel then all 30 columns will be divided evenly within 
100px, which is make it unreadable cos the with of each column is too small.

So, I would love to use DataGrid but the DataGrid should have a Horizontal 
ScrollBar at the bottom so if there are many column then the user can just 
scroll horizontally to the right to see the data. 

If we do correctly, then it should be like the *GWT CellSampler example* 
http://samples.gwtproject.org/samples/Showcase/Showcase.html#!CwCellSampler

Clearly, the CellSampler used DataGid, but I didn't see any Horizontal 
ScrollBar code in there.

So how to make DataGrid to display as in the CellSampler example?

http://stackoverflow.com/questions/24817026/how-to-create-the-horizontal-scrollbar-at-the-bottom-of-datagrid-as-in-gwt-cells

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


Re: The First-Time loading issue of a deployed GWT app?

2014-07-15 Thread Tom
Thank you very much Thomas, so putting the that *js ..* inside 
the * *will NOT cause any later problems right?

But can we have a more professional way to solve the problem? Can we use 
Code Splitting in the *EntryPoint* method?

On Wednesday, July 16, 2014 2:10:48 AM UTC+10, Thomas Broyer wrote:
>
>
>
> On Tuesday, July 15, 2014 6:05:13 PM UTC+2, Tom wrote:
>>
>> Someone told me to put the *"> language="javascript" src="myproject.nocache.js">"* inside the 
>> ** tag rather than inside the * *tag.
>>
>> After doing that it seem that it had loaded the "loading" indicator right 
>> at the beginning before loaded the *.nocache.js *
>>
>> But I am not sure if i put the that *js ..* inside the 
>> **, then will that cause any later problem?
>>
>
> No. 
>

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


Re: The First-Time loading issue of a deployed GWT app?

2014-07-15 Thread Tom
Or do I need to do the *Code Splitting *in the *EntryPoint* ? or using CSS 
loading indicator?

On Tuesday, July 15, 2014 1:34:29 PM UTC+10, Tom wrote:
>
> I deployed my app and I got this issue.
>
> The first time the app got loaded, it will show a blank white page for 5-7 
> second which is pretty long for a good user-experience. But after that, the 
> page show really really fast since it got cached.
>
> The problem is that when i advertised my site in Adword. When many people 
> will visit my site for the first time, they could be impatient if it shows 
> a blank page for a long period time like that. 
>
> I think the solution is to make an loading indicator to indicate user that 
> the page is loading.
>
> Actually I did do the indicator loading at the onModuleLoad method
>
> public class MyProject implements EntryPoint {
>
> private final ClientGinjector ginjector = GWT.create(ClientGinjector.class);
>
> @Override
> public void onModuleLoad() {
> // This is required for Gwt-Platform proxy's generator
> DelayedBindRegistry.bind(ginjector);
>
> ginjector.getPlaceManager().revealCurrentPlace();
> DOM.removeChild(RootPanel.getBodyElement(), 
> DOM.getElementById("loading"));
>
> }
>
> }
>
> In MyProject.html
>
> 
>  ..
>  
> 
>Loading
>
> 
>   
>   ..
>   
> 
>
> However, the  only works after all javascript files got 
> loaded. It doesn't work right at the beginning user visits the site & that 
> is why user will see a blank page for a pretty long time.
>
> *I am not sure GWT app is good for advertising in Google*. But my page 
> passed the Ad review from Adword people, so it means the page must be 
> finally visible, otherwise Adword people will reject my page.
>
> Can u figure out a solution for this?
>
>
> http://stackoverflow.com/questions/24749396/the-first-time-loading-issue-of-a-deployed-gwt-app
>

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


Re: The First-Time loading issue of a deployed GWT app?

2014-07-15 Thread Tom
Someone told me to put the *""* inside the 
** tag rather than inside the * *tag.

After doing that it seem that it had loaded the "loading" indicator right 
at the beginning before loaded the *.nocache.js *

But I am not sure if i put the that *js ..* inside the 
**, then will that cause any later problem?



On Tuesday, July 15, 2014 1:34:29 PM UTC+10, Tom wrote:
>
> I deployed my app and I got this issue.
>
> The first time the app got loaded, it will show a blank white page for 5-7 
> second which is pretty long for a good user-experience. But after that, the 
> page show really really fast since it got cached.
>
> The problem is that when i advertised my site in Adword. When many people 
> will visit my site for the first time, they could be impatient if it shows 
> a blank page for a long period time like that. 
>
> I think the solution is to make an loading indicator to indicate user that 
> the page is loading.
>
> Actually I did do the indicator loading at the onModuleLoad method
>
> public class MyProject implements EntryPoint {
>
> private final ClientGinjector ginjector = GWT.create(ClientGinjector.class);
>
> @Override
> public void onModuleLoad() {
> // This is required for Gwt-Platform proxy's generator
> DelayedBindRegistry.bind(ginjector);
>
> ginjector.getPlaceManager().revealCurrentPlace();
> DOM.removeChild(RootPanel.getBodyElement(), 
> DOM.getElementById("loading"));
>
> }
>
> }
>
> In MyProject.html
>
> 
>  ..
>  
> 
>Loading
>
> 
>   
>   ..
>   
> 
>
> However, the  only works after all javascript files got 
> loaded. It doesn't work right at the beginning user visits the site & that 
> is why user will see a blank page for a pretty long time.
>
> *I am not sure GWT app is good for advertising in Google*. But my page 
> passed the Ad review from Adword people, so it means the page must be 
> finally visible, otherwise Adword people will reject my page.
>
> Can u figure out a solution for this?
>
>
> http://stackoverflow.com/questions/24749396/the-first-time-loading-issue-of-a-deployed-gwt-app
>

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


The First-Time loading issue of a deployed GWT app?

2014-07-14 Thread Tom
 

I deployed my app and I got this issue.

The first time the app got loaded, it will show a blank white page for 5-7 
second which is pretty long for a good user-experience. But after that, the 
page show really really fast since it got cached.

The problem is that when i advertised my site in Adword. When many people 
will visit my site for the first time, they could be impatient if it shows 
a blank page for a long period time like that. 

I think the solution is to make an loading indicator to indicate user that 
the page is loading.

Actually I did do the indicator loading at the onModuleLoad method

public class MyProject implements EntryPoint {

private final ClientGinjector ginjector = GWT.create(ClientGinjector.class);

@Override
public void onModuleLoad() {
// This is required for Gwt-Platform proxy's generator
DelayedBindRegistry.bind(ginjector);

ginjector.getPlaceManager().revealCurrentPlace();
DOM.removeChild(RootPanel.getBodyElement(), DOM.getElementById("loading"));

}

}

In MyProject.html


 ..
 

   Loading
   

  
  ..
  


However, the  only works after all javascript files got 
loaded. It doesn't work right at the beginning user visits the site & that 
is why user will see a blank page for a pretty long time.

*I am not sure GWT app is good for advertising in Google*. But my page 
passed the Ad review from Adword people, so it means the page must be 
finally visible, otherwise Adword people will reject my page.

Can u figure out a solution for this?

http://stackoverflow.com/questions/24749396/the-first-time-loading-issue-of-a-deployed-gwt-app

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


How to clear all the current params of a current request (not to create a new request) in GWTP?

2014-07-12 Thread Tom

   
I am using GWT for my web app.

Here is the problem.

I have a currentRequest=new PlaceRequest(NameTokens.cust).with("ID", 
custID).with("name",name);

now I want to clear all the existing params of currentRequest, ie I want to 
remove "ID" & "name" params in currentRequest.

If I don't remove them, then if i do 
request=placeManager.getCurrentPlaceRequest().with("otherID", 
otherID); then the currentRequest will have 3 params as it still remember 
the other 2 params.

There is a solution, we can create a complete new Request

Request newRequest==new PlaceRequest(NameTokens.cust).with("otherID", otherID);

But i don't want that, I want to keep the currentRequest

There is no clearParam in Request object

How to fix it?

http://stackoverflow.com/questions/24713672/how-to-clear-all-the-current-params-of-a-current-request-not-to-create-a-new-re


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


What is the best solution to hide the ugly Gwt Crawlable Url (the one use hashbang)?

2014-07-12 Thread Tom
 

I just discovered that google adword does not allow the hash bang (#) in 
the destination url of Adword Ads. If the url contains # then u can't 
advertise ur page in Google.

So we need a way to hide the hash bang (#) in the url but still be able to 
let the the spider to know that our app is the Ajax-based app.

So what is the best (ie simple but very effective) solution to solve this 
issue?

http://stackoverflow.com/questions/24713047/what-is-the-best-solution-to-hide-the-ugly-gwt-crawlable-url-the-one-use-hashba

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


Scrollpanel doesn't scroll automatically when dragging an item over the "borderzone"

2014-07-07 Thread Tom
Hi!

I have a scrollpanel with two trees in it.
The right tree contains items which should be draggable to the left tree.
If both trees contain less items than the scrollpanel shows everything 
works fine.

The problem occurs if one tree is larger than the scrollpanel.

I think the behavior should be like this:
If an item gets dragged over the "borderzone" of the scrollpanel the 
scrollpanel should scroll up or down automatically.
This works in Chrome but not in Firefox (or IE).

Somebody got an idea what could cause this behavior?

I want to achieve this with pure gwt (no gwt-dnd or gwt-query)

Regards
Tom

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


Want to convert a couple of Java Applets

2014-07-01 Thread Tom Adams
I have a couple of Java Applets deployed on the web that I would like to 
convert away from deploying  Java Applets, due to the apparent 
failure/decline of Java Applets as a web technology.

There are at www.poologic.com. they are the Poologic Calculator and ROI 
Calculator.

Seems I can use GWT to compile them into javascript, not sure.

Is GWT  a good option? Are their better options?

I am at the bottom of the learning curve, just found GWT a few hours ago. 
 I was starting to learn javascript, but I decided to do some searches on 
automatic Java to Javascript conversion tools today.

Thanks for any advice or 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/d/optout.


Re: is there any way to trigger a method when users mouse over the Title of a column in GWT-CellTable?

2014-06-12 Thread Tom
Thank you Jens for your hint. I couldn't see any getConsumedEvents() so I 
used onBrowserEvent and it working ok.

 private class HeaderCell extends AbstractCell {

private String text;

public HeaderCell(String text) {
  /*
   * Let the parent class know that our cell responds to click 
events and
   * keydown events.
   */
  //super("click", "keydown");
super("mouseover"); 
this.text=text;

}

@Override
public void onBrowserEvent(Context context, Element parent, String 
value,
NativeEvent event, ValueUpdater valueUpdater) {
  // Check that the value is not null.
  if (value == null) {
return;
  }

  // Call the super handler, which handlers the enter key.
  super.onBrowserEvent(context, parent, value, event, valueUpdater);


  if ("mouseover".equals(event.getType())) {
  SafeHtmlBuilder sb=new SafeHtmlBuilder();
sb.appendHtmlConstant("");


sb.appendHtmlConstant("");
sb.appendEscaped(text);
sb.appendHtmlConstant("");

meaningMessagesPopup.setWidget(new HTML(sb.toSafeHtml()));


int left = event.getClientX() -140;
int top = event.getClientY() +30;
meaningMessagesPopup.setPopupPosition(left, top);

// Show the popup
meaningMessagesPopup.show();
  }
  else if ("mouseout".equals(event.getType())) {
  meaningMessagesPopup.hide();
  }
}

@Override
public void render(Context context, String value, SafeHtmlBuilder 
sb) {
  /*
   * Always do a null check on the value. Cell widgets can pass 
null to
   * cells if the underlying data contains a null, or if the data 
arrives
   * out of order.
   */
  if (value == null) {
return;
  }

  sb.appendEscaped(value);
}


}

Then

  Header nameColumnHeader = new Header(new HeaderCell("my 
Text...")) {
@Override
public String getValue() {
return "Name";
}
  };
  table.addColumn(nameColumn, nameColumnHeader);


On Friday, June 13, 2014 9:10:40 AM UTC+10, Jens wrote:
>
> ClickableTextCell only listens for click and keydown events so 
> Header.onBrowserEvent() will never be called for mouseover events. You must 
> create your own Cell class (possibly extending any of GWTs cells) and call 
> the super constructor AbstractCell(String... consumedEvents) if possible or 
> override AbstractCell.getConsumedEvents().
>
> Also you can use BrowserEvents.MOUSEOVER as a predefined constant.
>
> -- 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/d/optout.


Re: is there any way to trigger a method when users mouse over the Title of a column in GWT-CellTable?

2014-06-12 Thread Tom
I tried



Header nameColumnHeader = new Header(new ClickableTextCell
()) {
@Override
public String getValue() {
return "Name";
}
   


@Override
public final void onBrowserEvent(Context context, Element elem, 
NativeEvent event) {
 if ("mouseover".equals(event.getType())) {
 System.out.println("est");
 SafeHtmlBuilder sb=new SafeHtmlBuilder();
 sb.appendHtmlConstant("");
 
 sb.appendHtmlConstant("");
 sb.appendEscaped("Subject Name");
 sb.appendHtmlConstant("");
 
 meaningMessagesPopup.setWidget(new HTML(sb.toSafeHtml()));

 
 int left = event.getClientX() -140;
int top = event.getClientY() +30;
meaningMessagesPopup.setPopupPosition(left, top);


// Show the popup
meaningMessagesPopup.show();
 }
 else if("mouseout".equals(event.getType())){
 meaningMessagesPopup.hide();
 }
}
};
table.addColumn(nameColumn, nameColumnHeader);
But seem Gwt did not recognize *"mouseover".equals(event.getType())*


On Friday, June 13, 2014 12:51:03 AM UTC+10, Tom wrote:
>
> Ok, I have a CellTable CellTable> table = new 
> CellTable>();
>
> & a nameColumn IndexedColumn nameColumn=new IndexedColumn(0)
>
> then table.addColumn(nameColumn, "Name");
>
> I want that when user mouseOver the title of nameColumn it will trigger 
> methodX
>
> The table.addCellPreviewHandler only works for the cell inside the table 
> not for the Title or header of the column
>
> table.addCellPreviewHandler(new Handler>(){
>
> @Override
> public void onCellPreview(
> CellPreviewEvent> event) {
>
> if ("mouseover".equals(event.getNativeEvent().getType())) {
> int col=event.getColumn();
> int row=event.getIndex();
> //call sthing here
> }
> });
>
> is there any simple method like table.addCellPreviewHandler that help me 
> to solve my problem? I don't like custom Header or custom column?
>
>
> http://stackoverflow.com/questions/24187482/is-there-any-way-to-trigger-a-method-when-users-mouse-over-the-title-of-a-column
>

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


is there any way to trigger a method when users mouse over the Title of a column in GWT-CellTable?

2014-06-12 Thread Tom
 

Ok, I have a CellTable CellTable> table = new 
CellTable>();

& a nameColumn IndexedColumn nameColumn=new IndexedColumn(0)

then table.addColumn(nameColumn, "Name");

I want that when user mouseOver the title of nameColumn it will trigger 
methodX

The table.addCellPreviewHandler only works for the cell inside the table 
not for the Title or header of the column

table.addCellPreviewHandler(new Handler>(){

@Override
public void onCellPreview(
CellPreviewEvent> event) {

if ("mouseover".equals(event.getNativeEvent().getType())) {
int col=event.getColumn();
int row=event.getIndex();
//call sthing here
}
});

is there any simple method like table.addCellPreviewHandler that help me to 
solve my problem? I don't like custom Header or custom column?

http://stackoverflow.com/questions/24187482/is-there-any-way-to-trigger-a-method-when-users-mouse-over-the-title-of-a-column

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


Re: How to change this design so that when the ScrollBar of a ScrollPanel got scrolled it will always show the 3rd panel in GWT?

2014-06-09 Thread Tom
Thax you for ur hint, so I won't ensureVisible(panel3)

Instead, I put panel3 outside ScrollPanel,now the panel3 stand 
independently from scrollpanel

On Tuesday, June 10, 2014 2:33:24 AM UTC+10, Jens wrote:
>
> You don't want to call ensureVisible() inside an onScroll callback...that 
> looks pretty weird.
>
> What concrete use case to you want to solve? Maybe CSS position:fixed is 
> what you want?
>
> -- 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/d/optout.


How to change this design so that when the ScrollBar of a ScrollPanel got scrolled it will always show the 3rd panel in GWT?

2014-06-09 Thread Tom
 

Ok, here is my current design, I have 3 panels inside a Grid & the Grid is 
inside a ScrollPanel. I want that when the ScrollBar of the ScrollPanel got 
scrolled it will always show the 3rd panel.

Grid myGrid=new Grid(1,3);
myGrid.getCellFormatter().setVerticalAlignment(0, 0, 
HasVerticalAlignment.ALIGN_TOP);
myGrid.getCellFormatter().setVerticalAlignment(0, 1, 
HasVerticalAlignment.ALIGN_TOP);
myGrid.getCellFormatter().setVerticalAlignment(0, 2, 
HasVerticalAlignment.ALIGN_TOP);
myGrid.setWidget(0,0,panel1);
myGrid.setWidget(0,1,panel2);
myGrid.setWidget(0,2,panel3);
//normally the Panel 1 & 2 is much longer than panel3
final ScrollPanel myScrollPanel=new ScrollPanel();
myScrollPanel.add(myGrid);
myScrollPanel.addScrollHandler(new ScrollHandler(){

@Override
public void onScroll(ScrollEvent event) {

 myScrollPanel.ensureVisible(panel3);
}

});

Ok, when i scroll the scrollbar of the myScrollPanel down to see the bottom 
gui of panel2, it always show the panel3, that is correct but i couldn't 
see the bottom gui of panel2 since the system forced to visible the panel3 
all the time.

SO do you have any solution for this problem? maybe design differently?

http://stackoverflow.com/questions/24124247/how-to-change-this-design-so-that-when-the-scrollbar-of-a-scrollpanel-got-scroll

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


So GWT 2.6 fixed the bug "When clicking on an item in a tree, it makes the vertical scroll bar jump up" in GWT 2.5, did it?

2014-06-07 Thread Tom
Ok, about 8 months ago, I used Gwt 2.5 & got this problem.

The problem is that when I click on an item in a tree that is located 
inside a scrollpanel, it makes the vertical scroll bar jump up. See my 
question 
http://stackoverflow.com/questions/19131318/when-click-on-an-item-in-a-tree-it-makes-the-vertical-scroll-bar-jump-up


A man suggested me a hacking code to fix that bug.

Tree testTree=new Tree(){

public void onBrowserEvent(Event event) {
if (DOM.eventGetType(event) == Event.ONCLICK) {

return;
}

if (DOM.eventGetType(event) == Event.ONMOUSEDOWN) {
//int s = scrollPanel.getVerticalScrollPosition();
int scrollLeftInt = Window.getScrollLeft();
int scrollTopInt = Window.getScrollTop();
DOM.setStyleAttribute(this.getElement(), "position",
"fixed");
super.onBrowserEvent(event);
DOM.setStyleAttribute(this.getElement(), "position",
"static");

//scrollPanel.setVerticalScrollPosition(s);
Window.scrollTo(scrollLeftInt,scrollTopInt);
return;
}

super.onBrowserEvent(event);
}

};


Now recently I have just install the GWT2.6 & when clicking on the item it 
seems ok but it has just a little bit of shaking (only happened in IE not 
in CHrome). FOr a normal users this is not a big issue but for a very picky 
person they will not be very happy. So I removed the hacking code & it's 
seem to be ok in IE or Chrome.

So I assumed that Google fixed that bug.But i want to make sure if Google 
actually fixed that bug so that I can remove the hacking code completely.

Can anyone answer me if Google fixed that bug?

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


Re: Why tag was not parsed inside custom HTMLColumn in GWT?

2014-06-06 Thread Tom
Thax you Jens, it's fase data only vip can input html

On Friday, June 6, 2014 9:15:14 PM UTC+10, Jens wrote:
>
> SafeHtml.asString() escapes HTML entities to secure you from XSS attacks, 
> thats the point of using it. In your example, if your  should not be 
> escaped you must create a SafeHtml instance using
>
> SafeHtmlBuilder b = ..
> b.appendEscaped("car");
> b.appendHtmlConstant("");
> b.appendEscaped("bike");
>
> OR
>
> SafeHtmlUtils.fromTrustedString("carbike") if you can make sure that 
> no one can potentially insert evil things into the string as this method 
> doesn't escape anything.
>
> -- 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/d/optout.


Why tag was not parsed inside custom HTMLColumn in GWT?

2014-06-06 Thread Tom
 

Ok, I have a HTML column which should parse any textcell that contain html 
tag into HTML value:

public class HTMLColumn extends Column, String>{
public HTMLColumn(){
  super(new ClickableTextCell(){
public void render(Context context, 
   SafeHtml value, 
   SafeHtmlBuilder sb)
{
//String text="";
if(value!=null){
//text=value.asString();
sb.appendHtmlConstant("");
sb.appendHtmlConstant(""+value.asString()+"");
sb.appendHtmlConstant("");
}

}   
   });
}
}

ok, when testing with the text contain carbike, i can see the whole 
text got bold so sb.appendHtmlConstant seem to be ok, but it did not make 
the bike to be in new line. It rendered the text like this: bold carbike
.

That mean  was not parsed.

Is this the css problem or something happened?

http://stackoverflow.com/questions/24080177/why-br-tag-was-not-parsed-inside-custom-htmlcolumn-in-gwt

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


Re: In order to make the url bookmarkable, sometimes we need long parameters but IE max url length is only about 2000, How to deal with it?

2014-06-06 Thread Tom
the checkbox info is not too important to a level that I need to store them 
into DB. For example, 3 checkboxes were checked to show the last revenues 
in 3 years... If the check boxes were not checked then user can still 
figure out & can check by themselves. But if the url can tell exactly which 
checkboxes were checked then the user experience is a little better but not 
the most necessary.


On Friday, June 6, 2014 7:58:45 PM UTC+10, Jens wrote:
>
> let imagine this app, u have a page that have lot of checkboxes & users 
>> may click 5,10 or more checkboxes randomly, & last time when user visit the 
>> page they should be able to see exactly the number checkboxed that was 
>> checked in the exact locations that they did last time. For example, user 
>> select 10 checkboxes in an url & 10 years later if they visit the same url 
>> they still can be able to see 10 checkboxed were checked at the exact 
>> positions that the user set 10 years ago. There is no way to use session or 
>> state objects in the situation like that.
>>
>
> Well then you have to store it into the DB. Honestly I can not imagine why 
> you should not save it to DB as these checkbox selections seem to have a 
> meaning important to you and you don't want to loose that selection.
>
> When you store it in a DB then your URL would just have a (possibly 
> encrypted) Database ID that allows you to fetch the information when you 
> load the URL fresh.
>
> -- 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/d/optout.


Re: In order to make the url bookmarkable, sometimes we need long parameters but IE max url length is only about 2000, How to deal with it?

2014-06-06 Thread Tom
Other solution is encoding.

Can we build an encoding system that can encode 
121212_465465_5456456_321513_21231_5341313..long list of number... into a 
very short number like HUFG545? 

then we just build the encoding system at the client & the system just take 
the encoded param from url & decode into the param strings.

If we can have an encoding system like that then it could be a better 
choice than storing params in DB?

On Friday, June 6, 2014 7:29:51 PM UTC+10, Thomas Broyer wrote:
>
>
>
> On Friday, June 6, 2014 6:16:23 AM UTC+2, Tom wrote:
>>
>> we need a lot of parameter for our gwt app for handling the history, if 
>> the url length is limited then the GWT history function also got limited, 
>>
>
> Be careful not to confuse "state" and "history": if you have that many 
> parameters, I suppose that you're storing not only the current state of the 
> "screen" but also the steps that led to there (e.g. which was the previous 
> screen so there can be a "return to X" button). IMO, you shouldn't store 
> those in the URL but just keep them in memory in your app, and choose a 
> default behavior (choose a default for the "return to X" button, or not 
> displaying that button at all) when you load the URL "fresh".
> You could possibly store some state in cookies or localStorage, but then 
> you run the risk that this state is not in sync with the URL that's being 
> loaded, and will have to cope with it.
>  
>
>> can we have other solution like storing the url parameter in Database?
>>
>
> Hey you can always send all the parameters to your server to get a "short 
> URL" (store data in DB and get an identifier in exchange, and use that 
> identifier in the URL), but that also means you'll need to ask the server 
> for the parameters corresponding to the ID form the URL, and decide on when 
> to "expire" that data to free some DB/disk space on the server.
>
> I don't know your application, but I think if you have that many 
> parameters, then you have a design issue to begin with.
>

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


Re: In order to make the url bookmarkable, sometimes we need long parameters but IE max url length is only about 2000, How to deal with it?

2014-06-06 Thread Tom
Sorry i did not state my app clearly, but generally it likes this:

let imagine this app, u have a page that have lot of checkboxes & users may 
click 5,10 or more checkboxes randomly, & last time when user visit the 
page they should be able to see exactly the number checkboxed that was 
checked in the exact locations that they did last time. For example, user 
select 10 checkboxes in an url & 10 years later if they visit the same url 
they still can be able to see 10 checkboxed were checked at the exact 
positions that the user set 10 years ago. There is no way to use session or 
state objects in the situation like that.

If we store the parameters in the cookies but the cookies won't last 
forever? 
or store all these checkbox info into DB?--> then each time user checks a 
checkbox then we need to update DB??  besides it can make the DB biggers & 
slower for such a simple task.

Can u find a soluution that we don't need to store into DB but still can 
handle that situation since it is not the most critical function so we 
should not put too much resource for it?



On Friday, June 6, 2014 7:29:51 PM UTC+10, Thomas Broyer wrote:
>
>
>
> On Friday, June 6, 2014 6:16:23 AM UTC+2, Tom wrote:
>>
>> we need a lot of parameter for our gwt app for handling the history, if 
>> the url length is limited then the GWT history function also got limited, 
>>
>
> Be careful not to confuse "state" and "history": if you have that many 
> parameters, I suppose that you're storing not only the current state of the 
> "screen" but also the steps that led to there (e.g. which was the previous 
> screen so there can be a "return to X" button). IMO, you shouldn't store 
> those in the URL but just keep them in memory in your app, and choose a 
> default behavior (choose a default for the "return to X" button, or not 
> displaying that button at all) when you load the URL "fresh".
> You could possibly store some state in cookies or localStorage, but then 
> you run the risk that this state is not in sync with the URL that's being 
> loaded, and will have to cope with it.
>  
>
>> can we have other solution like storing the url parameter in Database?
>>
>
> Hey you can always send all the parameters to your server to get a "short 
> URL" (store data in DB and get an identifier in exchange, and use that 
> identifier in the URL), but that also means you'll need to ask the server 
> for the parameters corresponding to the ID form the URL, and decide on when 
> to "expire" that data to free some DB/disk space on the server.
>
> I don't know your application, but I think if you have that many 
> parameters, then you have a design issue to begin with.
>

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


Re: In order to make the url bookmarkable, sometimes we need long parameters but IE max url length is only about 2000, How to deal with it?

2014-06-05 Thread Tom
we need a lot of parameter for our gwt app for handling the history, if the 
url length is limited then the GWT history function also got limited, 

can we have other solution like storing the url parameter in Database?

On Friday, June 6, 2014 10:19:32 AM UTC+10, Juan Pablo Gardella wrote:
>
> Check at: 
> http://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers
>
> It seems handling long URLs may be is an application mistake. If it is not 
> possible use shorter URL, tried to compress it or something like that.
>
> Regards,
> Juan
>
>
> 2014-06-05 21:02 GMT-03:00 Tom >:
>
>>  This is serious problem.
>>
>> In GWT, making your url bookmarkable is important. Thus we may have a 
>> very long parameter in the url, but IE can only handle url length that is 
>> about 2000 characters or less.
>>
>> So a url can work ok in Chrome but when ran under IE it got chopped off & 
>> thus will corrupt the parameter.
>>
>> So, do you have any idea how to deal with it?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Google Web Toolkit" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-web-toolkit+unsubscr...@googlegroups.com .
>> To post to this group, send email to google-we...@googlegroups.com 
>> .
>> Visit this group at http://groups.google.com/group/google-web-toolkit.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

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


In order to make the url bookmarkable, sometimes we need long parameters but IE max url length is only about 2000, How to deal with it?

2014-06-05 Thread Tom
 

This is serious problem.

In GWT, making your url bookmarkable is important. Thus we may have a very 
long parameter in the url, but IE can only handle url length that is about 
2000 characters or less.

So a url can work ok in Chrome but when ran under IE it got chopped off & 
thus will corrupt the parameter.

So, do you have any idea how to deal with it?

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


How to fix the conflict between mySuggestBox.addKeyDownHandler & mySuggestBox.addSelectionHandler in GWT?

2014-06-04 Thread Tom
 

I have a SuggestBox. I want 2 things:

-1st, when user Type in a word if the SuggestOracle suggest any word & then 
if i select that word by hitting the Enter key on the selected word or 
clicking on that word it will call a methodX

-2st, suppose I typed a word into a suggest & SuggestOracle suggests NO 
word, then I want that when I hit Enter key it will fire methodX

This below code met the 1st requirement.

getView().getSuggestBox().addSelectionHandler(new SelectionHandler(){

@Override
public void onSelection(SelectionEvent event) {


methodX();
}

});

This below code met the 2nd requirement.

  getView().getSuggestBox().addKeyDownHandler(new KeyDownHandler(){
@Override
public void onKeyDown(KeyDownEvent event) {

if(event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
methodX();
}
}

});

However, if i use both of them, then I got this problem.

FOr example, When I type "car" the suggest oracle show "car insurance" "car 
buy" & then when I use arrow down key to select "car buy" & hit the Enter 
key, then the system call methodX("car"); not "methodX("car buy")"

WHat is the problem? I think they got conflict or something

How to fix it?


http://stackoverflow.com/questions/24044055/how-to-fix-the-conflict-between-mysuggestbox-addkeydownhandler-mysuggestbox-ad

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


Re: How to fire an event when Cookies has just expired in GWT?

2014-05-31 Thread Tom


I found a solution

 

Timer showLoginPanelTimer = new Timer() {
  public void run() {

  getView().getLoginPanel().setVisible(true);
  getView().getSuccessfulLoginPanel().setVisible(false);
  getView().getEmailBox().setText("");
  getView().getPasswordBox().setText("");
  Utility.removeUserInfoCookies();
  }
 };


showLoginPanelTimer.schedule(Utility.COOKIE_TIMEOUT);


On Saturday, May 31, 2014 3:20:14 PM UTC+10, Tom wrote:
>
> Ok, here is the requirement.
>
> I want to build a system look like this:
>
> - Header: have a PleaseLoginPanel and SuccessfulLoginPanel
> - Content Page just contains content & communicate with header via EventBuss
> - HeaderPresenter is the parent presenter & ContentPresenter is nested inside 
> the Header presenter.
>
> Let say when user opens this url "mydomain#content" they will see a page 
> that has header contaning PleaseLoginPanel on top & a content part 
> (beneath the header) contaning some textarea and button for user to input 
> data and submit to DB . 
>
> To be able to access the widget in content page the user need to login, 
> after logged in, the PleaseLoginPanel will be invisible and the 
> SuccessfulLoginPanel will be visible. User now can play with widgets in 
> content part.
>
> Let say Session & Cookies will last 1 hour, after the session cookies 
> expired the user can not submit the content data. 
>
> Let say user spent a lot of efforts to prepare data & about to submit but 
> the session expired so he can't submit. At that time, in the header the 
> SuccessfulLoginPanel still stay there. So the user can lose all his 
> content he prepared before. You may say, he can open a new page & login & 
> copy the data from the old page (the page that has session expired & does 
> not have PleaseLoginPanel), but that still cost him a lot of effort to 
> copy over.
>
> So I want that, when the Cookes has just expired it will fire an Event to 
> the Header & ask the header to show the PleaseLoginPanel
>
> How can we do that in GWT or GWTP?
>

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


How to fire an event when Cookies has just expired in GWT?

2014-05-30 Thread Tom
 

Ok, here is the requirement.

I want to build a system look like this:

- Header: have a PleaseLoginPanel and SuccessfulLoginPanel
- Content Page just contains content & communicate with header via EventBuss
- HeaderPresenter is the parent presenter & ContentPresenter is nested inside 
the Header presenter.

Let say when user opens this url "mydomain#content" they will see a page 
that has header contaning PleaseLoginPanel on top & a content part (beneath 
the header) contaning some textarea and button for user to input data and 
submit to DB . 

To be able to access the widget in content page the user need to login, 
after logged in, the PleaseLoginPanel will be invisible and the 
SuccessfulLoginPanel will be visible. User now can play with widgets in 
content part.

Let say Session & Cookies will last 1 hour, after the session cookies 
expired the user can not submit the content data. 

Let say user spent a lot of efforts to prepare data & about to submit but 
the session expired so he can't submit. At that time, in the header the 
SuccessfulLoginPanel still stay there. So the user can lose all his content 
he prepared before. You may say, he can open a new page & login & copy the 
data from the old page (the page that has session expired & does not have 
PleaseLoginPanel), but that still cost him a lot of effort to copy over.

So I want that, when the Cookes has just expired it will fire an Event to 
the Header & ask the header to show the PleaseLoginPanel

How can we do that in GWT or GWTP?

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


Re: Why GWT app didn't fire when users click on the href link that have the domain that is the same as host domain?

2014-05-28 Thread Tom
I am using GWTP i don't know what u mean

On Wednesday, May 28, 2014 6:00:21 PM UTC+10, Davide Micheletti wrote:
>
> or better which type of method did you use to GET the id
>
>
> On Wed, May 28, 2014 at 9:54 AM, Davide Micheletti 
> 
> > wrote:
>
>> which type of reload did you use?
>>
>>
>> On Wed, May 28, 2014 at 9:08 AM, Tom >wrote:
>>
>>> I am using GWTP
>>>
>>> Here is the problem
>>>
>>> I have a customer page like this 
>>> http://127.0.0.1:/MyProject.html?gwt.codesvr=127.0.0.1:9997#!cust;custID=1
>>>
>>> Suppose I have this code:
>>>
>>> InlineHTML myLink=new InlineHTML("http://car.com"; > car  ");
>>>
>>> When clicking on car link it went to car page.
>>>
>>> Ok, now I have other InlineHTML
>>>
>>> InlineHTML myLink=new InlineHTML("http://127.0.0.1:
>>> /MyProject.html?gwt.codesvr=127.0.0.1:9997#!cust;custID=2\ 
>>> <http://127.0.0.1:9997#!cust;custID=2%5C>" > cust2  ");
>>>
>>> When clicking on cust2, the url changed from #!cust;custID=1 to 
>>> #!cust;custID=2 & just stayed there, it did not refresh the whole page 
>>> or fire the page as It did in the "car" link example.
>>>
>>> I have not deployed my app with a real domain yet, but I think GWT app 
>>> will not fire when users click on the href link that have the domain that 
>>> is the same as host domain.
>>>
>>> How to fix this simple issue?
>>>
>>>
>>>
>>> http://stackoverflow.com/questions/23904871/why-gwt-app-didnt-fire-when-users-click-on-the-href-link-that-have-the-domain-t
>>>  
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Google Web Toolkit" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to google-web-toolkit+unsubscr...@googlegroups.com
>>> .
>>> To post to this group, send email to 
>>> google-we...@googlegroups.com
>>> .
>>> Visit this group at http://groups.google.com/group/google-web-toolkit.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>

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


Why GWT app didn't fire when users click on the href link that have the domain that is the same as host domain?

2014-05-28 Thread Tom
 

I am using GWTP

Here is the problem

I have a customer page like this 
http://127.0.0.1:/MyProject.html?gwt.codesvr=127.0.0.1:9997#!cust;custID=1

Suppose I have this code:

InlineHTML myLink=new InlineHTML("http://car.com"; > car  ");

When clicking on car link it went to car page.

Ok, now I have other InlineHTML

InlineHTML myLink=new InlineHTML("http://127.0.0.1:
/MyProject.html?gwt.codesvr=127.0.0.1:9997#!cust;custID=2\" > cust2  ");

When clicking on cust2, the url changed from #!cust;custID=1 to 
#!cust;custID=2 & just stayed there, it did not refresh the whole page or 
fire the page as It did in the "car" link example.

I have not deployed my app with a real domain yet, but I think GWT app will 
not fire when users click on the href link that have the domain that is the 
same as host domain.

How to fix this simple issue?


http://stackoverflow.com/questions/23904871/why-gwt-app-didnt-fire-when-users-click-on-the-href-link-that-have-the-domain-t

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


Re: Hi Ajax experts, can Google spider read the content of Ajax app (that does not have any code to to make it Crawlable) by itself?

2014-05-21 Thread Tom
Thank you very much for your answer. This is quite new, I will test it.

On Wednesday, May 21, 2014 12:17:44 PM UTC+10, Joseph Lust wrote:
>
> I misspoke, *Fetch As Google *will show you the HTML and request headers, 
> what I was thinking of was *Labs > Instant Previews*
>
>  
>
> In the example below you can see the rendered subpage of the site that is 
> totally AJAX driven:
>
>
> 
>
>
>  
>
> And the renderings below. These thumbnails appear other places in GWDT as 
> well:
>
>
> 
>
> So, this indicates to me that GWTP works out of the box, without need for 
> a crawler servlet. I'd also note that when a client called me, irate that 
> the yet to be launched site's pages were appearing on Google, it was 
> another indicator that they were rendering JS based pages serverside 
> (robots.txt fixed that).
>
>
> Hope that helps.
>
>
> 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/d/optout.


Re: Hi Ajax experts, can Google spider read the content of Ajax app (that does not have any code to to make it Crawlable) by itself?

2014-05-19 Thread Tom
did u implement Crawl Filter for your GWTP?

do u have these lines in your Guice package?

bindConstant().annotatedWith(ServiceKey.class).to("123456");

bindConstant().annotatedWith(ServiceUrl.class).to("http://crawlservice.appspot.com/";);
filter("/*").through(CrawlFilter.class);



On Monday, May 19, 2014 10:14:21 PM UTC+10, Joseph Lust wrote:
>
> Tom,
>
> To assuage your healthy skepticism, get a Googlw Webmaster Tools account, 
> add your site, and then use the* Crawl > Fetch as Google option*. I am 
> able to feed it my GWT home page and sub pages (based on history tokens in 
> the URL) and the returned page is the page as expected, filled with the 
> expected content. Check it out for yourself.
>
> As to cloaking, I'm not sure what Google does. The obvious step would be 
> to intermittently visit the page with a user agent / IP block that was not 
> identifiable as GoogleBot. Then correlate those results with the results 
> received when you really were the declared GoogleBot, and if there was a 
> notable dependency flag and blacklist the site. However, this would mean 
> agent misrepresentation and potentially going against the robots.txt, which 
> would potentially be *evil* and not something Google would do openly. 
> Probably it would make more sense for higher traffic sites that are flagged 
> for a higher risk of spam/malware by other heuristics. 
>
> 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/d/optout.


Re: Hi Ajax experts, can Google spider read the content of Ajax app (that does not have any code to to make it Crawlable) by itself?

2014-05-19 Thread Tom
i did use web master tool, but seem Google can not index gwtp page. They 
can index the home page, ie i can see text in home page when searching 
"site:mydomain.com" but it didn't show other sub pages.

On Monday, May 19, 2014 10:14:21 PM UTC+10, Joseph Lust wrote:
>
> Tom,
>
> To assuage your healthy skepticism, get a Googlw Webmaster Tools account, 
> add your site, and then use the* Crawl > Fetch as Google option*. I am 
> able to feed it my GWT home page and sub pages (based on history tokens in 
> the URL) and the returned page is the page as expected, filled with the 
> expected content. Check it out for yourself.
>
> As to cloaking, I'm not sure what Google does. The obvious step would be 
> to intermittently visit the page with a user agent / IP block that was not 
> identifiable as GoogleBot. Then correlate those results with the results 
> received when you really were the declared GoogleBot, and if there was a 
> notable dependency flag and blacklist the site. However, this would mean 
> agent misrepresentation and potentially going against the robots.txt, which 
> would potentially be *evil* and not something Google would do openly. 
> Probably it would make more sense for higher traffic sites that are flagged 
> for a higher risk of spam/malware by other heuristics. 
>
> 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/d/optout.


Re: Can you tell me Step-By-Step Guidelines of How to use HtmlUnit to make GWT app Crawlable?

2014-05-17 Thread Tom
seem they can read only static data, not dynamic data taken from DB. 
Ex, in your GWTP page, if u have *label.setText("my text");* then Google 
can read "*my text*".

However, if you do like this, 

String text=getDataFromDB(); // getDataFromDB() uses RPC call, 

//suppose getDataFromDB() return "my text"

label.setText(text); // then Google can't read text.

Id Google can be able to read the dynamic data then they should announce 
their achievement to public, but I found no such announcement on the 
internet.


On Sunday, May 18, 2014 4:47:11 AM UTC+10, Joseph Lust wrote:
>
> FWIW, I've had Google crawling my GWTP based sites without a problem, and 
> I've added no such servlet. I think they've figured out how to do the JS 
> evaluation on their side. Using Googles Web Developer tools, they request 
> and display my page and sub pages just fine and they're all GWT.
>

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


How to program at client side to get Html Snapshot (or to capture all texts) of entire GWT page?

2014-05-17 Thread Tom
 

To let you understand what I want, please read this:

Suppose you have a GWT page (mydomain.com#!article). That page contain many 
widgets and data downloaded from DB. The DB data & the widgets are mixed 
into each other, for example a label can hold Customer Name (customer name 
came from DB). 

So, everything on that page is javascript, ie when you view source you can 
only see Javascript. However, if you open that GWT page in Chrome & save it 
as "myGwtArticlePage.htm" into your local PC, then reopen the "
myGwtArticlePage.htm", you can see that all the text, widgets... in "
myGwtArticlePage.htm" is exactly the same as the ones in "
mydomain.com#!article".

Now, you right-click & view-source of "myGwtArticlePage.htm", you will see 
not just Javascript but all text, & Db data & widget still in there.

So, the "myGwtArticlePage.htm" is called the Html Snapshot of the "
mydomain.com#!article". 

Are you Clear?

Now I want program at client side to be able to capture all texts of "
myGwtArticlePage.htm".

So, MyArticlePresenter.java (in Client package) should work like this:

private AsyncCallback getArticleCallback=new 
AsyncCallback(){
@Override
public void onSuccess(GetArticleResult result) {
String articleData=result.getArticleData;
//... many other data from DB .

myLabel.setText(articleData);
//... many other widgets that setText of the DB data 

// Now what I should do here to get Html Snapshot of 
"`mydomain.com#!article`" ??

}
}

Note: people say that I can use HTMLUnit, but HtmlUnit work at server not 
at client package. Besides, HTMLUnit couldn't parse GWTP page properly. 
GWTP is GWT app buit under GWTP framework.

I hope someone can help me to ask this question.

http://stackoverflow.com/questions/23718282/how-to-program-at-client-side-to-get-html-snapshot-or-to-capture-all-texts-of

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


Hi Ajax experts, can Google spider read the content of Ajax app (that does not have any code to to make it Crawlable) by itself?

2014-05-17 Thread Tom
 

I remembered that about 1 or 2 years ago, I read an article in which it 
said that "in the future, Google Spider will be able to read the text in 
any Ajax app. That mean we don't even need to make our GWT App crawlable. 
Google did it for us." (1)

But, before the above thing (1) happened, to make Gwt App crawlable, you 
have to use HTMLUnit or other techniques to create another layer for Google 
spider to read the text of your Ajax app. That is not easy.

By the way, bad people can take advantages of that to fool the google by 
doing cloaking or something like that. That is not not what Google want.

Surprisingly, today, I heard someone said that his GWTP app can be seen by 
Google without any problem & he didn't use any technique to make his app 
crawlable. 

I did some tests & seem he is right, but I am not sure 100% that is true.

So, just ask you that:

Can Google spider read the content of Ajax app (that does not have any code 
to to make it Crawlable) by itself?

If that is true then that is awesome! or i could be wrong??

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


Re: Can you tell me Step-By-Step Guidelines of How to use HtmlUnit to make GWT app Crawlable?

2014-05-17 Thread Tom
Man, seem you are right.

On Sunday, May 18, 2014 4:47:11 AM UTC+10, Joseph Lust wrote:
>
> FWIW, I've had Google crawling my GWTP based sites without a problem, and 
> I've added no such servlet. I think they've figured out how to do the JS 
> evaluation on their side. Using Googles Web Developer tools, they request 
> and display my page and sub pages just fine and they're all GWT.
>

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


Re: Can you tell me Step-By-Step Guidelines of How to use HtmlUnit to make GWT app Crawlable?

2014-05-17 Thread Tom
So u mean u don't even need to HtmlUnit to do that? can u show me your rela 
life website ?

On Sunday, May 18, 2014 4:47:11 AM UTC+10, Joseph Lust wrote:
>
> FWIW, I've had Google crawling my GWTP based sites without a problem, and 
> I've added no such servlet. I think they've figured out how to do the JS 
> evaluation on their side. Using Googles Web Developer tools, they request 
> and display my page and sub pages just fine and they're all GWT.
>

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


Re: Can you tell me Step-By-Step Guidelines of How to use HtmlUnit to make GWT app Crawlable?

2014-05-17 Thread Tom
did u see the text after HtmlUnit rendered the page? or u just see 
javascript code only?

Can you post your code?

On Sunday, May 18, 2014 4:47:11 AM UTC+10, Joseph Lust wrote:
>
> FWIW, I've had Google crawling my GWTP based sites without a problem, and 
> I've added no such servlet. I think they've figured out how to do the JS 
> evaluation on their side. Using Googles Web Developer tools, they request 
> and display my page and sub pages just fine and they're all GWT.
>

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


Re: Why HTMLUnit always shows the HostPage no matter what url I type in (Crawlable GWT APP)?

2014-05-16 Thread Tom
I also tried the gwtplatform Craw solution, very simple
Just add these lines into DispatchServletModule in .server.guice

*bindConstant().annotatedWith(CachedPageTimeoutSec.class).to(3600);*
* bindConstant().annotatedWith(ServiceKey.class).to("123456");*
*   
 bindConstant().annotatedWith(ServiceUrl.class).to("http://localhost:8080/";);*
*filter("/*").through(CrawlFilter.class);*

and again, no matter what i typed it always showed the home page.

What is going on? I don't understand.

On Friday, May 16, 2014 10:13:28 PM UTC+10, Jens wrote:
>
> I already said that you have to compile your app because HtmlUnit does not 
> have a GWT DevMode browser plugin. HtmlUnit can only execute your app if it 
> is fully compiled to JavaScript. Open 
> http://127.0.0.1:/Myproject.html#!article in your browser and you 
> will see the same page that HtmlUnit generates because your app will not be 
> executed if it is not fully compiled.
>
> Also please stop creating new threads for essentially the same problem, 
> otherwise I tend to report you as spamming.
>
> -- 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/d/optout.


Re: Why HTMLUnit always shows the HostPage no matter what url I type in (Crawlable GWT APP)?

2014-05-16 Thread Tom
i compiled & I got the same problem.

On Friday, May 16, 2014 10:13:28 PM UTC+10, Jens wrote:
>
> I already said that you have to compile your app because HtmlUnit does not 
> have a GWT DevMode browser plugin. HtmlUnit can only execute your app if it 
> is fully compiled to JavaScript. Open 
> http://127.0.0.1:/Myproject.html#!article in your browser and you 
> will see the same page that HtmlUnit generates because your app will not be 
> executed if it is not fully compiled.
>
> Also please stop creating new threads for essentially the same problem, 
> otherwise I tend to report you as spamming.
>
> -- 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/d/optout.


Why HTMLUnit always shows the HostPage no matter what url I type in (Crawlable GWT APP)?

2014-05-16 Thread Tom
Here is the full code

public class CrawlServlet implements Filter{
 public static String getFullURL(HttpServletRequest request) {
StringBuffer requestURL = request.getRequestURL();
String queryString = request.getQueryString();


if (queryString == null) {
return requestURL.toString();
} else {
return requestURL.append('?').append(queryString).toString();
}
 }
 
 @Override
 public void destroy() {
 // TODO Auto-generated method stub
 
 }
 
 @Override
 public void doFilter(ServletRequest request, ServletResponse response,
 FilterChain chain) throws IOException, ServletException {

 HttpServletRequest httpRequest = (HttpServletRequest) request;
 String fullURLQueryString = getFullURL(httpRequest);
 System.out.println(fullURLQueryString+" what wrong");

 if ((fullURLQueryString != null) && (fullURLQueryString.contains(
"_escaped_fragment_"))) {
 // remember to unescape any %XX characters
 fullURLQueryString=URLDecoder.decode(fullURLQueryString,"UTF-8");
 // rewrite the URL back to the original #! version
 String url_with_hash_fragment=fullURLQueryString.replace(
"?_escaped_fragment_=", "#!");
 
   
 final WebClient webClient = new WebClient();

 WebClientOptions options = webClient.getOptions();
 options.setCssEnabled(false);
 options.setThrowExceptionOnScriptError(false);
 options.setThrowExceptionOnFailingStatusCode(false);
 options.setJavaScriptEnabled(false);
 HtmlPage page = webClient.getPage(url_with_hash_fragment);

 // important!  Give the headless browser enough time to execute 
JavaScript
 // The exact time to wait may depend on your application.
 
 webClient.waitForBackgroundJavaScript(2);
 
 // return the snapshot
 //String originalHtml=page.getWebResponse().getContentAsString();
 //System.out.println(originalHtml+" +");
 System.out.println(page.asXml()+" +");
 
 PrintWriter out = response.getWriter();
 out.println(page.asXml());
 //out.println(originalHtml);
 } else {
  try {
// not an _escaped_fragment_ URL, so move up the chain of servlet 
(filters)
chain.doFilter(request, response);
  } catch (ServletException e) {
System.err.println("Servlet exception caught: " + e);
e.printStackTrace();
  }
}
   
 }


 @Override
 public void init(FilterConfig arg0) throws ServletException {
 // TODO Auto-generated method stub
 
 }
 
 
}

After opened the url 
"*http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997?_escaped_fragment_=article
 
*",
 
it showed the Host Page html code like this:













MyProject















Loading









Your web browser must have JavaScript enabled in order for this application 
to display correctly.





On the other hand, 
"*http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997#!article 
*" 
works ok & show article without any problem.

Note: article page is the nested presenter that is embedded inside a header 
presenter. But I don't think that is the main reason cos it didn't even 
show the header page.

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


Why HTMLUnit always shows the HostPage no matter what url I type in (Crawlable GWT APP)?

2014-05-16 Thread Tom
Here is the full code

public class CrawlServlet implements Filter{
 


 public static String getFullURL(HttpServletRequest request) {
StringBuffer requestURL = request.getRequestURL();
String queryString = request.getQueryString();


if (queryString == null) {
return requestURL.toString();
} else {
return requestURL.append('?').append(queryString).toString();
}
 }
 
 @Override
 public void destroy() {
 // TODO Auto-generated method stub
 
 }


 
 
 @Override
 public void doFilter(ServletRequest request, ServletResponse response,
 FilterChain chain) throws IOException, ServletException {
 // TODO Auto-generated method stub
 HttpServletRequest httpRequest = (HttpServletRequest) request;
 String fullURLQueryString = getFullURL(httpRequest);
 System.out.println(fullURLQueryString+" what wrong");

 if ((fullURLQueryString != null) && (fullURLQueryString.contains(
"_escaped_fragment_"))) {
 // remember to unescape any %XX characters
 fullURLQueryString=URLDecoder.decode(fullURLQueryString,"UTF-8");
 // rewrite the URL back to the original #! version
 String url_with_hash_fragment=fullURLQueryString.replace(
"?_escaped_fragment_=", "#!");
 
   
 final WebClient webClient = new WebClient();

 WebClientOptions options = webClient.getOptions();
 options.setCssEnabled(false);
 options.setThrowExceptionOnScriptError(false);
 options.setThrowExceptionOnFailingStatusCode(false);
 options.setJavaScriptEnabled(false);
 HtmlPage page = webClient.getPage(url_with_hash_fragment);

 // important!  Give the headless browser enough time to execute 
JavaScript
 // The exact time to wait may depend on your application.
 
 webClient.waitForBackgroundJavaScript(2);
 
 // return the snapshot
 //String originalHtml=page.getWebResponse().getContentAsString();
 //System.out.println(originalHtml+" +");
 System.out.println(page.asXml()+" +");
 
 PrintWriter out = response.getWriter();
 out.println(page.asXml());
 //out.println(originalHtml);
 } else {
  try {
// not an _escaped_fragment_ URL, so move up the chain of servlet 
(filters)
chain.doFilter(request, response);
  } catch (ServletException e) {
System.err.println("Servlet exception caught: " + e);
e.printStackTrace();
  }
}
   
 }


 @Override
 public void init(FilterConfig arg0) throws ServletException {
 // TODO Auto-generated method stub
 
 }
 
 
}

After opened the url 
"*http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997?_escaped_fragment_=article
 
*",
 
it showed the Host Page html code like this:













MyProject















Loading









Your web browser must have JavaScript enabled in order for this application 
to display correctly.





On the other hand, 
"*http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997#!article 
*" 
works ok & show article without any problem.

Note: article page is the nested presenter that is embedded inside a header 
presenter. But I don't think that is the main reason cos it didn't even 
show the header page.

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


Why HtmlUnit only show the host page of GWT app?

2014-05-16 Thread Tom
Here is the full code

public class CrawlServlet implements Filter{
 


 public static String getFullURL(HttpServletRequest request) {
StringBuffer requestURL = request.getRequestURL();
String queryString = request.getQueryString();


if (queryString == null) {
return requestURL.toString();
} else {
return requestURL.append('?').append(queryString).toString();
}
 }
 
 @Override
 public void destroy() {
 // TODO Auto-generated method stub
 
 }


 
 
 @Override
 public void doFilter(ServletRequest request, ServletResponse response,
 FilterChain chain) throws IOException, ServletException {
 // TODO Auto-generated method stub
 HttpServletRequest httpRequest = (HttpServletRequest) request;
 String fullURLQueryString = getFullURL(httpRequest);
 System.out.println(fullURLQueryString+" what wrong");

 if ((fullURLQueryString != null) && (fullURLQueryString.contains(
"_escaped_fragment_"))) {
 // remember to unescape any %XX characters
 fullURLQueryString=URLDecoder.decode(fullURLQueryString,"UTF-8");
 // rewrite the URL back to the original #! version
 String url_with_hash_fragment=fullURLQueryString.replace(
"?_escaped_fragment_=", "#!");
 
   
 final WebClient webClient = new WebClient();

 WebClientOptions options = webClient.getOptions();
 options.setCssEnabled(false);
 options.setThrowExceptionOnScriptError(false);
 options.setThrowExceptionOnFailingStatusCode(false);
 options.setJavaScriptEnabled(false);
 HtmlPage page = webClient.getPage(url_with_hash_fragment);

 // important!  Give the headless browser enough time to execute 
JavaScript
 // The exact time to wait may depend on your application.
 
 webClient.waitForBackgroundJavaScript(2);
 
 // return the snapshot
 //String originalHtml=page.getWebResponse().getContentAsString();
 //System.out.println(originalHtml+" +");
 System.out.println(page.asXml()+" +");
 
 PrintWriter out = response.getWriter();
 out.println(page.asXml());
 //out.println(originalHtml);
 } else {
  try {
// not an _escaped_fragment_ URL, so move up the chain of servlet 
(filters)
chain.doFilter(request, response);
  } catch (ServletException e) {
System.err.println("Servlet exception caught: " + e);
e.printStackTrace();
  }
}
   
 }


 @Override
 public void init(FilterConfig arg0) throws ServletException {
 // TODO Auto-generated method stub
 
 }
 
 
}

After opened the url "
*http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997?_escaped_fragment_=article*";,
 
it showed the Host Page html code like this:













Ekajati















Loading









Your web browser must have JavaScript enabled in order for this application 
to display correctly.





On the other hand, "
*http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997#!article*"; 
works ok & show article without any problem.

Note: article page is the nested presenter that is embedded inside a header 
presenter. But I don't think that is the main reason cos it didn't even 
show the header page.

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


Re: Can you tell me Step-By-Step Guidelines of How to use HtmlUnit to make GWT app Crawlable?

2014-05-16 Thread Tom
If i open that url in IE then it ask me to provide Plugin, but if I run in 
Chrome, it shows the page like this
This XML file does not appear to have any style information associated with 
it. The document tree is shown below.

..




Buit that is the html code of the homepage (
http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997
#!home) while I opened the article page (
http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997
#!article)

This means that the HtmlUnit works but somehow it couldn't parse the 
article page.

WHy does that happen?

On Friday, May 16, 2014 6:19:09 PM UTC+10, Jens wrote:
>
> I have this code
>>
>>  url_with_hash_fragment="
>> http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997#!home";;
>>
>
> I think you must compile your app to JS. HtmlUnit does not have a DevMode 
> Browser plugin so "?gwt.codesvr=127.0.0.1:9997#!home" is kind of useless.
>
> -- 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/d/optout.


Re: Why do I have java.util.EmptyStackException when using HTMLUnit to render the page via Filter?

2014-05-16 Thread Tom
It seems that after opened the url 
http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997?_escaped_fragment_=article,
 
I can see the Chrome browser show the raw html page like this

This XML file does not appear to have any style information associated with 
it. The document tree is shown below.

..




Buit that is the html code of the homepage (
http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997<http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997?_escaped_fragment_=article>
#!home) while I opened the article page (
http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997<http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997?_escaped_fragment_=article>
#!article)

This means that the HtmlUnit works but somehow it couldn't parse the 
article page.

WHy does that happen?

On Friday, May 16, 2014 3:52:50 PM UTC+10, Tom wrote:
>
> i found this link
>
>
> http://htmlunit.10904.n7.nabble.com/htmlunit-Bugs-1728761-java-util-EmptyStackException-in-webclient-td4900.html
>
> Maybe this causing the problem:
>
> !stack.empy() && stack.peek() .. stack.peek() is the one throwing this 
>> exception. May be that, when the current thread has checked !empty(), 
>> another thread has already consumed the data due to JVM memory model. May 
>> be we need to do in sych?? 
>
>
> Do you think so, if it is the problem, then how to fix it.
>
> On Friday, May 16, 2014 1:52:52 PM UTC+10, Tom wrote:
>>
>> Ok, I have a Filter
>>
>> public class CrawlServlet implements Filter{
>>@Override
>>public void doFilter(ServletRequest request, ServletResponse response,
>> FilterChain chain) throws IOException, ServletException {
>>   HttpServletRequest httpRequest = (HttpServletRequest) request;
>>   String requestQueryString = httpRequest.getQueryString();
>>   if ((requestQueryString != null) && 
>> (requestQueryString.contains("_escaped_fragment_"))) {
>>String 
>> str="http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997#!article";;
>>// this url work fine, if i open it it will show article.
>>final WebClient webClient = new WebClient();
>>HtmlPage page = webClient.getPage(str);
>>PrintWriter out = response.getWriter();
>>out.println(page.asXml());
>>   }
>>
>>}}
>>
>> Ok, now i ran my app in eclipse, & open the url 
>> http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997?_escaped_fragment_=article
>>
>> Then I got this error in eclipse
>>
>> .GWTUpld .gwt-Button:HOVER,
>> .GWTUpld .DecoratedFileUpload .gwt-Button-over,
>> .GWTUpld .DecoratedFileUpload .gwt-Anchor-over,
>> .GWTUpld .DecoratedFileUpload .gwt-Label-over {
>> color: #af6b29;
>> }
>> ..
>> .GWTUpld input[type="file"] {
>> cursor: pointer;
>> }
>>
>>
>> ': null
>> java.util.EmptyStackException
>> at java.util.Stack.peek(Unknown Source)
>> at java.util.Stack.pop(Unknown Source)
>> at 
>> com.steadystate.css.parser.CSSOMParser$CSSOMHandler.endDocument(CSSOMParser.java:271)
>> at 
>> com.steadystate.css.parser.AbstractSACParser.handleEndDocument(AbstractSACParser.java:456)
>> at 
>> com.steadystate.css.parser.SACParserCSS3.styleSheet(SACParserCSS3.java:56)
>> at 
>> com.steadystate.css.parser.AbstractSACParser.parseStyleSheet(AbstractSACParser.java:284)
>> at 
>> com.steadystate.css.parser.SACParserCSS3.parseStyleSheet(SACParserCSS3.java:23)
>> at 
>> com.steadystate.css.parser.CSSOMParser.parseStyleSheet(CSSOMParser.java:146)
>> at 
>> com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleSheet.parseCSS(CSSStyleSheet.java:818)
>> at 
>> com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleSheet.(CSSStyleSheet.java:179)
>> at 
>> com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleSheet.loadStylesheet(CSSStyleSheet.java:321)
>> at 
>> com.gargoylesoftware.htmlunit.javascript.host.html.HTMLLinkElement.getSheet(HTMLLinkElement.java:130)
>> at 
>> com.gargoylesoftware.htmlunit.javascript.host.css.StyleSheetList.item(StyleSheetList.java:151)
>> at 
>> com.gargoylesoftware.htmlunit.javascript.host.Window.getComputedStyle(Window.java:1601)
>> at 
>> com.gargoylesoftware.htmlunit.javascript.host.Element.getCurrentStyle(Element.java:545)
>> at 
>> com.gargoylesoftware.htmlunit.html.DomNode.isDisplayed(DomNod

Re: The crawler escapes “mydomain#!article” into “mydomain?_escaped_fragment_=article”, how to retrieve back the original url?

2014-05-15 Thread Tom
is it ok to do like this

originalUrl=java.net.URLDecoder.decode(originalUrl, "UTF-8");


Which one do we have to use "UTF-8" or "ASCII" ?

So when the crawler escape the url, does it use URL.encode()? 
if it does then which one it uses "UTF-8" or "ASCII"?

On Friday, May 16, 2014 2:49:45 PM UTC+10, Tom wrote:
>
> Ok, here is what Google said (
> https://developers.google.com/webmasters/ajax-crawling/docs/getting-started
> ).
>
> When a crawler sees a url like this www.example.com/ajax.html#!key=value, 
> it will temporarily convert that url into 
> www.example.com/ajax.html?_escaped_fragment_=key=value
>
> However, when doing that it also escapes certain characters in the 
> fragment during the transformation. Ex: 
> www.example.com/ajax.html#!key=value;car=% to 
> www.example.com/ajax.html?_escaped_fragment_=key=value;car=%25
>
> so if we want to convert 
> www.example.com/ajax.html?_escaped_fragment_=key=value;car=%25 back to 
> the original url then we need to unescape all %XX characters in the 
> fragment.
>
> Google said:
>
> Note: The crawler escapes certain characters in the fragment during the 
> transformation. To retrieve the original fragment, make sure to unescape 
> all %XX characters in the fragment. More specifically, %26 should become &, 
> %20 should become a space, %23 should become #, and %25 should become %, 
> and so on.
>
> But google doesn't say How to do that in java.
>
> String originalUrl=changedStr.replace("?_escaped_fragment_=", "!#");// then 
> what to do next so that all the escaped characters will go back to normal?
>
>
> http://stackoverflow.com/questions/23692748/the-crawler-escapes-mydomainarticle-into-mydomain-escaped-fragment-articl
>
>

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


Re: Why do I have java.util.EmptyStackException when using HTMLUnit to render the page via Filter?

2014-05-15 Thread Tom
i found this link

http://htmlunit.10904.n7.nabble.com/htmlunit-Bugs-1728761-java-util-EmptyStackException-in-webclient-td4900.html

Maybe this causing the problem:

!stack.empy() && stack.peek() .. stack.peek() is the one throwing this 
> exception. May be that, when the current thread has checked !empty(), 
> another thread has already consumed the data due to JVM memory model. May 
> be we need to do in sych?? 


Do you think so, if it is the problem, then how to fix it.

On Friday, May 16, 2014 1:52:52 PM UTC+10, Tom wrote:
>
> Ok, I have a Filter
>
> public class CrawlServlet implements Filter{
>@Override
>public void doFilter(ServletRequest request, ServletResponse response,
> FilterChain chain) throws IOException, ServletException {
>   HttpServletRequest httpRequest = (HttpServletRequest) request;
>   String requestQueryString = httpRequest.getQueryString();
>   if ((requestQueryString != null) && 
> (requestQueryString.contains("_escaped_fragment_"))) {
>String 
> str="http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997#!article";;
>// this url work fine, if i open it it will show article.
>final WebClient webClient = new WebClient();
>HtmlPage page = webClient.getPage(str);
>PrintWriter out = response.getWriter();
>out.println(page.asXml());
>   }
>
>}}
>
> Ok, now i ran my app in eclipse, & open the url 
> http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997?_escaped_fragment_=article
>
> Then I got this error in eclipse
>
> .GWTUpld .gwt-Button:HOVER,
> .GWTUpld .DecoratedFileUpload .gwt-Button-over,
> .GWTUpld .DecoratedFileUpload .gwt-Anchor-over,
> .GWTUpld .DecoratedFileUpload .gwt-Label-over {
> color: #af6b29;
> }
> ..
> .GWTUpld input[type="file"] {
> cursor: pointer;
> }
>
>
> ': null
> java.util.EmptyStackException
> at java.util.Stack.peek(Unknown Source)
> at java.util.Stack.pop(Unknown Source)
> at 
> com.steadystate.css.parser.CSSOMParser$CSSOMHandler.endDocument(CSSOMParser.java:271)
> at 
> com.steadystate.css.parser.AbstractSACParser.handleEndDocument(AbstractSACParser.java:456)
> at 
> com.steadystate.css.parser.SACParserCSS3.styleSheet(SACParserCSS3.java:56)
> at 
> com.steadystate.css.parser.AbstractSACParser.parseStyleSheet(AbstractSACParser.java:284)
> at 
> com.steadystate.css.parser.SACParserCSS3.parseStyleSheet(SACParserCSS3.java:23)
> at 
> com.steadystate.css.parser.CSSOMParser.parseStyleSheet(CSSOMParser.java:146)
> at 
> com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleSheet.parseCSS(CSSStyleSheet.java:818)
> at 
> com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleSheet.(CSSStyleSheet.java:179)
> at 
> com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleSheet.loadStylesheet(CSSStyleSheet.java:321)
> at 
> com.gargoylesoftware.htmlunit.javascript.host.html.HTMLLinkElement.getSheet(HTMLLinkElement.java:130)
> at 
> com.gargoylesoftware.htmlunit.javascript.host.css.StyleSheetList.item(StyleSheetList.java:151)
> at 
> com.gargoylesoftware.htmlunit.javascript.host.Window.getComputedStyle(Window.java:1601)
> at 
> com.gargoylesoftware.htmlunit.javascript.host.Element.getCurrentStyle(Element.java:545)
> at 
> com.gargoylesoftware.htmlunit.html.DomNode.isDisplayed(DomNode.java:712)
> at 
> com.gargoylesoftware.htmlunit.WebClient$CurrentWindowTracker.webWindowContentChanged(WebClient.java:1671)
> at 
> com.gargoylesoftware.htmlunit.WebClient.fireWindowContentChanged(WebClient.java:742)
> at 
> com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:440)
> at 
> com.gargoylesoftware.htmlunit.WebClient.loadDownloadedResponses(WebClient.java:2024)
> at 
> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.doProcessPostponedActions(JavaScriptEngine.java:712)
> at 
> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.access$500(JavaScriptEngine.java:92)
> at 
> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:679)
> at 
> net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:602)
> at 
> net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:507)
> at 
> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:616)
> at 
> com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:591)
> at 
> com.gargoyles

The crawler escapes “mydomain#!article” into “mydomain?_escaped_fragment_=article”, how to retrieve back the original url?

2014-05-15 Thread Tom
 

Ok, here is what Google said (
https://developers.google.com/webmasters/ajax-crawling/docs/getting-started
).

When a crawler sees a url like this www.example.com/ajax.html#!key=value, 
it will temporarily convert that url into 
www.example.com/ajax.html?_escaped_fragment_=key=value

However, when doing that it also escapes certain characters in the fragment 
during the transformation. Ex: www.example.com/ajax.html#!key=value;car=%to 
www.example.com/ajax.html?_escaped_fragment_=key=value;car=%25

so if we want to convert 
www.example.com/ajax.html?_escaped_fragment_=key=value;car=%25 back to the 
original url then we need to unescape all %XX characters in the fragment.

Google said:

Note: The crawler escapes certain characters in the fragment during the 
transformation. To retrieve the original fragment, make sure to unescape 
all %XX characters in the fragment. More specifically, %26 should become &, 
%20 should become a space, %23 should become #, and %25 should become %, 
and so on.

But google doesn't say How to do that in java.

String originalUrl=changedStr.replace("?_escaped_fragment_=", "!#");// then 
what to do next so that all the escaped characters will go back to normal?


http://stackoverflow.com/questions/23692748/the-crawler-escapes-mydomainarticle-into-mydomain-escaped-fragment-articl

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


Why do I have java.util.EmptyStackException when using HTMLUnit to render the page via Filter?

2014-05-15 Thread Tom
 

Ok, I have a Filter

public class CrawlServlet implements Filter{
   @Override
   public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
  HttpServletRequest httpRequest = (HttpServletRequest) request;
  String requestQueryString = httpRequest.getQueryString();
  if ((requestQueryString != null) && 
(requestQueryString.contains("_escaped_fragment_"))) {
   String 
str="http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997#!article";;
   // this url work fine, if i open it it will show article.
   final WebClient webClient = new WebClient();
   HtmlPage page = webClient.getPage(str);
   PrintWriter out = response.getWriter();
   out.println(page.asXml());
  }

   }}

Ok, now i ran my app in eclipse, & open the url 
http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997?_escaped_fragment_=article

Then I got this error in eclipse

.GWTUpld .gwt-Button:HOVER,
.GWTUpld .DecoratedFileUpload .gwt-Button-over,
.GWTUpld .DecoratedFileUpload .gwt-Anchor-over,
.GWTUpld .DecoratedFileUpload .gwt-Label-over {
color: #af6b29;
}
..
.GWTUpld input[type="file"] {
cursor: pointer;
}


': null
java.util.EmptyStackException
at java.util.Stack.peek(Unknown Source)
at java.util.Stack.pop(Unknown Source)
at 
com.steadystate.css.parser.CSSOMParser$CSSOMHandler.endDocument(CSSOMParser.java:271)
at 
com.steadystate.css.parser.AbstractSACParser.handleEndDocument(AbstractSACParser.java:456)
at 
com.steadystate.css.parser.SACParserCSS3.styleSheet(SACParserCSS3.java:56)
at 
com.steadystate.css.parser.AbstractSACParser.parseStyleSheet(AbstractSACParser.java:284)
at 
com.steadystate.css.parser.SACParserCSS3.parseStyleSheet(SACParserCSS3.java:23)
at 
com.steadystate.css.parser.CSSOMParser.parseStyleSheet(CSSOMParser.java:146)
at 
com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleSheet.parseCSS(CSSStyleSheet.java:818)
at 
com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleSheet.(CSSStyleSheet.java:179)
at 
com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleSheet.loadStylesheet(CSSStyleSheet.java:321)
at 
com.gargoylesoftware.htmlunit.javascript.host.html.HTMLLinkElement.getSheet(HTMLLinkElement.java:130)
at 
com.gargoylesoftware.htmlunit.javascript.host.css.StyleSheetList.item(StyleSheetList.java:151)
at 
com.gargoylesoftware.htmlunit.javascript.host.Window.getComputedStyle(Window.java:1601)
at 
com.gargoylesoftware.htmlunit.javascript.host.Element.getCurrentStyle(Element.java:545)
at com.gargoylesoftware.htmlunit.html.DomNode.isDisplayed(DomNode.java:712)
at 
com.gargoylesoftware.htmlunit.WebClient$CurrentWindowTracker.webWindowContentChanged(WebClient.java:1671)
at 
com.gargoylesoftware.htmlunit.WebClient.fireWindowContentChanged(WebClient.java:742)
at 
com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:440)
at 
com.gargoylesoftware.htmlunit.WebClient.loadDownloadedResponses(WebClient.java:2024)
at 
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.doProcessPostponedActions(JavaScriptEngine.java:712)
at 
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.access$500(JavaScriptEngine.java:92)
at 
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine$HtmlUnitContextAction.run(JavaScriptEngine.java:679)
at net.sourceforge.htmlunit.corejs.javascript.Context.call(Context.java:602)
at 
net.sourceforge.htmlunit.corejs.javascript.ContextFactory.call(ContextFactory.java:507)
at 
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:616)
at 
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.callFunction(JavaScriptEngine.java:591)
at 
com.gargoylesoftware.htmlunit.html.HtmlPage.executeJavaScriptFunctionIfPossible(HtmlPage.java:985)
at 
com.gargoylesoftware.htmlunit.javascript.background.JavaScriptFunctionJob.runJavaScript(JavaScriptFunctionJob.java:53)
at 
com.gargoylesoftware.htmlunit.javascript.background.JavaScriptExecutionJob.run(JavaScriptExecutionJob.java:102)
at 
com.gargoylesoftware.htmlunit.javascript.background.JavaScriptJobManagerImpl.runSingleJob(JavaScriptJobManagerImpl.java:328)
at 
com.gargoylesoftware.htmlunit.javascript.background.DefaultJavaScriptExecutor.run(DefaultJavaScriptExecutor.java:162)
at java.lang.Thread.run(Unknown Source)

May 16, 2014 1:36:41 PM 
com.gargoylesoftware.htmlunit.javascript.host.css.CSSStyleSheet parseCSS
SEVERE: Error parsing CSS from '/**
* The file contains styles for GWT widgets in the standard theme.
 *
 * In order to maintain cross-browser compatibility, the following syntax is
 * used to create IE6 specific style rules:
 *.gwt-Widget {
 *  property: rule applies to all browsers
 *  -property: rule applies only to IE6 (overrides previous rule)
 *}
 ** html .gw

Re: Can you tell me Step-By-Step Guidelines of How to use HtmlUnit to make GWT app Crawlable?

2014-05-15 Thread Tom
Ok, here is the problem of HTMLUnit. 

I have this code

 url_with_hash_fragment=
"http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997#!home";;
 // use the headless browser to obtain an HTML snapshot
 final WebClient webClient = new WebClient();
 HtmlPage page = webClient.getPage(url_with_hash_fragment);


 // important!  Give the headless browser enough time to execute 
JavaScript
 // The exact time to wait may depend on your application.
 webClient.waitForBackgroundJavaScript(2000);


 // return the snapshot
 PrintWriter out = response.getWriter();
 out.println(page.asXml());


in my eclipse, it first listed css clode like:

gwt-ToggleButton-down {
  background-position: 0 -513px;
  border: 1px inset #ccc;
  cursor: pointer;
  cursor: hand;
}
.gwt-ToggleButton-down-hovering {
  background-position: 0 -513px;
  border: 1px inset;
  border-color: #9cf #69e #69e #7af;
  cursor: pointer;
  cursor: hand;
}
: null
java.util.EmptyStackException
at java.util.Stack.peek(Unknown Source)

Why we got EmptyStackException problem?

If I run 
http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997#!home without 
HTMLUnit then everything is fine no issue, but if i run that url under 
HTMLUnit  then I got  EmptyStackException

How can sure 100% that HtmlUnit will never generate any error for any kind 
of HTML code?

On Friday, May 16, 2014 12:06:24 AM UTC+10, Jens wrote: 

> HtmlUnit is bundles as jar file so you can put it (and all its 
> dependencies) into WEB-INF/lib of your war.
>
> Then you need to write a servlet that takes the server request of the 
> Google bot, rewrites the _escaped_fragment_ parameter back to the original 
> #! url and starts HtmlUnit with that url. The resulting/rendered 
> page will then be returned by the servlet.
>
> At the bottom is an example:
>
> https://developers.google.com/webmasters/ajax-crawling/docs/html-snapshot
>
>
> The rendered page that you serve the Google Bot does not have to be a 1:1 
> copy of your original page. It is enough if the same content is available, 
> styling is irrelevant. For example compare:
>
> https://groups.google.com/forum/#!topic/google-web-toolkit/Syi04ArKl4k
>
> https://groups.google.com/forum/?_escaped_fragment_=topic/google-web-toolkit/Syi04ArKl4k
>
>
> -- 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/d/optout.


Re: Can you tell me Step-By-Step Guidelines of How to use HtmlUnit to make GWT app Crawlable?

2014-05-15 Thread Tom
I done 70%, but still have some error.

Ok, here is what i did, I downloaded htmlunit-2.14 & unzip it & copy these 
jar files into my lib folder


*htmlunit-2.14*
 *commons-codec*  *commons-collections*  *commons-io*  *commons-logging*  
*cssparser*  *htmlunit-core-js*  *nekohtml*  *commons-lang3*  *httpclient*  
*httpmime*  *jetty-websocket*  *xalan*  *xercesImpl* 
After that, i created "*public class CrawlServlet implements Filter*" as 
mentioned above:



@Override
 public void doFilter(ServletRequest request, ServletResponse response,
 FilterChain chain) throws IOException, ServletException {
 // TODO Auto-generated method stub
 HttpServletRequest httpRequest = (HttpServletRequest) request;
 String requestQueryString = httpRequest.getQueryString();

 if ((requestQueryString != null) && (requestQueryString.contains(
"_escaped_fragment_"))) {
 // rewrite the URL back to the original #! version
 String url_with_hash_fragment=requestQueryString.replace(
"?_escaped_fragment_=", "!#");

 // remember to unescape any %XX characters
 //url_with_hash_fragment = 
rewriteQueryString(url_with_escaped_fragment);

 // use the headless browser to obtain an HTML snapshot
 final WebClient webClient = new WebClient();
 HtmlPage page = webClient.getPage(url_with_hash_fragment);


 // important!  Give the headless browser enough time to execute 
JavaScript
 // The exact time to wait may depend on your application.
 webClient.waitForBackgroundJavaScript(2000);


 // return the snapshot
 PrintWriter out = response.getWriter();
 out.println(page.asXml());
 } else {
  try {
// not an _escaped_fragment_ URL, so move up the chain of servlet 
(filters)
chain.doFilter(request, response);
  } catch (ServletException e) {
System.err.println("Servlet exception caught: " + e);
e.printStackTrace();
  }
}
   
 }

Ok, now I ran my GWT app in eclipse & open the url "
*http://127.0.0.1:/Myproject.html?gwt.codesvr=127.0.0.1:9997?_escaped_fragment_=article*
" 

& here the error in eclipse

[ERROR] 500 - GET /Myproject.html?gwt.codesvr=127.0.0.1:9997?
_escaped_fragment_=article (127.0.0.1) 4840 bytes
   Request headers
  Accept: text/html, application/xhtml+xml, */*
  Accept-Language: en-AU
  User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) 
like Gecko
  Accept-Encoding: gzip, deflate
  Host: 127.0.0.1:
  Connection: keep-alive
  Cookie: JSESSIONID=5eehbjnnhsz6m6hlk7el8tu; 
SILFORACOOKIE=5eehbjnnhsz6m6hlk7el8tu
   Response headers
  Set-Cookie: JSESSIONID=ro2z2xqrbi0j93zfrb1uihl8;Path=/
  Set-Cookie: SILFORACOOKIE=ro2z2xqrbi0j93zfrb1uihl8;Path=/
  Content-Type: text/html;charset=ISO-8859-1
  Cache-Control: must-revalidate,no-cache,no-store
  Content-Length: 4840



In the ChromeBrowser it showed:

HTTP ERROR 500

Problem accessing /Myproject.html. Reason: Server Error


Caused by:java.net.MalformedURLException: no protocol: gwt.codesvr=127.0.0.1
:9997!#article
 at java.net.URL.(Unknown Source)




Do you know how to fix it?

On Friday, May 16, 2014 12:06:24 AM UTC+10, Jens wrote:
>
> HtmlUnit is bundles as jar file so you can put it (and all its 
> dependencies) into WEB-INF/lib of your war.
>
> Then you need to write a servlet that takes the server request of the 
> Google bot, rewrites the _escaped_fragment_ parameter back to the original 
> #! url and starts HtmlUnit with that url. The resulting/rendered 
> page will then be returned by the servlet.
>
> At the bottom is an example:
>
> https://developers.google.com/webmasters/ajax-crawling/docs/html-snapshot
>
>
> The rendered page that you serve the Google Bot does not have to be a 1:1 
> copy of your original page. It is enough if the same content is available, 
> styling is irrelevant. For example compare:
>
> https://groups.google.com/forum/#!topic/google-web-toolkit/Syi04ArKl4k
>
> https://groups.google.com/forum/?_escaped_fragment_=topic/google-web-toolkit/Syi04ArKl4k
>
>
> -- 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/d/optout.


Re: Can you tell me Step-By-Step Guidelines of How to use HtmlUnit to make GWT app Crawlable?

2014-05-15 Thread Tom
ok, here is what I am trying.

I created a class called CrawlServlet



import java.io.IOException;


import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;


public class CrawlServlet implements Filter{
 


 @Override
 public void destroy() {
 // TODO Auto-generated method stub
 
 }


 @Override
 public void doFilter(ServletRequest request, ServletResponse response,
 FilterChain chain) throws IOException, ServletException {
 // TODO Auto-generated method stub
 HttpServletRequest httpRequest = (HttpServletRequest) request;
 String requestURI = httpRequest.getRequestURI();
  if ((requestURI != null) && (requestURI.contains("_escaped_fragment_"
))) {
   System.out.println(requestURI);
 } else {
  try {
// not an _escaped_fragment_ URL, so move up the chain of servlet 
(filters)
chain.doFilter(request, response);
  } catch (ServletException e) {
System.err.println("Servlet exception caught: " + e);
e.printStackTrace();
  }
}
   
 }


 @Override
 public void init(FilterConfig arg0) throws ServletException {
 // TODO Auto-generated method stub
 
 }
}


 
in lib/web.xml, i have


 CrawlServlet
 CrawlServlet
  


  
 CrawlServlet
 /*
  


After ran my GWT app, i got this error 503

[ERROR] 503 - GET /Myproject.html?gwt.codesvr=127.0.0.1:9997 (127.0.0.1) 
1299 bytes
   Request headers
  Accept: text/html, application/xhtml+xml, */*
  Accept-Language: en-AU
  User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) 
like Gecko
  Accept-Encoding: gzip, deflate
  Host: 127.0.0.1:
  If-Modified-Since: Wed, 16 Apr 2014 00:35:41 GMT
  Connection: keep-alive
   Response headers
  Cache-Control: must-revalidate,no-cache,no-store
  Content-Type: text/html;charset=ISO-8859-1
  Content-Length: 1299


Can anyone tell me what is the right way to create HTMLSnapShot using 
HTMLUnit?


On Friday, May 16, 2014 9:49:33 AM UTC+10, Jens wrote:
>
> so Google use server-side technology to create Html snapshot? or they use 
>> HtmlUnit?
>>
>
> I don't know what they use, but I would say they don't use HtmlUnit for 
> groups.google.com.
>
> -- 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/d/optout.


Re: Can you tell me Step-By-Step Guidelines of How to use HtmlUnit to make GWT app Crawlable?

2014-05-15 Thread Tom
am not very experienced in changing url request. 

Here is what i understand, but not sure.
Ok, we already have our url "myDomain.com#!article;articleID=1" showing 
correct article.

In my server package, I have "public class GetArticleActionHandler 
implements ActionHandler". This is the class 
that take article from MYSQL DB & bring it into client. So I don't use any 
Servlet that traditional JSP programmers using.

Now i need to change the url so I have to use Filter right?

But if I do that then "will my app download the article twice for each 
single request?" or you mean if i use HTMLUnit then I just need to download 
article ONCE (ie article will be taken from GetArticleActionHandler) only & 
then HtmlUnit will take a snapshot of the article page?

Can we know if a request is from a Bot or from a non-bot?

This is quite confused.

Can you explain this a bit?


On Friday, May 16, 2014 9:49:33 AM UTC+10, Jens wrote:
>
> so Google use server-side technology to create Html snapshot? or they use 
>> HtmlUnit?
>>
>
> I don't know what they use, but I would say they don't use HtmlUnit for 
> groups.google.com.
>
> -- 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/d/optout.


Re: Can you tell me Step-By-Step Guidelines of How to use HtmlUnit to make GWT app Crawlable?

2014-05-15 Thread Tom
about this ex 
https://groups.google.com/forum/#!topic/google-web-toolkit/Syi04ArKl4k
so Google use server-side technology to create Html snapshot? or they use 
HtmlUnit?

On Friday, May 16, 2014 12:06:24 AM UTC+10, Jens wrote:
>
> HtmlUnit is bundles as jar file so you can put it (and all its 
> dependencies) into WEB-INF/lib of your war.
>
> Then you need to write a servlet that takes the server request of the 
> Google bot, rewrites the _escaped_fragment_ parameter back to the original 
> #! url and starts HtmlUnit with that url. The resulting/rendered 
> page will then be returned by the servlet.
>
> At the bottom is an example:
>
> https://developers.google.com/webmasters/ajax-crawling/docs/html-snapshot
>
>
> The rendered page that you serve the Google Bot does not have to be a 1:1 
> copy of your original page. It is enough if the same content is available, 
> styling is irrelevant. For example compare:
>
> https://groups.google.com/forum/#!topic/google-web-toolkit/Syi04ArKl4k
>
> https://groups.google.com/forum/?_escaped_fragment_=topic/google-web-toolkit/Syi04ArKl4k
>
>
> -- 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/d/optout.


Can you tell me Step-By-Step Guidelines of How to use HtmlUnit to make GWT app Crawlable?

2014-05-15 Thread Tom
 

Making your GWT app to be indexed by Search Engine is very important, but 
very very little info to tell you Step-By-Step Guidelines of How to make 
GWT app Crawlable dynamically.

Ok, Here is what I understood but I am not sure 100% I am correct or not. 
SO please correct me if you can.

To make a Gwt page ex myDomain.com#article;articleID=1 to be indexed by 
search engine, you need to:

-1st, convert myDomain.com#article;articleID=1 to 
myDomain.com#!article;articleID=1

-2nd, when Google /Yahoo bot visits that page (
myDomain.com#!article;articleID=1), it will convert that page into (
myDomain.com?_escaped_fragment_=article&articleID=1) & request that page 
into your webserver.The Web server then will try to render that page to the 
Bot.

So if we have a static page of 
myDomain.com?_escaped_fragment_=article&articleID=1, then the content of 
that page will be read by the Bot & can be indexed.

But the article is dynamic cos user could enter 
myDomain.com?_escaped_fragment_=article&articleID=2 or ...article=3... but 
we can't manually make the static page for each of article. 

So the solution is HtmlUnit.

A tool like HtmlUnit will dynamically convert 
myDomain.com?_escaped_fragment_=article&articleID=2 into a page that the 
bot can read.

But I don't know step-by-step guidelines of How to set HtmlUnit up? 

Is HtmlUnit like a jar file that we can put into lib? what should we do 
next? 

http://stackoverflow.com/questions/23680290/can-you-tell-me-step-by-step-guidelines-of-how-to-use-htmlunit-to-make-gwt-app-c

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


Re: Image Debug IDs gone in 2.6.1

2014-05-14 Thread Tom
Turns out that dong this kind of thing,

AbstractImagePrototype.create(newImageResource).applyTo(existingImage);

now removes the id attribute. I haven't run it through the debugger as well 
but I have to assume that in 2.5.0 it did not.

I've worked around it by storing the ID in a temporary before, and 
restoring it after, the above call.

On Thursday, 15 May 2014 09:47:26 UTC+12, Tom wrote:
>
> Hi
>
> I just moved our project on from 2.5.0 to 2.6.1. Many of our automated 
> tests have failed because the debug IDs have disappeared from images.
>
> We use debugId="blah" in UI Binder templates on Image widgets. This used 
> to result in id="gwt-debug-blah" in the resulting img elements in the DOM. 
> Now it doesn't. The IDs are still present on other widgets, so far it seems 
> only images are affected. Any ideas?
>
> I'm going to investigate in more detail but wanted to post this now so as 
> to discover ASAP if anyone knows anything about this.
>
> Thanks!
>
>

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


Image Debug IDs gone in 2.6.1

2014-05-14 Thread Tom
Hi

I just moved our project on from 2.5.0 to 2.6.1. Many of our automated 
tests have failed because the debug IDs have disappeared from images.

We use debugId="blah" in UI Binder templates on Image widgets. This used to 
result in id="gwt-debug-blah" in the resulting img elements in the DOM. Now 
it doesn't. The IDs are still present on other widgets, so far it seems 
only images are affected. Any ideas?

I'm going to investigate in more detail but wanted to post this now so as 
to discover ASAP if anyone knows anything about this.

Thanks!

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


How to redirect and then reload the page in GWTP?

2014-05-13 Thread Tom
 

Ok, I am using GWTP to build my app. I have a signUp page (
mydomain.com#signUp) & a profile page (mydomain.com#profile).

I want that after user signed up successfully, the app will redirect to 
profile page & then reload() the profile page.

So here is what I did:

if(signedUpSuccessfully){
  PlaceRequest request=new PlaceRequest(NameTokens.profile);
  placeManager.revealPlace(request);
  Window.Location.reload();
}

However, after finished running, the app did reload but it still in the 
signUp page not in profile page.

So, How to let the app redirect to profile page then reload the profile 
page?

I don't want to use Window.open cos it could open new browser, which is 
very noisy.

http://stackoverflow.com/questions/23643597/how-to-redirect-and-then-reload-the-window-in-gwtp

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


Re: How to count total lines of code of a GWT project?

2014-05-13 Thread Tom
i got gwt-dev.jar (the 2.5 version) in lib folder, now I just copy 
gwt-dev.jar of  2.6 version & I got no error. Thank you very much for your 
info.

On Tuesday, May 13, 2014 10:42:56 PM UTC+10, Thomas Broyer wrote:
>
>
>
> On Tuesday, May 13, 2014 1:55:31 PM UTC+2, Tom wrote:
>>
>> tNo, the message saying that JRE 6 or 7 & I got JRE 6 so it will be fine.
>>
>> I just fixed & not sure it's ok. I right-click myProject--> Google-->Web 
>> ToolKit Setting-->Java Build Path --> "GWT SDK " --> click Edit--> select 
>> GWT 2.6.0
>>
>> ANd now the error gone.
>>
>> Only saw these warning:
>>
>> *[WARN] Server class 
>> 'org.eclipse.jetty.servlet.listener.ELContextCleaner' could not be found in 
>> the web app, but was found on the system classpath*
>> *   [WARN] Adding classpath entry 
>> 'file:/C:/Users/eclipse-jee-juno-SR1-win32-x86_64/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.6.0/gwt-2.6.0/gwt-dev.jar'
>>  
>> to the web app classpath for this session*
>> *   For additional info see: 
>> file:/C:/Users/henry/eclipse-jee-juno-SR1-win32-x86_64/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.6.0/gwt-2.6.0/doc/helpInfo/webAppClassPath.html*
>>
>> This is a serious warning?
>>
>> You said that we DO NOT need to deploy *gwt-dev.jar *so we don't need to 
>> include gwt-dev.jar into lib. Is that correct?
>>
>
> Yes; and you should update to 2.6.1 as it contains fixes around this 
> warning.
> (and no, it's apparently not yet available as an Eclipse plugin, and I 
> have no idea when it'll be)
>  
>
>>
>> 2nd before I used GWT2.5, but after reinstall GWT Now I saw GWT2.6 & Now 
>> I am using GWT 2.6 . GWT2.6 need Java 7 or Java 6 is OK?
>>
>
> IIRC, GWT 2.6 was planned to support Java 6 but actually needs Java 7. 
> That's only about the GWT compiler though, you can use Java 6 on your 
> server.
> I haven't checked how GWT 2.6.1 was built and what it actually requires.
>
> I am using JRE 6 at this moment.
>>
>
> Any reason for using an outdated and unsupported version? Why aren't you 
> using the latest Java 7 or Java 8?
>

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


Re: How to count total lines of code of a GWT project?

2014-05-13 Thread Tom
Thank you Thomas, I am using Java 7 now, I just afraid the incompatible 
problem, ie I afraid my GWT app  (previously built using JDK6 ) could have 
problem when running in JDK7.


On Tuesday, May 13, 2014 10:42:56 PM UTC+10, Thomas Broyer wrote:
>
>
>
> On Tuesday, May 13, 2014 1:55:31 PM UTC+2, Tom wrote:
>>
>> tNo, the message saying that JRE 6 or 7 & I got JRE 6 so it will be fine.
>>
>> I just fixed & not sure it's ok. I right-click myProject--> Google-->Web 
>> ToolKit Setting-->Java Build Path --> "GWT SDK " --> click Edit--> select 
>> GWT 2.6.0
>>
>> ANd now the error gone.
>>
>> Only saw these warning:
>>
>> *[WARN] Server class 
>> 'org.eclipse.jetty.servlet.listener.ELContextCleaner' could not be found in 
>> the web app, but was found on the system classpath*
>> *   [WARN] Adding classpath entry 
>> 'file:/C:/Users/eclipse-jee-juno-SR1-win32-x86_64/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.6.0/gwt-2.6.0/gwt-dev.jar'
>>  
>> to the web app classpath for this session*
>> *   For additional info see: 
>> file:/C:/Users/henry/eclipse-jee-juno-SR1-win32-x86_64/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.6.0/gwt-2.6.0/doc/helpInfo/webAppClassPath.html*
>>
>> This is a serious warning?
>>
>> You said that we DO NOT need to deploy *gwt-dev.jar *so we don't need to 
>> include gwt-dev.jar into lib. Is that correct?
>>
>
> Yes; and you should update to 2.6.1 as it contains fixes around this 
> warning.
> (and no, it's apparently not yet available as an Eclipse plugin, and I 
> have no idea when it'll be)
>  
>
>>
>> 2nd before I used GWT2.5, but after reinstall GWT Now I saw GWT2.6 & Now 
>> I am using GWT 2.6 . GWT2.6 need Java 7 or Java 6 is OK?
>>
>
> IIRC, GWT 2.6 was planned to support Java 6 but actually needs Java 7. 
> That's only about the GWT compiler though, you can use Java 6 on your 
> server.
> I haven't checked how GWT 2.6.1 was built and what it actually requires.
>
> I am using JRE 6 at this moment.
>>
>
> Any reason for using an outdated and unsupported version? Why aren't you 
> using the latest Java 7 or Java 8?
>

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


Re: How to count total lines of code of a GWT project?

2014-05-13 Thread Tom
That' right, I installed JRE 7 & now no error. 

On Tuesday, May 13, 2014 10:09:58 PM UTC+10, Drew Spencer wrote:
>
> No dude, it doesn't say 6 or 7, it says "version *1.7.0 or later* is 
> needed to run Google Plugin for Eclipse."
>
> I think you need the v7 JDK on your system path.
>
>
> On 13 May 2014 12:55, Tom > wrote:
>
>> tNo, the message saying that JRE 6 or 7 & I got JRE 6 so it will be fine.
>>
>> I just fixed & not sure it's ok. I right-click myProject--> Google-->Web 
>> ToolKit Setting-->Java Build Path --> "GWT SDK " --> click Edit--> select 
>> GWT 2.6.0
>>
>> ANd now the error gone.
>>
>> Only saw these warning:
>>
>> *[WARN] Server class 
>> 'org.eclipse.jetty.servlet.listener.ELContextCleaner' could not be found in 
>> the web app, but was found on the system classpath*
>> *   [WARN] Adding classpath entry 
>> 'file:/C:/Users/eclipse-jee-juno-SR1-win32-x86_64/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.6.0/gwt-2.6.0/gwt-dev.jar'
>>  
>> to the web app classpath for this session*
>> *   For additional info see: 
>> file:/C:/Users/henry/eclipse-jee-juno-SR1-win32-x86_64/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.6.0/gwt-2.6.0/doc/helpInfo/webAppClassPath.html*
>>
>> This is a serious warning?
>>
>> You said that we DO NOT need to deploy *gwt-dev.jar *so we don't need to 
>> include gwt-dev.jar into lib. Is that correct?
>>
>> 2nd before I used GWT2.5, but after reinstall GWT Now I saw GWT2.6 & Now 
>> I am using GWT 2.6 . GWT2.6 need Java 7 or Java 6 is OK?
>>
>> I am using JRE 6 at this moment.
>>
>>
>>
>> On Tuesday, May 13, 2014 9:33:20 PM UTC+10, Thomas Broyer wrote:
>>>
>>> Yes, 1.6, that's what it tells you. And you need 1.7.
>>> Also, this is the version of Java used to run Eclipse, not necessarily 
>>> the one selected for your Eclipse project.
>>>
>>> On Tuesday, May 13, 2014 1:25:41 PM UTC+2, Tom wrote:
>>>>
>>>> Ok, I installed again Google Plugin but this time after relaunched 
>>>> Eclipse I saw a red "!" in my project name. 
>>>>
>>>> Also I saw message "J*RE version is 1.6.0; version 1.7.0 or later is 
>>>> needed to run Google Plugin for Eclipse*."
>>>>
>>>> However, I went to Window--> Preferences --> Java --> Installed JREs & 
>>>> I saw
>>>>
>>>> jre6 -  C:\Java\jre6  - Standard VM
>>>>
>>>> So Eclipse already got jre6 why it got that error?
>>>>
>>>> Do you know how to fix?
>>>>
>>>> On Tuesday, May 13, 2014 9:08:48 PM UTC+10, Drew Spencer wrote:
>>>>>
>>>>> That doesn't sound like expected behaviour. I would guess there is 
>>>>> something else wrong with your installation of eclipse if the GUI is 
>>>>> getting all messed up like that after a very simple plugin is installed.
>>>>>
>>>>> I've never had any such problems. Maybe if you post more information 
>>>>> about what is going on someone can help you.
>>>>>
>>>>> Drew
>>>>>
>>>>> On Tuesday, 13 May 2014 11:54:08 UTC+1, Tom wrote:
>>>>>>
>>>>>> My Godness, I put *http://metrics.sourceforge.net/update 
>>>>>> <http://metrics.sourceforge.net/update> & now G symbol disapppeared?? *
>>>>>> *Why, it's terrible now Why all the Gui structure gone???*
>>>>>>
>>>>>> On Tuesday, May 13, 2014 7:27:38 PM UTC+10, Drew Spencer wrote:
>>>>>>>
>>>>>>> Get the metrics 2 plugin: http://metrics.sourceforge.net/
>>>>>>>
>>>>>>> I think this will do exactly what you want.
>>>>>>>
>>>>>>> On Tuesday, 13 May 2014 08:37:33 UTC+1, Tom wrote:
>>>>>>>>
>>>>>>>> Does GWT 2.5 provide a tool to count total lines of code of a GWT 
>>>>>>>> project?
>>>>>>>>
>>>>>>>> I installed GWT2.5 in eClipse Juno, in Client package I have about 
>>>>>>>> 191 java files, in Server package I have about 41 java files.
>>>>>>>>
>>>>>>>> Some java files have 12000 lines of code some only have 1 or 2000 
>>>>>>>&g

Re: How to count total lines of code of a GWT project?

2014-05-13 Thread Tom
tNo, the message saying that JRE 6 or 7 & I got JRE 6 so it will be fine.

I just fixed & not sure it's ok. I right-click myProject--> Google-->Web 
ToolKit Setting-->Java Build Path --> "GWT SDK " --> click Edit--> select 
GWT 2.6.0

ANd now the error gone.

Only saw these warning:

*[WARN] Server class 'org.eclipse.jetty.servlet.listener.ELContextCleaner' 
could not be found in the web app, but was found on the system classpath*
*   [WARN] Adding classpath entry 
'file:/C:/Users/eclipse-jee-juno-SR1-win32-x86_64/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.6.0/gwt-2.6.0/gwt-dev.jar'
 
to the web app classpath for this session*
*   For additional info see: 
file:/C:/Users/henry/eclipse-jee-juno-SR1-win32-x86_64/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.6.0/gwt-2.6.0/doc/helpInfo/webAppClassPath.html*

This is a serious warning?

You said that we DO NOT need to deploy *gwt-dev.jar *so we don't need to 
include gwt-dev.jar into lib. Is that correct?

2nd before I used GWT2.5, but after reinstall GWT Now I saw GWT2.6 & Now I 
am using GWT 2.6 . GWT2.6 need Java 7 or Java 6 is OK?

I am using JRE 6 at this moment.



On Tuesday, May 13, 2014 9:33:20 PM UTC+10, Thomas Broyer wrote:
>
> Yes, 1.6, that's what it tells you. And you need 1.7.
> Also, this is the version of Java used to run Eclipse, not necessarily the 
> one selected for your Eclipse project.
>
> On Tuesday, May 13, 2014 1:25:41 PM UTC+2, Tom wrote:
>>
>> Ok, I installed again Google Plugin but this time after relaunched 
>> Eclipse I saw a red "!" in my project name. 
>>
>> Also I saw message "J*RE version is 1.6.0; version 1.7.0 or later is 
>> needed to run Google Plugin for Eclipse*."
>>
>> However, I went to Window--> Preferences --> Java --> Installed JREs & I 
>> saw
>>
>> jre6 -  C:\Java\jre6  - Standard VM
>>
>> So Eclipse already got jre6 why it got that error?
>>
>> Do you know how to fix?
>>
>> On Tuesday, May 13, 2014 9:08:48 PM UTC+10, Drew Spencer wrote:
>>>
>>> That doesn't sound like expected behaviour. I would guess there is 
>>> something else wrong with your installation of eclipse if the GUI is 
>>> getting all messed up like that after a very simple plugin is installed.
>>>
>>> I've never had any such problems. Maybe if you post more information 
>>> about what is going on someone can help you.
>>>
>>> Drew
>>>
>>> On Tuesday, 13 May 2014 11:54:08 UTC+1, Tom wrote:
>>>>
>>>> My Godness, I put *http://metrics.sourceforge.net/update 
>>>> <http://metrics.sourceforge.net/update> & now G symbol disapppeared?? *
>>>> *Why, it's terrible now Why all the Gui structure gone???*
>>>>
>>>> On Tuesday, May 13, 2014 7:27:38 PM UTC+10, Drew Spencer wrote:
>>>>>
>>>>> Get the metrics 2 plugin: http://metrics.sourceforge.net/
>>>>>
>>>>> I think this will do exactly what you want.
>>>>>
>>>>> On Tuesday, 13 May 2014 08:37:33 UTC+1, Tom wrote:
>>>>>>
>>>>>> Does GWT 2.5 provide a tool to count total lines of code of a GWT 
>>>>>> project?
>>>>>>
>>>>>> I installed GWT2.5 in eClipse Juno, in Client package I have about 
>>>>>> 191 java files, in Server package I have about 41 java files.
>>>>>>
>>>>>> Some java files have 12000 lines of code some only have 1 or 2000 
>>>>>> lines. But there are comments as well.
>>>>>>
>>>>>> So I think, on an average, each java file has 3000 lines of code, but 
>>>>>> I am not so sure. 
>>>>>>
>>>>>> So how to count the total lines of code (not counting the comment 
>>>>>> lines) of a GWT Project  in eClipse?
>>>>>>
>>>>>

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


Re: How to count total lines of code of a GWT project?

2014-05-13 Thread Tom
Ok, I installed again Google Plugin but this time after relaunched Eclipse 
I saw a red "!" in my project name. 

Also I saw message "J*RE version is 1.6.0; version 1.7.0 or later is needed 
to run Google Plugin for Eclipse*."

However, I went to Window--> Preferences --> Java --> Installed JREs & I saw

jre6 -  C:\Java\jre6  - Standard VM

So Eclipse already got jre6 why it got that error?

Do you know how to fix?

On Tuesday, May 13, 2014 9:08:48 PM UTC+10, Drew Spencer wrote:
>
> That doesn't sound like expected behaviour. I would guess there is 
> something else wrong with your installation of eclipse if the GUI is 
> getting all messed up like that after a very simple plugin is installed.
>
> I've never had any such problems. Maybe if you post more information about 
> what is going on someone can help you.
>
> Drew
>
> On Tuesday, 13 May 2014 11:54:08 UTC+1, Tom wrote:
>>
>> My Godness, I put *http://metrics.sourceforge.net/update 
>> <http://metrics.sourceforge.net/update> & now G symbol disapppeared?? *
>> *Why, it's terrible now Why all the Gui structure gone???*
>>
>> On Tuesday, May 13, 2014 7:27:38 PM UTC+10, Drew Spencer wrote:
>>>
>>> Get the metrics 2 plugin: http://metrics.sourceforge.net/
>>>
>>> I think this will do exactly what you want.
>>>
>>> On Tuesday, 13 May 2014 08:37:33 UTC+1, Tom wrote:
>>>>
>>>> Does GWT 2.5 provide a tool to count total lines of code of a GWT 
>>>> project?
>>>>
>>>> I installed GWT2.5 in eClipse Juno, in Client package I have about 191 
>>>> java files, in Server package I have about 41 java files.
>>>>
>>>> Some java files have 12000 lines of code some only have 1 or 2000 
>>>> lines. But there are comments as well.
>>>>
>>>> So I think, on an average, each java file has 3000 lines of code, but I 
>>>> am not so sure. 
>>>>
>>>> So how to count the total lines of code (not counting the comment 
>>>> lines) of a GWT Project  in eClipse?
>>>>
>>>

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


  1   2   3   4   >