Re: Are servlets available when performing GWT Unit Tests?

2013-08-12 Thread ckuetbach
Hi Thomas,

>
are there any known regressions with this way in GWT 2.5.1?

I created a moduleText.gwt.xml with inherits my module.gwt.xml to add the 
servlet-element.

If I misspell the servlet-classname, I get an error loading the module. But 
if everything seems to be correct, I don't get any output from my servlet, 
no breakpoint in my servlet can be used. In fact I get a 404 if I call the 
URL.

Is there a way to debug this servlet? Or can I redirect the output of the 
servlet, to see if it is started? The servlet itself is running fine in 
dev-mode.


Thanks in advance,
Christian Kuetbach

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




Re: Export CellTable's selected rows into a csv file

2013-08-12 Thread Thad Humphries
No, I was just saying how I did it. As I recall--it's been several years--I 
first used OpenCSV but switched to Apache's CSV because it also had a tab 
delimited option (though I guess you can do the same thing with OpenCSV by 
changing the delimiters). 

If your file is empty, I'd check your file calls, not the CSV library: Is 
the file opened for writing, is the file handle properly passed to the 
library, is the data still there to write, is the output properly flushed, 
and is the file closed. I'd write something to the file before and after my 
CVS calls to see if anything gets written. And I'd check the file on the 
server, not just what my servlet returns.

On Sunday, August 11, 2013 10:32:23 PM UTC-4, Winnie T wrote:
>
> Hi Thad, thanks for responding. Currently, I tried using OpenCSV, and had 
> successfully create a CSV file when I click the export button, but the CSV 
> file was empty. Do you meant that I could use Apache Commons instead of 
> OpenCSV?
>
> On Thursday, August 8, 2013 10:27:06 PM UTC+8, Thad Humphries wrote:
>>
>> If your server side still has a copy of your list, you can send 
>> references to the rows by row number (i thru n) or some sort of row id set 
>> in a servlet call. The servlet could build the CSV (Apache Commons has a 
>> CSV module) and return it to the browser with the MIME text/csv so the 
>> browser could decide what to do with it. You'll have to target your servlet 
>> at a _blank page or an IFRAME to prevent stomping on your GWT app.
>>
>> On Thursday, February 3, 2011 2:42:26 AM UTC-5, Ido wrote:
>>>
>>> Well, the server side which should populate the csv file is the server 
>>> package within the GWT project.
>>> I'm not using any external backend to populate the csv file.
>>> When mentioned sending list of objects using RPC I meant using the 
>>> RemoteServiceServlet.
>>>
>>> Once my "server" get's this list , it should create a csv out of it and 
>>> *somehow* send it to the client.
>>> Just can't figure how to do so.
>>> Maybe the server should return the user a path to the created file, but 
>>> then what?
>>> Maybe new servlet should be created to handle this kind of action, but 
>>> how can I send the list of the selected objects?
>>>
>>>
>>>
>>>
>>>
>>>

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




Re: Custom cell in CellTable with TextCell and SelectionCell

2013-08-12 Thread Jochen Schnaidt
Hi everybody,

my cell now reacts on changes. But this brings up new questions, first of 
all: How do I get my event from my custom cell to to my CellTable to 
trigger an FieldUpdater? 

Thanks a lot.

Best regards Jochen

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




add more option in dorpdown list like Street name

2013-08-12 Thread Hardik Chavda
How can i add more option in drop down list like street name, locality, 
etc. If anyone know how to add please tell me. i want add my own society in 
street name filed.

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




FIX: Problem with Firefox 22 and GWT Dev Plugin? Upgrade to Firefox 23

2013-08-12 Thread Tony BenBrahim
Go to Help About, an update from 22 to 23 should automatically start 
downloading. It fixed the problem for me.

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




Difference between script tag in code and ScriptInjector

2013-08-12 Thread asif . tmcp
Hi ,

I am trying to inject 3rd Party javascript libraries into my gwt project.

If I import the scripts directly via my html with  it works perfectly.

However, when I load them at runtime with ScriptInjector, the scripts are 
loaded but a call to #ClassName results in an exception


com.google.gwt.core.client.JavaScriptException: (TypeError): $wnd.ClassName 
is undefined

I am calling ClassName in the OnSuccess method of the callback for 
ScriptInjector. 

- From a dom perspective, injecting it directly into the html, results in 
the scripts getting included in the html head, however, SCriptInjector, 
injects it into an  section of an iframe which is embedded into the 
body of the html.

What exactly is the difference and how to work around this?

Regards,

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




Typed service methods using RequestFactory and ServiceLocator

2013-08-12 Thread Steve C
I'm trying to work up an example of request factory using a service 
locator. The discussions/tutorials all say that ServiceLocator is useful 
when there's a generic DAO with static methods for instance operations. I'm 
taking that to mean that my entity classes don't have their own methods to 
get a specific instance.

The javadocs for ServiceLocator say "A ServiceLocator provides instances of 
a type specified by a 
Servicewhen
 
Requestmethods
 declared in a 
RequestContextare
 mapped onto instance (non-static) methods." I think that's actually 
backwards -- it looks like the ServiceLocator supplies an instance when 
what would normally be instance methods (like persist) are actually static 
and passed an instance. My guess is that the framework generates glue code 
to invoke the methods on the instance but also pass them the instance.

My entities are all instances of DataStoreItem. One specific subclass is 
Flick.

I can write a service that uses a locator with static methods including 
public static DataStoreItem find(Class clazz, Long 
id).

My request context class is public interface FlickRequest extends 
RequestContext.

And, unlike so many of the examples I've seen, I actually see benefit to 
having the context definition include a method to retrieve a single 
instance (otherwise, how do I actually request one?):

public Request get(long id);

But, as I said before, my Flick class doesn't include a static get method. 
The locator analog to that method takes a class object in addition to the 
id (to be honest, I haven't tried passing it my proxy class object, but I 
doubt that would work, since on the server side it would have to receive 
the actual bean class, not the proxy class). And, it looks like the 
ServiceLocator will only work for the methods that ought to operate on 
instances, not methods that would always be static.

I tried this as my service locator:

public class FlickServiceLocator implements ServiceLocator {

@Override
public Object getInstance(Class clazz) {
return  new ItemDAOWrapper(Flick.class);
}

}

Where the ItemDAOWrapper holds the class object and delegates find(id) to 
find(clazz, id), but am still seeing errors on my request context that my 
domain class doesn't have a find method.

So, how do I write a method to get an instance by id, when the entity class 
doesn't do that, and my generic DAO class can only do that when given an 
class to work on (short of writing an explicit wrapper class for each 
domain type that can add those methods)?


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




Dom change propagation time

2013-08-12 Thread asif . tmcp
Hi ,

I am changing the id of an element in the dom with 

tableeditor.getElement().setId("tableeditor");

where 
@UiField
SimplePanel tableeditor;

After this I call a javascript which manipulates the dom based on the 
id=tableeditor.

However, if I put a timeout of 1 sec after changing the dom id property, 
the javascript works fine.
IF I call the javascript immediately after the setId call, then two things 
happen

1>. The id is not set.
2>. The javascript throws an exception since it is expecting the id to be 
present.

What is the reason of this behaviour? 

I would prefer not putting a timer, unless there is no other way to make 
this work.

Regards

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


Re: Difference between script tag in code and ScriptInjector

2013-08-12 Thread Jens
If you need to inject it into the top window document you can use

ScriptInjector.fromString(script).setWindow(ScriptInjector.TOP_WINDOW).inject();

-- J.

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




Re: Difference between script tag in code and ScriptInjector

2013-08-12 Thread asif . tmcp
Thanks Jens,

That works perfectly - along with some help from 
this


On Monday, August 12, 2013 10:49:16 AM UTC-4, Jens wrote:
>
> If you need to inject it into the top window document you can use
>
>
> ScriptInjector.fromString(script).setWindow(ScriptInjector.TOP_WINDOW).inject();
>
> -- J.
>

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




Re: RPC that returns void, how to type the callback?

2013-08-12 Thread Ohad Kravchick
AsyncCallback should work.

Pay attention though that you do need to call it with a valid Void object, 
for which null is appropriate. Not the clearest API, but it works.

void fn(final AsyncCallback callback) {
  callback.onSuccess(null);
}

On Wednesday, August 6, 2008 5:05:27 AM UTC-4, Patrick Ratelband wrote:
>
> I have tried and I am afraid that I cannot get it to work either. It 
> really seems like you have to return something, and you have to type 
> it, otherwise the GWT compiler will generalize the callback to handle 
> anything and your code will bloat. Too bad, maybe an idea for the next 
> GWT release? 
>
> Patrick 
>
> On Aug 5, 2:03 pm, thlaitina  wrote: 
> > hi Patrick, 
> > 
> > Did you try? I got "Unable to recognize 'java.lang.Void 
> > java.lang.Void' as a type name (is it fully qualified?)" when I put 
> > Void as the return type! 
> > 
> > Tina 
> > 
> > On Aug 3, 3:01 pm, Patrick Ratelband  wrote: 
> > 
> > > Thank you Daniel, 
> > 
> > > I never thought of usingvoidwith a capital V (silly me... slaps 
> > > himself), even though it might not be very... well... clean code, at 
> > > least it makes Eclipse happy for the moment. 
> > 
> > > Patrick 
> > 
> > > DanielK wrote: 
> > > > My workaround to this was to use the class "Void" as the type 
> > > > parameter of asynccallback / the return value of the method. 
> > 
> > > > I dont know if this is a good thing, though. Only Joshua Bloch or 
> Bob 
> > > > Lee could answer 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/groups/opt_out.


Re: Problems with GWT-RPC: encodedRequest cannot be empty

2013-08-12 Thread christopher . e . plummer
I've done a lot of research into this over the past couple of months - 
before I get into the details, my web application is using GWT 2.x running 
on Tomcat 7, with an Apache httpd 2.2.x and mod_jk 1.2.x setup in front.

With mod_jk version 1.2.26, I'd occasionally see the 'encodedRequest cannot 
be empty' error in the logs.  This would only happen in IE, for me only 
IE8/9.  The problem is that my server OS is Linux, so there's no way that 
NTLM authentication could be the issue.  In newer versions of mod_jk 
(1.2.37 at this writing), I would instead get a socket timeout and read 
error in the Tomcat logs.

This error would be logged during a polling of my web application to the 
server every few seconds in order to get the status of a long-running 
operation that had been launched in a separate thread.  The polling would 
happen every five seconds, but occasionally it would hang while doing this 
status request.

After a lot of tcpdump commands, I found that the request that hung would 
come on a TCP connection that was being reset by Apache; a FIN/ACK was 
being sent to the browser, the POST request header and body would be 
received by the server, and the server would continue to reset the 
connection.  Then, strangely enough, only the header would come back to the 
server from the browser.  After researching a little, I found this:

http://stackoverflow.com/questions/4796305/why-does-internet-explorer-not-send-http-post-body-on-ajax-call-after-failure

Apparently, IE will only send the headers during the re-send of the POST 
request.  The GWT servlet hangs trying to reading the POST body and then 
times out.

In true Microsoft fashion, this issue has actually been know about for a 
while, a hotfix was issued and installed, but NOT ENABLED on the client 
machine.  If you don't want to force all of your users to edit their 
registry, you need to either disable HTTP Keep-Alive on your server or 
increase the Keep-Alive timeout to > 60 seconds.  For my apache httpd 
server, I'm setting KeepAliveTimeout to 65 and MaxKeepAliveRequests to 0 so 
that the server doesn't initiate connection resets to the browser.

Chris

On Thursday, February 21, 2013 5:27:44 PM UTC-5, GWTFan wrote:
>
> We are also experiencing this problem. 
> We use GWT 2.4 and Glassfish application server.
>
> NTLM is specific to Windows, But our app server runs on Linux, 
> Any suggestions on any other probable cause?
>
> Appreciate help!
>
>

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




modifiyng the header of a JsonpRequestBuilder

2013-08-12 Thread fatima zahra Anzour
hello everyone;
can someone help me with this issue please;
i'm using JsonpRequestBuilder to build request to Siasto api; im using 
jsonp as they recommand; but a have to make a  HTTP Basic Auth for 
authentification, which requieres setting some information in the header; 
but the JsonpRequestBuilder object dosen't have any method that allow 
setting the header;
can someone suggest me any somlution?
regards.

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




Re: encodedRequest cannot be empty

2013-08-12 Thread christopher . e . plummer
Old post, I know, but if anyone encounters this, there's more discussion 
about it here:

https://groups.google.com/forum/#!msg/google-web-toolkit/3sJkTjE4npk/EvPvDBnWwdQJ

>From what I've seen, it could either be an NTLM authentication issue, or a 
problem with IE sending partial requests after a TCP connection reset.

Chris

On Tuesday, February 24, 2009 11:51:56 AM UTC-5, Jason Brome wrote:
>
> I wanted to give everyone an update on this topic.  After doing 
> further analysis, and working with our customer, the cause of the 
> periodic empty requests was found to be a Microsoft Internet Security 
> and Acceleration (ISA) server.  The ISA server was recently 
> decommissioned, and since that time we have not experienced this 
> issue. 
>
> Jason

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




Re: gwt navigation with 3rd party app in iframe

2013-08-12 Thread Lance Frohman
I got the pages to not blink, but the back button does not work correctly,
you need to click it three times
to get to the page it should go to. It was doing this before I made your
fix.
thanks


On Fri, Aug 9, 2013 at 9:16 AM, Lance Frohman  wrote:

> Thank you.
>
>
> On Thursday, August 8, 2013 1:05:12 PM UTC-7, Jens wrote:
>>
>> You need to cache the activity that displays the 3rd party app so it does
>> not get recreated in your ActivityMapper each time you navigate inside the
>> 3rd party app. So your URLs should look like
>>
>> /#ThirdPartyAppPlace:app=page1
>> /#ThirdPartyAppPlace:app=**page2¶m=x
>> /#ThirdPartyAppPlace:app=page3
>>
>> and for each URL the same activity instance should be returned. You could
>> either code this caching into your AppActivityMapper directly or use GWT's
>> CachingActivityMapper together with GWT's FilteredActivityMapper to keep
>> your AppActivityMapper clean. If you choose to use GWT's ActivityMappers
>> you must implement hashcode/equals for your place because
>> CachingActivityMapper uses currentPlace.equals(newPlace) to determine if
>> the cached activity can be returned.
>>
>> At the end you will have something like new
>> FilteredActivityMapper(filter, new CachingActivityMapper(new
>> AppActivityMapper()); where "filter" transforms all your
>> ThirdPartyAppPlaces to an empty ThirdPartyAppPlace so that
>> CachingActivityMapper always sees equal places. Whenever the
>> CachingActivityMapper sees different places, it will ask your
>> AppActivityMapper for the new activity.
>>
>> -- J.
>>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Google Web Toolkit" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-web-toolkit/6U5rhALEomE/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to
> google-web-toolkit+unsubscr...@googlegroups.com.
> To post to this group, send email to google-web-toolkit@googlegroups.com.
> Visit this group at http://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

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




Re: gwt navigation with 3rd party app in iframe

2013-08-12 Thread Jens


> I got the pages to not blink, but the back button does not work correctly, 
> you need to click it three times
> to get to the page it should go to. It was doing this before I made your 
> fix.
>

Well thats expected as you update the URL whenever a navigation inside the 
3rd party app occurs. I thought this behavior is the one you already had 
but with blinking going on.

-- J.

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




Re: Dom change propagation time

2013-08-12 Thread Steve C
I've run into similar issues adding a style name to a widget and then 
immediately trying to read the class attribute of the element. I think that 
the issue is that while JS is single-threaded, the browser itself isn't 
required to be, and the effect of some JS statements can take time to 
complete within the browser's native code, even though the JS method 
returned immediately.

Try Scheduler.scheduleDeferred, which runs your code with a minimal timeout 
(basically what you did yourself -- your code should also work if you make 
the timeout just 1 millisecond).

On Monday, August 12, 2013 9:55:29 AM UTC-4, asif...@gmail.com wrote:
>
> Hi ,
>
> I am changing the id of an element in the dom with 
>
> tableeditor.getElement().setId("tableeditor");
>
> where 
> @UiField
> SimplePanel tableeditor;
>
> After this I call a javascript which manipulates the dom based on the 
> id=tableeditor.
>
> However, if I put a timeout of 1 sec after changing the dom id property, 
> the javascript works fine.
> IF I call the javascript immediately after the setId call, then two things 
> happen
>
> 1>. The id is not set.
> 2>. The javascript throws an exception since it is expecting the id to be 
> present.
>
> What is the reason of this behaviour? 
>
> I would prefer not putting a timer, unless there is no other way to make 
> this work.
>
> Regards
>

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


Generics, JSNI and Integer problem

2013-08-12 Thread Thomas Broyer
You need to wrap your int into a java.lang.Integer using its valueOf or new(). 
JSNI doesn't do auto-boxing/unboxing.

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




Proper Project Layout and CSS practices

2013-08-12 Thread Bob Spero
When creating a GWT project the CSS is associated with the entry point from 
the wizard. Is the proper framework to have a CSS file for every class that 
is a UI entry point or composite?

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




Re: change in children not saved in GWT 2.5.1 after implement OSIV

2013-08-12 Thread Matthew Pitts

On Friday, May 31, 2013 10:50:21 AM UTC-4, Yan wrote:
>
> Hi there, 
>
> I have a Parent object containing a list of Children objects. Both are 
> EntityProxy.  My RequestFactory API is to persist the Parent along with 
> Children collection.  My JPA layer is EclipseLink (JPA 1.0), with entity 
> manager cache ENABLED. 
>
> In UI, I change some property on children (without changing parent). When 
> the backend API is called, I expect to see that the Parent's children 
> objects will have the updates.
>
> In GWT 2.4.0, I do see that because GWT 2.4.0 sends the list of children 
> to server regardless.  In GWT 2.5.1, I see only the delta is sent across 
> the wire (this is correct), but in the backend, I do not see the children 
> collection with updates, that is incorrect. 
>
> I did implement one-entitymanager-per-request pattern based on a solution 
> someone offered on this group. I verified that only one instance of child 
> is created by JPA during the request. I also verified that GWT client is 
> correctly sending the delta to GWT server and setter methods are called on 
> JPA entity to set the correct value (after JPA loads children from 
> database). Afterwards, the setter is not called and no child object ever 
> created again. 
>
> However, when the code reaches the API (as seen in debugger), I do not see 
> the children objects has the updates. 
>
> Why is this?  GWT runtime is somehow loading the object from somewhere 
> else?
>
> Thanks,
> Yan
>

I believe I am having this same problem after upgrading to 2.5.1 and I 
would really appreciate some help with it. Here's some of the behavior I've 
seen:

 - changes made to existing child entities retrieved via .with("...") do 
not get persisted server-side when saving the parent entity
 - new child entities created and added to the collection within the parent 
do get persisted server-side when saving the parent entity
 - if a new child entities are created and added to the collection *and* 
changes are made to an existing child entity, then both the new and 
existing entity changes are persisted when saving the parent entity
 - deleting a child from the collection and saving the parent results in 
the corresponding server-side child object being deleted (when JPA 
orphanRemoval = true is used)
 - the above behavior has been observed on 2 different Proxy/Entity/Locator

I'll see if it's practical to put together a standalone project to 
duplicate the behavior. For now here is my architecture...

- JPA-based (with some Eclipselink-specific annotations sprinkled in) POJO 
entity hierarchy
- EJB3 layer using injected EntityManager instances for persistence 
operations (I've experimented with a mixture of @Stateless vs @Stateful but 
see no difference in behavior)
- Custom EntityServiceLocator used as 'locator' designation in all @Service 
annotations (provides static util methods to lookup EJBs via JNDI)
- per-Proxy-type Locator setup
- all running as web/ejb projects from monolithic ear in Glassfish 3.1 with 
EclipseLink 2.4.1

I've done some work to try and ensure I'm getting the 
EntityManager-per-request behavior I've read is necessary for RF to work 
properly, but I'm not confident I have it working.

Since I'm not sure of the intricacies of how RF uses Locators and how best 
to make them interact with EJBs I'm sure some of my architecture is 
non-optimal. But it was working quite well with GWT 2.4.

Any guidance in troubleshooting this is greatly appreciated.

Regards,
-matt

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




Re: What's the minimum number of interfaces and classes that I should need to create for a new RpcService?

2013-08-12 Thread Michael Prentice
OK, I've finally got some time to look at this again. But I'm still having 
some issues. Based on your feedback, I should eliminate the following two 
classes:

   - Class to represent the request and hold its DTO
   - Class to represent the response and hold its DTO

These currently both extend an abstract generic class (one implements 
Action and one implements Response). I haven't been able to make those 
classes generic enough that these 2 request/response classes can be removed.

I suppose that I may need to use GIN to make this happen, but I have not 
yet figured out if that would be required and/or how to do it yet.

*Here are the abstract classes:*

public abstract class CustomRequest implements 
Action>, Serializable
{
private static final long serialVersionUID = 2497682157216814807L;
 private T request;
 public void setRequest(T request)
{
this.request = request;
}
 public T getRequest()
{
return request;
}
}

public abstract class CustomResponse implements Response, Serializable
{
private static final long serialVersionUID = -7854717568064553824L;
private T response;
private String statusString = "";
private int msgStatus = 0;
 public T getResponse()
{
return response;
}
 public void setResponse(T response)
{
this.response = response;
}

// Getters and setters.
}

*Then the classes that extend these abstract req/response classes:*

public class Login extends CustomRequest
{
private static final long serialVersionUID = 2497682157216814807L;
 public Login() {}
public Login(MyLoginReqDto creds)
{
setRequest(creds);
}
}

public class LoginResponse extends CustomResponse
{
private static final long serialVersionUID = -7854717568064553824L;
public LoginResponse() {}
public LoginResponse(MyLoginReqDto creds)
{
setResponse(creds);
}
}

So obviously for each of my ~40 DTOs, I need to send/receive a different 
DTO. I'm not completely clear on how to do this while eliminating all 4 of 
the classes above.

*Here are my service interfaces:*

@RemoteServiceRelativePath("Login") 
public interface LoginService extends RemoteService
{
@SuppressWarnings("rawtypes")
CustomResponse sendRequest(Login req);
}

public interface LoginServiceAsync
{
void sendRequest(Login req, AsyncCallback> callback);
}

*And then my service implementation:*

public class LoginServiceImpl
extends CustomService implements LoginService
{
private static final long serialVersionUID = 8883630570739973203L;
public LoginResponse getDataFromJNI(Login req)
{
// custom code to deal with the backend data retrieval.
}
}

*Finally, my abstract service:*
*
*
public abstract class CustomService extends RemoteServiceServlet
{
 // static System.loadLibrary() call for JNI connection.

public RSP sendRequest(REQ req)
{
RSP response = null;
 try
{
if (jniConnection == null)
{
// custom JNI connection code.
}
 response = getDataFromJNI(req);
}
catch (Exception ex)
{
ex.printStackTrace();
}
 return response;
}

protected abstract RSP getDataFromJNI(REQ req);
}

So this does get my JNI connection code factored out into a single class. 
But it still is causing me to need to define a specific Request/Response 
for every service.

I'd love to have a single service handle all of the different DTOs with a 
single service implementation and various methods to handle each DTO. I'm 
just not clear on how I can make that happen and I'm running short on 
schedule time to be contemplating and researching. I've looked at a ton of 
examples online, but I haven't been able to find one that really maps to 
what I need and makes sense. I haven't found one that handles many 
different DTOs in a single service implementation.

Please let me know if I'm way off here. Is DI the way to solve all of this? 
Is it just a minor tweak to my classes? Or do I need to start from scratch 
with a whole new approach? If you have a link to a project or bit of code 
that already demonstrates this, I would love to see it.

Thank you,

Michael Prentice
GDG Space Coast
Hope to see you at http://gwtcreate.com/ in December!

On Saturday, August 3, 2013 5:18:21 AM UTC-4, Thomas Broyer wrote:
>
>
> How about using a single service/serviceAsync/serviceImpl for more than 
> one request/response/DTOs? Instead of "40 services" with all that 
> boilerplate, you'd *only* need 40 methods on a single *service*.
>

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




Re: What's the minimum number of interfaces and classes that I should need to create for a new RpcService?

2013-08-12 Thread Juan Pablo Gardella
Did you try gwt-distapch?


2013/8/12 Michael Prentice 

> OK, I've finally got some time to look at this again. But I'm still having
> some issues. Based on your feedback, I should eliminate the following two
> classes:
>
>- Class to represent the request and hold its DTO
>- Class to represent the response and hold its DTO
>
> These currently both extend an abstract generic class (one implements
> Action and one implements Response). I haven't been able to make those
> classes generic enough that these 2 request/response classes can be removed.
>
> I suppose that I may need to use GIN to make this happen, but I have not
> yet figured out if that would be required and/or how to do it yet.
>
> *Here are the abstract classes:*
>
> public abstract class CustomRequest implements
> Action>, Serializable
> {
> private static final long serialVersionUID = 2497682157216814807L;
>  private T request;
>  public void setRequest(T request)
> {
> this.request = request;
> }
>  public T getRequest()
> {
> return request;
> }
> }
>
> public abstract class CustomResponse implements Response, Serializable
> {
> private static final long serialVersionUID = -7854717568064553824L;
> private T response;
> private String statusString = "";
> private int msgStatus = 0;
>  public T getResponse()
> {
> return response;
> }
>  public void setResponse(T response)
> {
> this.response = response;
> }
>
> // Getters and setters.
> }
>
> *Then the classes that extend these abstract req/response classes:*
>
> public class Login extends CustomRequest
> {
> private static final long serialVersionUID = 2497682157216814807L;
>  public Login() {}
> public Login(MyLoginReqDto creds)
> {
> setRequest(creds);
> }
> }
>
> public class LoginResponse extends CustomResponse
> {
> private static final long serialVersionUID = -7854717568064553824L;
> public LoginResponse() {}
> public LoginResponse(MyLoginReqDto creds)
> {
> setResponse(creds);
> }
> }
>
> So obviously for each of my ~40 DTOs, I need to send/receive a different
> DTO. I'm not completely clear on how to do this while eliminating all 4 of
> the classes above.
>
> *Here are my service interfaces:*
>
> @RemoteServiceRelativePath("Login")
> public interface LoginService extends RemoteService
> {
> @SuppressWarnings("rawtypes")
> CustomResponse sendRequest(Login req);
> }
>
> public interface LoginServiceAsync
> {
> void sendRequest(Login req, AsyncCallback> callback);
> }
>
> *And then my service implementation:*
>
> public class LoginServiceImpl
> extends CustomService implements LoginService
> {
> private static final long serialVersionUID = 8883630570739973203L;
> public LoginResponse getDataFromJNI(Login req)
> {
> // custom code to deal with the backend data retrieval.
> }
> }
>
> *Finally, my abstract service:*
> *
> *
> public abstract class CustomService CustomResponse> extends RemoteServiceServlet
> {
>  // static System.loadLibrary() call for JNI connection.
>
> public RSP sendRequest(REQ req)
> {
> RSP response = null;
>  try
> {
> if (jniConnection == null)
> {
> // custom JNI connection code.
> }
>  response = getDataFromJNI(req);
> }
> catch (Exception ex)
> {
> ex.printStackTrace();
> }
>  return response;
> }
>
> protected abstract RSP getDataFromJNI(REQ req);
> }
>
> So this does get my JNI connection code factored out into a single class.
> But it still is causing me to need to define a specific Request/Response
> for every service.
>
> I'd love to have a single service handle all of the different DTOs with a
> single service implementation and various methods to handle each DTO. I'm
> just not clear on how I can make that happen and I'm running short on
> schedule time to be contemplating and researching. I've looked at a ton of
> examples online, but I haven't been able to find one that really maps to
> what I need and makes sense. I haven't found one that handles many
> different DTOs in a single service implementation.
>
> Please let me know if I'm way off here. Is DI the way to solve all of
> this? Is it just a minor tweak to my classes? Or do I need to start from
> scratch with a whole new approach? If you have a link to a project or bit
> of code that already demonstrates this, I would love to see it.
>
> Thank you,
>
> Michael Prentice
> GDG Space Coast
> Hope to see you at http://gwtcreate.com/ in December!
>
> On Saturday, August 3, 2013 5:18:21 AM UTC-4, Thomas Broyer wrote:
>>
>>
>> How about using a single service/serviceAsync/**serviceImpl for more
>> than one request/response/DTOs? Instead of "40 services" with all that
>> boilerplate, you'd *only* need 40 methods on a single *service*.
>>
>  --
> 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-tool

Re: GWT Header CheckBox requires two clicks to fire setValue, after changing its value programatically

2013-08-12 Thread Miloš Ranđelović
Sorry for the late reply (for some reason I did not receive an email 
notification), but I did manage to resolve the issue by creating checkbox 
cells in the table itself like this:

CheckboxCell cell = new CheckboxCell(true,true)

I've been focused on the header checkbox mostly and tried every possible 
combination of the two flags, but forgot to try the same on the checkbox 
cell in the grid, as a StackOverflow user pointed out in the topic I've 
opened there as well.

On Saturday, August 3, 2013 1:20:27 AM UTC+12, Thomas Broyer wrote:
>
> Any reason you don't simply use the default render() and onBrowserEvent 
> from Header?
> See https://code.google.com/p/google-web-toolkit/issues/detail?id=7014#c6for 
> details of how we did it; I suppose you could "package" it into a 
> Header subclass if you want.
>
> On Friday, August 2, 2013 3:06:52 AM UTC+2, Miloš Ranđelović wrote:
>>
>> I have a GWT DataGrid, and a CheckBox in the Header to select/deselect 
>> all rows in the grid.
>>
>> The code for the CheckBox Header is as follows:
>>
>>> private class CheckboxHeader extends Header implements 
>>> HasValue {
>>>
>>> private boolean checked;
>>> private HandlerManager handlerManager;
>>>
>>> /**
>>>  * An html string representation of a checked input box.
>>>  */
>>> private final SafeHtml INPUT_CHECKED = 
>>> SafeHtmlUtils.fromSafeConstant(">> checked/>");
>>> /**
>>>  * An html string representation of an unchecked input box.
>>>  */
>>> private final SafeHtml INPUT_UNCHECKED = 
>>> SafeHtmlUtils.fromSafeConstant(">> tabindex=\"-1\"/>");
>>>
>>> @Override
>>> public void render(Context context, SafeHtmlBuilder sb) {
>>> if (Boolean.TRUE.equals(this.getValue())) {
>>> sb.append(INPUT_CHECKED);
>>> } else {
>>> sb.append(INPUT_UNCHECKED);
>>> }
>>> };
>>>
>>> public CheckboxHeader() {
>>> super(new CheckboxCell(true, false));
>>> checked = true;
>>> }
>>>
>>> // This method is invoked to pass the value to the CheckboxCell's 
>>> render method
>>> @Override
>>> public Boolean getValue() {
>>> return checked;
>>> }
>>>
>>> @Override
>>> public void onBrowserEvent(Context context, Element elem, NativeEvent 
>>> nativeEvent) {
>>> int eventType = Event.as(nativeEvent).getTypeInt();
>>> if (eventType == Event.ONCHANGE) {
>>> nativeEvent.preventDefault();
>>> // use value setter to easily fire change event to handlers
>>> setValue(!checked, true);
>>> }
>>> }
>>>
>>> @Override
>>> public HandlerRegistration 
>>> addValueChangeHandler(ValueChangeHandler handler) {
>>> return 
>>> ensureHandlerManager().addHandler(ValueChangeEvent.getType(), handler);
>>> }
>>>
>>> @Override
>>> public void fireEvent(GwtEvent event) {
>>> ensureHandlerManager().fireEvent(event);
>>> }
>>>
>>> @Override
>>> public void setValue(Boolean value) {
>>> setValue(value, true);
>>> }
>>>
>>> @Override
>>> public void setValue(Boolean value, boolean fireEvents) {
>>> checked = value;
>>> if (fireEvents) {
>>> ValueChangeEvent.fire(this, value);
>>> }
>>> }
>>>
>>> private HandlerManager ensureHandlerManager() {
>>> if (handlerManager == null) {
>>> handlerManager = new HandlerManager(this);
>>> }
>>> return handlerManager;
>>> }
>>> }
>>>
>>>
>> So, I add the Header to the grid, and I add a ValueChangeHandler to it 
>> to do the actual selecting/deselecting of individual CheckBox cells in 
>> every row of the grid. This all works.
>>
>> Every CheckBoxCell has a Field Updater, and on every update it loops 
>> through every item in the grid to see if they are all checked, and update 
>> the header check box. If at least one is unchecked, the header checkbox 
>> will be unchecked. I call setValue() on the header check box, and after 
>> that I call redrawHeaders() on the entire grid. This also works.
>>
>> What doesn't work is - after changing the "state" of the header check box 
>> programatically, it takes two clicks for it to fire it's internal setValue 
>> again, and therefore trigger my handler. And what's even funnier - the 
>> first click *does* change the state of the check box, but it just 
>> doesn't fire the event.
>> Any help would be appreciated. 
>>
>

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


Re: What's the minimum number of interfaces and classes that I should need to create for a new RpcService?

2013-08-12 Thread Jens
Looks a lot like command pattern. You should really think about if you 
really need that pattern. It often sounds nice but it always results in 
lots of classes. Just to illustrate:

interface LoginService extends RemoteService {
  UserInformationDto login(String user, pass) throws 
InvalidCredentialsException;
  boolean isLoggedIn(String token);
}

Applying the command pattern to the above straight forward service will 
result in 2 commands, 2 responses, 2 handlers and 1 dispatch service that 
takes any command, performs some common tasks and finally dispatches the 
command to its responsible handler (in your case you sub class'ed your 
abstract service which would be equivalent to having handlers, although in 
your case you need to create the client service interfaces as well). So 
basically each remote method call will become 3 classes (input, output, 
handler). With a bit of thought and a bit of reflection you can reduce the 
amount of classes a bit but its like a water drop on a hot stone.

I have one project that uses the command pattern and I tell you I don't 
want to count the amount of classes related to this pattern. But the 
pattern also provides a lot of compelling benefits and depending on the 
requirements it can be a good fit.

If you want to go the command pattern route then take a look at 
gwt-dispatch or at least 
read https://code.google.com/p/gwt-dispatch/wiki/GettingStarted to get the 
idea on how to reduce the amount of classes used in your current solution.

-- J.

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




GWT app kills Chrome & Opera on Windows when idle

2013-08-12 Thread Miloš Ranđelović
Hi all,

I am working on a fairly complex GWT app, the primary target browser being 
an SQLite powered one (with Chrome being the recommended one). 

When the application is running idle in the browser, after an undefined 
period of time (usually after 1-2 hours) the browser tab in Chrome crashes 
(showing the "Aw, snap"). This happens in Opera as well, but not Safari 
(although Safari on Windows is discontinued anyway). And also to be noted - 
this only happens in Windows, on the Mac OS X the app can run for as long 
as necessary.

I know Chrome had some issues with the GPU drivers under Windows, so I have 
tried many different options in Chrome - turning off sandbox, reduced GPU 
sandbox, no GPU, even ran it in safe mode with networking, but nothing 
seems to help - the app would inevitably crash.

First I thought it was a browser issue, but after seeing the crash in Opera 
as well (plus, all other websites seem to work normally), I eliminated that 
possibility and am fairly confident that something inside GWT triggers it.

I have enabled logging and crash reporting in Chrome, installed Sawbuck, 
and went through heaps of log messages, but cannot find a pattern. After 
the app goes idle, only the Chrome updater and SafeBrowsingCheck messages 
(tried to turn that off as well) are showing up, with nothing coming out 
just before the crash.

I do not have any Scheduler activities in the background.

The only thing I can think of is that we moved to GWT 2.5.1 recently (from 
2.5.0), so we are going to revert back and deploy to another test server to 
see how it goes, but I would not hold on to that as a long term solution 
even if it "solves" our problems.

This is a deal breaker for the app and any help or guidance would be highly 
appreciated.

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




Re: GWT app kills Chrome & Opera on Windows when idle

2013-08-12 Thread Miloš Ranđelović
Just to note, Firefox or IE are out of the question as the app depends on 
the in-browser SQLite database to function.

I've also tried Chromium, but the same thing happens.

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


Re: What's the minimum number of interfaces and classes that I should need to create for a new RpcService?

2013-08-12 Thread Michael Prentice
I looked through gwt-dispatch and its source code today but it wasn't clear 
that I would really be saving anything beyond what I have now, mostly just 
the classes and names would change. I'll take a look at the Getting Started 
Wiki, thanks.

Yes, we are completely command pattern based on the back end (C reached 
through JNI) so doing the services in command pattern makes obvious sense. 
Every one of my DTOs maps directly to a command on the backend.

On Monday, August 12, 2013 7:45:08 PM UTC-4, Jens wrote:
>
> Looks a lot like command pattern. You should really think about if you 
> really need that pattern. It often sounds nice but it always results in 
> lots of classes. Just to illustrate:
>
> interface LoginService extends RemoteService {
>   UserInformationDto login(String user, pass) throws 
> InvalidCredentialsException;
>   boolean isLoggedIn(String token);
> }
>
> Applying the command pattern to the above straight forward service will 
> result in 2 commands, 2 responses, 2 handlers and 1 dispatch service that 
> takes any command, performs some common tasks and finally dispatches the 
> command to its responsible handler (in your case you sub class'ed your 
> abstract service which would be equivalent to having handlers, although in 
> your case you need to create the client service interfaces as well). So 
> basically each remote method call will become 3 classes (input, output, 
> handler). With a bit of thought and a bit of reflection you can reduce the 
> amount of classes a bit but its like a water drop on a hot stone.
>
> I have one project that uses the command pattern and I tell you I don't 
> want to count the amount of classes related to this pattern. But the 
> pattern also provides a lot of compelling benefits and depending on the 
> requirements it can be a good fit.
>
> If you want to go the command pattern route then take a look at 
> gwt-dispatch or at least read 
> https://code.google.com/p/gwt-dispatch/wiki/GettingStarted to get the 
> idea on how to reduce the amount of classes used in your current solution.
>
> -- J.
>
>

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




Re: Export CellTable's selected rows into a csv file

2013-08-12 Thread Winnie T
Oh I see. I did something like this (below), wonder if you can spot the 
error when I handle the results that is being passed to the library

try {
session.beginTransaction( );   
// I am using hibernate session
Criteria criteria = session.createCriteria(Book.class); 
  // Create criteria to filter base on the type of 
search
criteria.add(Restrictions.like(field,"%" + search + 
"%").ignoreCase());

   bookList = criteria.list( ); 
   //Call the search results to a list
String[] bookArray = new String[bookList.size()];   
 // Dump the result list into an string array (as 
CSVWriter could only take in string array, not list)
CSVWriter writer = new CSVWriter(new FileWriter("export.csv"), 
'\t');   // Using OpenCSV library to write a new file export.csv
writer.writeNext(bookArray);   
  // Writes the string array line by line into 
export.csv   
writer.close();

session.getTransaction().commit();
return bookList;// return 
the search results to a cell table for displaying 

} catch (HibernateException e) {
log("Failed to retrie ve profile information from the 
database", e);
throw new RuntimeException("Failed to retrieve profile 
information from the database");
} catch (IOException e) {
e.printStackTrace();  //To change body of catch statement use 
File | Settings | File Templates.
}
return null;   //requires a return which I am not sure why
}

Thank you!! =)

Winnie

On Monday, August 12, 2013 7:49:39 PM UTC+8, Thad Humphries wrote:
>
> No, I was just saying how I did it. As I recall--it's been several 
> years--I first used OpenCSV but switched to Apache's CSV because it also 
> had a tab delimited option (though I guess you can do the same thing with 
> OpenCSV by changing the delimiters). 
>
> If your file is empty, I'd check your file calls, not the CSV library: Is 
> the file opened for writing, is the file handle properly passed to the 
> library, is the data still there to write, is the output properly flushed, 
> and is the file closed. I'd write something to the file before and after my 
> CVS calls to see if anything gets written. And I'd check the file on the 
> server, not just what my servlet returns.
>
> On Sunday, August 11, 2013 10:32:23 PM UTC-4, Winnie T wrote:
>>
>> Hi Thad, thanks for responding. Currently, I tried using OpenCSV, and had 
>> successfully create a CSV file when I click the export button, but the CSV 
>> file was empty. Do you meant that I could use Apache Commons instead of 
>> OpenCSV?
>>
>> On Thursday, August 8, 2013 10:27:06 PM UTC+8, Thad Humphries wrote:
>>>
>>> If your server side still has a copy of your list, you can send 
>>> references to the rows by row number (i thru n) or some sort of row id set 
>>> in a servlet call. The servlet could build the CSV (Apache Commons has a 
>>> CSV module) and return it to the browser with the MIME text/csv so the 
>>> browser could decide what to do with it. You'll have to target your servlet 
>>> at a _blank page or an IFRAME to prevent stomping on your GWT app.
>>>
>>> On Thursday, February 3, 2011 2:42:26 AM UTC-5, Ido wrote:

 Well, the server side which should populate the csv file is the server 
 package within the GWT project.
 I'm not using any external backend to populate the csv file.
 When mentioned sending list of objects using RPC I meant using the 
 RemoteServiceServlet.

 Once my "server" get's this list , it should create a csv out of it and 
 *somehow* send it to the client.
 Just can't figure how to do so.
 Maybe the server should return the user a path to the created file, but 
 then what?
 Maybe new servlet should be created to handle this kind of action, but 
 how can I send the list of the selected objects?







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




Re: Export CellTable's selected rows into a csv file

2013-08-12 Thread Thad Humphries
On Tuesday, August 13, 2013 12:35:00 AM UTC-4, Winnie T wrote:

> Oh I see. I did something like this (below), wonder if you can spot the 
> error when I handle the results that is being passed to the library
>
> try {
> session.beginTransaction( );   
> // I am using hibernate session
> Criteria criteria = session.createCriteria(Book.class);   
> // Create criteria to filter base on the type of 
> search
> criteria.add(Restrictions.like(field,"%" + search + 
> "%").ignoreCase());
>
>bookList = criteria.list( );   
>  //Call the search results to a list
> String[] bookArray = new String[bookList.size()]; 
>// Dump the result list into an string array (as 
> CSVWriter could only take in string array, not list)
>

*All the statement above is doing is allocating an array of Strings. It's 
not writing anything to that array. Two lines later (see below), you write 
an empty array. Ergo, the file is empty. You need to copy the contents of 
bookList into bookArray.*
 

> CSVWriter writer = new CSVWriter(new FileWriter("export.csv"), 
> '\t');   // Using OpenCSV library to write a new file export.csv
> writer.writeNext(bookArray);   
>   // Writes the string array line by line into 
> export.csv   
> writer.close();
>
> session.getTransaction().commit();
> return bookList;// return 
> the search results to a cell table for displaying 
>
> } catch (HibernateException e) {
> log("Failed to retrie ve profile information from the 
> database", e);
> throw new RuntimeException("Failed to retrieve profile 
> information from the database");
> } catch (IOException e) {
> e.printStackTrace();  //To change body of catch statement use 
> File | Settings | File Templates.
> }
> return null;   //requires a return which I am not sure why
> }
>
> Thank you!! =)
>
> Winnie
>
> On Monday, August 12, 2013 7:49:39 PM UTC+8, Thad Humphries wrote:
>>
>> No, I was just saying how I did it. As I recall--it's been several 
>> years--I first used OpenCSV but switched to Apache's CSV because it also 
>> had a tab delimited option (though I guess you can do the same thing with 
>> OpenCSV by changing the delimiters). 
>>
>> If your file is empty, I'd check your file calls, not the CSV library: Is 
>> the file opened for writing, is the file handle properly passed to the 
>> library, is the data still there to write, is the output properly flushed, 
>> and is the file closed. I'd write something to the file before and after my 
>> CVS calls to see if anything gets written. And I'd check the file on the 
>> server, not just what my servlet returns.
>>
>> On Sunday, August 11, 2013 10:32:23 PM UTC-4, Winnie T wrote:
>>>
>>> Hi Thad, thanks for responding. Currently, I tried using OpenCSV, and 
>>> had successfully create a CSV file when I click the export button, but the 
>>> CSV file was empty. Do you meant that I could use Apache Commons instead of 
>>> OpenCSV?
>>>
>>> On Thursday, August 8, 2013 10:27:06 PM UTC+8, Thad Humphries wrote:

 If your server side still has a copy of your list, you can send 
 references to the rows by row number (i thru n) or some sort of row id set 
 in a servlet call. The servlet could build the CSV (Apache Commons has a 
 CSV module) and return it to the browser with the MIME text/csv so the 
 browser could decide what to do with it. You'll have to target your 
 servlet 
 at a _blank page or an IFRAME to prevent stomping on your GWT app.

 On Thursday, February 3, 2011 2:42:26 AM UTC-5, Ido wrote:
>
> Well, the server side which should populate the csv file is the server 
> package within the GWT project.
> I'm not using any external backend to populate the csv file.
> When mentioned sending list of objects using RPC I meant using the 
> RemoteServiceServlet.
>
> Once my "server" get's this list , it should create a csv out of it 
> and *somehow* send it to the client.
> Just can't figure how to do so.
> Maybe the server should return the user a path to the created file, 
> but then what?
> Maybe new servlet should be created to handle this kind of action, but 
> how can I send the list of the selected objects?
>
>
>
>
>
>

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

Re: GWT app kills Chrome & Opera on Windows when idle

2013-08-12 Thread Miloš Ranđelović
Unfortunately, I cannot edit the subject, but it has gone wild on OS X as 
well, so the issue is not limited to Windows only. Will try and do some 
testing on Linux.

Anyway, after closely monitoring the system - when you leave the app 
running idle, after some period of time the CPU goes 100%, and RAM usage 
increases... ultimately causing it to crash, probably when it hits the 
limit. After that, CPU and RAM usage return to normal.

Once again, the app is idle, we've monitored the network and no server 
requests were made.

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




Problem with setting some information in the header of the request

2013-08-12 Thread fatima zahra Anzour
hello everyone;
can someone help me with this issue please;
i'm using JsonpRequestBuilder to build request to Siasto api (for a mgwt 
projetc); im using json as they describe (https://www.siasto.com/api) ; but 
a have to make a  HTTP Basic Auth for authentification, which requieres 
setting some information in the header; but the JsonpRequestBuilder object 
dosen't have any method that allow setting the header;
can someone suggest me any solution?
or have i to give up using JsonpRequestBuilder ?
regards.

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