Re: how to type text on canvas selection after icon bar

2013-04-22 Thread Philippe Lhoste

On 18/04/2013 12:48, anshul singhal wrote:

I want to draw  text input   on canvas as like in ms paint . I have a canvas in 
GWT
containing toolbar  (like ms paint) when  i click on A  icon of the toolbar  
,if any one
type any things on canvas text should be display on canvas.

Could you please let me know how i can do this in  GWT.


There are several ways, from doing everything in canvas (perhaps there are UI libraries 
for the canvas, or manage key strokes and corresponding display) to overlaying an HTML 
input text box over the canvas to get the text input with all the power of the browser's 
native control.


--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --

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




In GWT, ListHandlerListString columnSortHandler does not sort properly

2013-04-22 Thread Henry
I got these code:

ListHandlerListString columnSortHandler = new ListHandlerListString(
list);
columnSortHandler.setComparator(nameColumn,
new ComparatorListString() {
  public int compare(ListString o1, ListString o2) {
if (o1 == o2) {
  return 0;
}

// Compare the name columns.
if (o1 != null) {
  return (o2 != null) ? o1.get(0).compareTo(o2.get(0)) 
: 1;
}
return -1;
  }
});

table.addColumnSortHandler(columnSortHandler);

When sorting column contains iPhone 1, iPhone 2, iPhone 3... then it sorts 
correctly ie, iPhone 1, iPhone 2, iPhone 3 for ascending  iPhone 3, iPhone 2, 
iPhone 1 for decending

But when sorting column contains:


1.92 MP 
3.15 MP AF 0.31 MP 
3.2 MP 
5 MP AF and flash 
1.3 MP 
1.3 MP 
2 MP (rear); 0.3 MP (front) 
1.92 MP AF with flash (rear)

it follows no correct order, it didn't even put the 2 1.3 MP cell next to 
each other. The correct order for the above list should be: 
1.3 MP 
1.3 MP 
1.92 MP 
1.92 MP AF with flash (rear) 
2 MP (rear); 0.3 MP (front) 
3.15 MP AF 0.31 MP 
3.2 MP 
5 MP AF and flash

Is there anything wrong with the code above?

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




In GWT, ListHandlerListString columnSortHandler does not sort properly

2013-04-22 Thread Henry
I got these code:
////
 ListHandlerListString columnSortHandler = new 
ListHandlerListString(
list);
columnSortHandler.setComparator(nameColumn,
new ComparatorListString() {
  public int compare(ListString o1, ListString o2) {
if (o1 == o2) {
  return 0;
}

// Compare the name columns.
if (o1 != null) {
  return (o2 != null) ? 
o1.get(0).compareTo(o2.get(0)) : 1;
}
return -1;
  }
});

table.addColumnSortHandler(columnSortHandler);

////

When sorting column contains iPhone 1, iPhone 2, iPhone 3... then it sorts 
correctly ie, iPhone 1, iPhone 2, iPhone 3 for ascending  iPhone 3, iPhone 
2, iPhone 1 for decending

But when sorting column contains:

1.92 MP 
3.15 MP AF 0.31 MP 
3.2 MP 
5 MP AF and flash 
1.3 MP 
1.3 MP 
2 MP (rear); 0.3 MP (front) 
1.92 MP AF with flash (rear)

it follows no correct order, it didn't even put the 2 1.3 MP cell next to 
each other. The correct order for the above list should be: 
1.3 MP 
1.3 MP 
1.92 MP 
1.92 MP AF with flash (rear) 
2 MP (rear); 0.3 MP (front) 
3.15 MP AF 0.31 MP 
3.2 MP 
5 MP AF and flash

Is there anything wrong with the code above?

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




Re: NumberFormat output wrong?

2013-04-22 Thread Philippe Lhoste

On 16/04/2013 18:43, Thad wrote:

NumberFormat has not worked the way I expected
(see 
https://groups.google.com/d/msg/google-web-toolkit/zlbRIhTKqrA/cyjaDB12K6UJ for 
an
experience with devmode vs production).

On Monday, April 15, 2013 3:29:30 PM UTC-4, Patrick Tucker wrote:

Today I noticed that the output of my NumberFormat (GWT 2.5.0) is not what 
I thought
it had been set to.  So I played with it a little and found the output to 
be inconsistent.
The formats:

1: NumberFormat.getFormat(#,###.##)
2: NumberFormat.getFormat(#,###.00)
3: NumberFormat.getFormat(#,##0.00)

The output is as follows:

1: 3.57, 0.98, 0.6
2: 3.57, .98, .60
3: 3.57, 0.98, 0.60

  The NumberFormat class doc states the following:

0 Number Yes Digit
# Number Yes Digit, zero shows as absent

According to the doc comments, show above, I was expect the following 
output for each
format:

1: 3.57, .98, .6
2: 3.57, .98, .60
3: 3.57, 0.98, 0.60

  What going on here?  The output for 1 should not have the leading 0, just 
like the
2nd format.


The zero shows as absent indication is terse and vague... We can suppose it is about 
non-significant zeroes, but it is better if explicitly stated!


Just note that Java's DecimalFormat just acts the same:

DecimalFormat[] nfs =
{
new DecimalFormat(#,###.##),
new DecimalFormat(#,###.00),
new DecimalFormat(#,##0.00)
};
double[] vals = { 3.57, 0.98, 0.6 };
for (DecimalFormat nf : nfs)
  for (double v : vals)
System.out.println(nf.format(v));

==

3,57
0,98
0,6
3,57
,98
,60
3,57
0,98
0,60

(French locale!)
I am not sure how to interpret that when reading the JavaDoc...

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --

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




Re: In GWT, ListHandlerListString columnSortHandler does not sort properly

2013-04-22 Thread Philippe Lhoste

On 22/04/2013 10:44, Henry wrote:

I got these code:
////
  ListHandlerListString columnSortHandler = new 
ListHandlerListString(
 list);
 columnSortHandler.setComparator(nameColumn,
 new ComparatorListString() {
   public int compare(ListString o1, ListString o2) {
 if (o1 == o2) {
   return 0;
 }

 // Compare the name columns.
 if (o1 != null) {
   return (o2 != null) ? o1.get(0).compareTo(o2.get(0)) 
: 1;
 }
 return -1;
   }
 });

 table.addColumnSortHandler(columnSortHandler);

////

[...]

Is there anything wrong with the code above?


public int compare(ListString o1, ListString o2) {
return o1.get(0).compareTo(o2.get(0));
}

But in this case, the default comparator provided by GWT will do the same job.
I did that for a numerical comparison of values with units, for example:

@Override
public int compare(ListString o1, ListString o2)
{
String v1 = o1.get(columnIndex);
String v2 = o2.get(columnIndex);
double d1 = DataService.parseValue(v1);
double d2 = DataService.parseValue(v2);
if (d1 == 0  d2 == 0)
return v1.compareTo(v2); // String comparison
return Double.compare(d1, d2);
}

The DataService.parseValue() parses the double at the start of the string, stopping on the 
unit symbol.

The columnIndex is a member of my Comparator, since we do the same sorting for 
all columns.

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --

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




Re: Problem in accessing constants on server side in Properties file

2013-04-22 Thread Jens
First make sure that your properties file is part of your *.war file to 
make the file available on the server and then load it using Java's 
Properties class, e.g.

Properties properties = new Properties();
properties.load(getClass().getResourceAsStream(fileName));

If you use Guava you can also convert it into an ImmutableMap by adding

ImmutableMapString, String immutableConstantsMap = 
Maps.fromProperties(properties);

-- J.

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




Re: IE10 support in Gwt

2013-04-22 Thread Honza Rames
It does but out of curiosity, if I add IE10 permutation/browser detection 
to UserAgent.gwt.xml to which value should I set the property-fallback? I 
mean is property fallback-recursive (I would assume it is) so setting it to 
IE9 should work? In case IE9 rule isn't specified it will recursively 
fallback to IE8 (and generate a compiler warning) right?

On Wednesday, April 17, 2013 12:40:04 AM UTC+2, Thomas Broyer wrote:



 On Tuesday, April 16, 2013 2:07:34 PM UTC+2, Mariusz Magdziarz wrote:

 When you add support for IE10??


 AFAIK, IE10 works OK with the ie9 permutation.
 Vaadin has started working on bringing MSPointerEvents to support 
 touch-enabled (and touch-only) devices.


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




Re: FormPanel.SubmitEvent cancel not working

2013-04-22 Thread Honza Rames
I tried this just out of curiosity last week and it worked (in FF I didn't 
test any other browsers). But since I'm using SuperDev mode this issue 
isn't a problem ;-)

On Thursday, April 18, 2013 11:13:25 AM UTC+2, Thomas Broyer wrote:



 On Thursday, April 18, 2013 9:30:51 AM UTC+2, Honza Rames wrote:

 A little out-of-time response but since this problem still exists in 2.5 
 I think it's worth sharing another solution. 

 If you put javascript: into form's action attribute, nothing will 
 happen even if the event is not canceled. I know this isn't helpful in 
 cases where you need to validate the form, but in case you (like me) are 
 preventing the form submit to send the data using GWT RPC instead of the 
 POST to take advantage of the browser's password remembering feature (I'm 
 wrapping FormPanel around already existing form) this is actually helpful.


 Last time I tried, you had to let the submission go through, so you'd have 
 to use action=javascript:foo() and expose a method as $wnd.foo via JSNI 
 where you'd do your RPC.
 That was 4 years ago though! 
 https://groups.google.com/d/topic/google-web-toolkit/KyzgtqqoJGE/discussion
  


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




Re: Problem in accessing constants on server side in Properties file

2013-04-22 Thread Thomas Broyer


On Monday, April 22, 2013 11:42:15 AM UTC+2, Jens wrote:

 First make sure that your properties file is part of your *.war file to 
 make the file available on the server and then load it using Java's 
 Properties class, e.g.

 Properties properties = new Properties();
 properties.load(getClass().getResourceAsStream(fileName));


As properties files are encoded in UTF-8, and Properties defaults to 
ISO-8859-1, you have to use the load(Reader) method:

properties.load(new 
InputStreamReader(getClass(),getResourceAsStream(fileName), 
StandardCharsets.UTF_8)));

Note that GWT.create(MyConstants.class) should be usable on the server-side 
in GWT 2.6 (not sure it'll make it, could possibly be GWT 2.7)

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




Re: In GWT, ListHandlerListString columnSortHandler does not sort properly

2013-04-22 Thread Tom
Your code didn't work, beside it got the problem for non-digit string. Ex: 
if i sort this list:
  Full slide-out QWERTY
  Full QWERTY
  Full QWERTY
  Numeric with T9 multimedia
  Soft QWERTY
  Slide-out QWERTY
  Full QWERTY
  Full QWERTY
  Slide-out QWERTY
 
It still didn't show the correct result.

Note: for this table, I have to add the columns dynamically, so i use 
ListString for column, not just String.


On Monday, April 22, 2013 7:19:41 PM UTC+10, PhiLho wrote:

 On 22/04/2013 10:44, Henry wrote: 
  I got these code: 
  //// 
ListHandlerListString columnSortHandler = new 
 ListHandlerListString( 
   list); 
   columnSortHandler.setComparator(nameColumn, 
   new ComparatorListString() { 
 public int compare(ListString o1, ListString 
 o2) { 
   if (o1 == o2) { 
 return 0; 
   } 
  
   // Compare the name columns. 
   if (o1 != null) { 
 return (o2 != null) ? 
 o1.get(0).compareTo(o2.get(0)) : 1; 
   } 
   return -1; 
 } 
   }); 
  
   table.addColumnSortHandler(columnSortHandler); 
  
  //// 
 [...] 
  Is there anything wrong with the code above? 

 public int compare(ListString o1, ListString o2) { 
  return o1.get(0).compareTo(o2.get(0)); 
 } 

 But in this case, the default comparator provided by GWT will do the same 
 job. 
 I did that for a numerical comparison of values with units, for example: 

 @Override 
 public int compare(ListString o1, ListString o2) 
 { 
  String v1 = o1.get(columnIndex); 
  String v2 = o2.get(columnIndex); 
  double d1 = DataService.parseValue(v1); 
  double d2 = DataService.parseValue(v2); 
  if (d1 == 0  d2 == 0) 
  return v1.compareTo(v2); // String comparison 
  return Double.compare(d1, d2); 
 } 

 The DataService.parseValue() parses the double at the start of the string, 
 stopping on the 
 unit symbol. 
 The columnIndex is a member of my Comparator, since we do the same sorting 
 for all columns. 

 -- 
 Philippe Lhoste 
 --  (near) Paris -- France 
 --  http://Phi.Lho.free.fr 
 --  --  --  --  --  --  --  --  --  --  --  --  --  -- 



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




Re: In GWT, ListHandlerListString columnSortHandler does not sort properly

2013-04-22 Thread Tom
Note: for this table, I have to add the columns dynamically, so i use 
ListString for column, not just String.

On Monday, April 22, 2013 6:44:32 PM UTC+10, Tom wrote:

 I got these code:
 ////
  ListHandlerListString columnSortHandler = new 
 ListHandlerListString(
 list);
 columnSortHandler.setComparator(nameColumn,
 new ComparatorListString() {
   public int compare(ListString o1, ListString o2) 
 {
 if (o1 == o2) {
   return 0;
 }

 // Compare the name columns.
 if (o1 != null) {
   return (o2 != null) ? 
 o1.get(0).compareTo(o2.get(0)) : 1;
 }
 return -1;
   }
 });

 table.addColumnSortHandler(columnSortHandler);

 ////

 When sorting column contains iPhone 1, iPhone 2, iPhone 3... then it sorts 
 correctly ie, iPhone 1, iPhone 2, iPhone 3 for ascending  iPhone 3, iPhone 
 2, iPhone 1 for decending

 But when sorting column contains:

 1.92 MP 
 3.15 MP AF 0.31 MP 
 3.2 MP 
 5 MP AF and flash 
 1.3 MP 
 1.3 MP 
 2 MP (rear); 0.3 MP (front) 
 1.92 MP AF with flash (rear)

 it follows no correct order, it didn't even put the 2 1.3 MP cell next 
 to each other. The correct order for the above list should be: 
 1.3 MP 
 1.3 MP 
 1.92 MP 
 1.92 MP AF with flash (rear) 
 2 MP (rear); 0.3 MP (front) 
 3.15 MP AF 0.31 MP 
 3.2 MP 
 5 MP AF and flash

 Is there anything wrong with the code above?


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




Re: In GWT, ListHandlerListString columnSortHandler does not sort properly

2013-04-22 Thread Tom
I gorgot to say that this code  isinside a loop,  hat may cause the 
problem?
 columnSortHandler.setComparator(nameColumn, 
  new ComparatorListString() { 
public int compare(ListString o1, ListString 
o2) { 
  if (o1 == o2) { 
return 0; 
  } 
 
  // Compare the name columns. 
  if (o1 != null) { 
return (o2 != null) ? 
o1.get(0).compareTo(o2.get(0)) : 1; 
  } 
  return -1; 
} 
  }); 


On Monday, April 22, 2013 6:44:32 PM UTC+10, Tom wrote:

 I got these code:
 ////
  ListHandlerListString columnSortHandler = new 
 ListHandlerListString(
 list);
 columnSortHandler.setComparator(nameColumn,
 new ComparatorListString() {
   public int compare(ListString o1, ListString o2) 
 {
 if (o1 == o2) {
   return 0;
 }

 // Compare the name columns.
 if (o1 != null) {
   return (o2 != null) ? 
 o1.get(0).compareTo(o2.get(0)) : 1;
 }
 return -1;
   }
 });

 table.addColumnSortHandler(columnSortHandler);

 ////

 When sorting column contains iPhone 1, iPhone 2, iPhone 3... then it sorts 
 correctly ie, iPhone 1, iPhone 2, iPhone 3 for ascending  iPhone 3, iPhone 
 2, iPhone 1 for decending

 But when sorting column contains:

 1.92 MP 
 3.15 MP AF 0.31 MP 
 3.2 MP 
 5 MP AF and flash 
 1.3 MP 
 1.3 MP 
 2 MP (rear); 0.3 MP (front) 
 1.92 MP AF with flash (rear)

 it follows no correct order, it didn't even put the 2 1.3 MP cell next 
 to each other. The correct order for the above list should be: 
 1.3 MP 
 1.3 MP 
 1.92 MP 
 1.92 MP AF with flash (rear) 
 2 MP (rear); 0.3 MP (front) 
 3.15 MP AF 0.31 MP 
 3.2 MP 
 5 MP AF and flash

 Is there anything wrong with the code above?


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




Re: In GWT, ListHandlerListString columnSortHandler does not sort properly

2013-04-22 Thread Philippe Lhoste

On 22/04/2013 12:42, Tom wrote:

Your code didn't work, beside it got the problem for non-digit string. Ex: if i 
sort this


Which one? The numerical comparison was shown only to illustrate how to do a 
non-trivial sort.
The first one was to show you complicated too much the comparison method, it can be much 
simpler.

Note that your method as well as mine only sort the first column of the table.
As shown in the second method, if you plan to sort another column, you have to provide its 
index to get the data at the proper place.


--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --

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




Regarding JSONP requests, duplicate requests and an error.

2013-04-22 Thread Mohammad Al-Quraian
I noticed that the browser is sending what it seems to be duplicate 
requests, I'm not sure if it's a thing in my code or not:

Here is a sample of the requests:
http://gdata.youtube.com/feeds/api/videos/02HCaj9h8Lo?v=2alt=jsoncallback=__gwt_jsonp__.P8.onSuccess
http://gdata.youtube.com/feeds/api/videos/02HCaj9h8Lo?v=2alt=jsoncallback=__gwt_jsonp__.P7.onSuccess
http://gdata.youtube.com/feeds/api/videos/02HCaj9h8Lo?v=2alt=jsoncallback=__gwt_jsonp__.P6.onSuccess

All with the same exact content!

This is my code for the jsonprequest builder:

public void getVideo(final String url,
final AsyncCallbackYoutubeVideoData async) {
String reqUrl;
 reqUrl = http://gdata.youtube.com/feeds/api/videos/; + id + 
?v=2alt=json;

requestBuilder.requestObject(URL.encode(reqUrl),
new AsyncCallbackYoutubeVideoData() {
public void onFailure(Throwable caught) {
async.onFailure(caught);
}
public void onSuccess(YoutubeVideoData result) {
async.onSuccess(result);
}
});
}

Also, I'm getting this error for including a frame of a different domain:
Unsafe JavaScript attempt to access frame with URL 
http://127.0.0.1:/Mobaraty.html?gwt.codesvr=127.0.0.1:9997#AddContentfrom 
frame with URL 
http://www.youtube.com/embed/02HCaj9h8Lo?wmode=transparentrel=0autohide=1showinfo=0.
 
Domains, protocols and ports must match.

I included this in my module file, but it didn't help:
add-linker name=xsiframe /

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




Re: Query Regarding MVP architecture

2013-04-22 Thread Philippe Lhoste

On 17/04/2013 16:43, Ümit Seren wrote:

I would recommend to use MVP even when dealing only with one form factor. In 
the long run
it makes maintaining the code much easier than it would be with simple widgets


And easier to test, too...

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --

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




Re: Encoding/decoding POJO to JSON

2013-04-22 Thread Philippe Lhoste

On 16/04/2013 18:47, Thad wrote:

I've tried using AutoBeans, which encode just fine, but it seems they do 
not support
inheritance. RestyGWT supports inheritance, but only works on the client 
side. GSON
only works on the server side. Is there one library to rule them all, or do 
I need to
use different libraries for client and server side processing?


We use RestyGWT both on the client side and on the server side, the latter relying on 
Jersey (JAX-RS).


--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --

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




Re: Regarding JSONP requests, duplicate requests and an error.

2013-04-22 Thread Mohammad Al-Quraian
Nevermind the duplication error, it seems to be gone.

On Monday, April 22, 2013 3:26:00 PM UTC+3, Mohammad Al-Quraian wrote:

 I noticed that the browser is sending what it seems to be duplicate 
 requests, I'm not sure if it's a thing in my code or not:

 Here is a sample of the requests:

 http://gdata.youtube.com/feeds/api/videos/02HCaj9h8Lo?v=2alt=jsoncallback=__gwt_jsonp__.P8.onSuccess

 http://gdata.youtube.com/feeds/api/videos/02HCaj9h8Lo?v=2alt=jsoncallback=__gwt_jsonp__.P7.onSuccess

 http://gdata.youtube.com/feeds/api/videos/02HCaj9h8Lo?v=2alt=jsoncallback=__gwt_jsonp__.P6.onSuccess

 All with the same exact content!

 This is my code for the jsonprequest builder:

 public void getVideo(final String url,
 final AsyncCallbackYoutubeVideoData async) {
 String reqUrl;
  reqUrl = http://gdata.youtube.com/feeds/api/videos/; + id + 
 ?v=2alt=json;

 requestBuilder.requestObject(URL.encode(reqUrl),
 new AsyncCallbackYoutubeVideoData() {
 public void onFailure(Throwable caught) {
 async.onFailure(caught);
 }
 public void onSuccess(YoutubeVideoData result) {
 async.onSuccess(result);
 }
 });
 }

 Also, I'm getting this error for including a frame of a different domain:
 Unsafe JavaScript attempt to access frame with URL 
 http://127.0.0.1:/Mobaraty.html?gwt.codesvr=127.0.0.1:9997#AddContentfrom 
 frame with URL 
 http://www.youtube.com/embed/02HCaj9h8Lo?wmode=transparentrel=0autohide=1showinfo=0.
  
 Domains, protocols and ports must match.

 I included this in my module file, but it didn't help:
 add-linker name=xsiframe /


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




Re: In GWT, ListHandlerListString columnSortHandler does not sort properly

2013-04-22 Thread Tom
i forgot to tell , the columns were iritated in a loop.

ListHandlerListString columnSortHandler = new ListHandlerListString(
list);
for (int k=0; k10; k++){
 IndexedColumn myColumn=new IndexedColumn(k+1);
 table.addColumn(myColumn, col +k);
 myColumn.setSortable(true);
  columnSortHandler.setComparator(myColumn,
   new ComparatorListString() {
 public int compare(ListString o1, ListString o2) {

return o1.get(0).compareTo(o2.get(0));
 }
});
}

When I do the sorting, the sorting action was invoked, the table did the 
sorting but the orders of values in that column is not correct. So I suspect it 
could be I put the columnSortHandler.setComparator inside a loop  that causing 
the problem.

How to fix it?


On Monday, April 22, 2013 10:17:12 PM UTC+10, PhiLho wrote:

 On 22/04/2013 12:42, Tom wrote: 
  Your code didn't work, beside it got the problem for non-digit string. 
 Ex: if i sort this 

 Which one? The numerical comparison was shown only to illustrate how to do 
 a non-trivial sort. 
 The first one was to show you complicated too much the comparison method, 
 it can be much 
 simpler. 
 Note that your method as well as mine only sort the first column of the 
 table. 
 As shown in the second method, if you plan to sort another column, you 
 have to provide its 
 index to get the data at the proper place. 

 -- 
 Philippe Lhoste 
 --  (near) Paris -- France 
 --  http://Phi.Lho.free.fr 
 --  --  --  --  --  --  --  --  --  --  --  --  --  -- 



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




Re: In GWT, ListHandlerListString columnSortHandler does not sort properly

2013-04-22 Thread Thomas Broyer
So you always sort on the first field whichever the column header being 
clicked?

On Monday, April 22, 2013 3:17:26 PM UTC+2, Tom wrote:

 i forgot to tell , the columns were iritated in a loop.

 ListHandlerListString columnSortHandler = new ListHandlerListString(
 list);
 for (int k=0; k10; k++){
  IndexedColumn myColumn=new IndexedColumn(k+1);
  table.addColumn(myColumn, col +k);
  myColumn.setSortable(true);
   columnSortHandler.setComparator(myColumn,
new ComparatorListString() {
  public int compare(ListString o1, ListString o2) {

 return o1.get(0).compareTo(o2.get(0));
  }
 });
 }

 When I do the sorting, the sorting action was invoked, the table did the 
 sorting but the orders of values in that column is not correct. So I suspect 
 it could be I put the columnSortHandler.setComparator inside a loop  that 
 causing the problem.

 How to fix it?


 On Monday, April 22, 2013 10:17:12 PM UTC+10, PhiLho wrote:

 On 22/04/2013 12:42, Tom wrote: 
  Your code didn't work, beside it got the problem for non-digit string. 
 Ex: if i sort this 

 Which one? The numerical comparison was shown only to illustrate how to 
 do a non-trivial sort. 
 The first one was to show you complicated too much the comparison method, 
 it can be much 
 simpler. 
 Note that your method as well as mine only sort the first column of the 
 table. 
 As shown in the second method, if you plan to sort another column, you 
 have to provide its 
 index to get the data at the proper place. 

 -- 
 Philippe Lhoste 
 --  (near) Paris -- France 
 --  http://Phi.Lho.free.fr 
 --  --  --  --  --  --  --  --  --  --  --  --  --  -- 



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




Re: In GWT, ListHandlerListString columnSortHandler does not sort properly

2013-04-22 Thread Tom
Someone from other forum solved it. So simple!
public int compare(ListString o1, ListString o2) {
  
  if (o1 == o2) {
  return 0;
}

// Compare the column.
if (o1 != null) {
  int index = verbColumn.getIndex();
  return (o2 != null) ? 
o1.get(index).compareTo(o2.get(index)) : 1;
}
return -1;
}

But thax you all you guy anyway.
On Monday, April 22, 2013 6:44:32 PM UTC+10, Tom wrote:

 I got these code:
 ////
  ListHandlerListString columnSortHandler = new 
 ListHandlerListString(
 list);
 columnSortHandler.setComparator(nameColumn,
 new ComparatorListString() {
   public int compare(ListString o1, ListString o2) 
 {
 if (o1 == o2) {
   return 0;
 }

 // Compare the name columns.
 if (o1 != null) {
   return (o2 != null) ? 
 o1.get(0).compareTo(o2.get(0)) : 1;
 }
 return -1;
   }
 });

 table.addColumnSortHandler(columnSortHandler);

 ////

 When sorting column contains iPhone 1, iPhone 2, iPhone 3... then it sorts 
 correctly ie, iPhone 1, iPhone 2, iPhone 3 for ascending  iPhone 3, iPhone 
 2, iPhone 1 for decending

 But when sorting column contains:

 1.92 MP 
 3.15 MP AF 0.31 MP 
 3.2 MP 
 5 MP AF and flash 
 1.3 MP 
 1.3 MP 
 2 MP (rear); 0.3 MP (front) 
 1.92 MP AF with flash (rear)

 it follows no correct order, it didn't even put the 2 1.3 MP cell next 
 to each other. The correct order for the above list should be: 
 1.3 MP 
 1.3 MP 
 1.92 MP 
 1.92 MP AF with flash (rear) 
 2 MP (rear); 0.3 MP (front) 
 3.15 MP AF 0.31 MP 
 3.2 MP 
 5 MP AF and flash

 Is there anything wrong with the code above?


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




Re: Hiding Tabs in TabLayoutPanel at runtime

2013-04-22 Thread Patrick Tucker
You probably should submit a feature request.

On Wednesday, July 28, 2010 11:36:15 AM UTC-4, rvns-pats wrote:

 Hi All, 

   I am trying to hide and show some panels with in a TabLayout Panel 
 at runtime. 

   I have the following code in my UiBInder 

 g:TabLayoutPanel ui:field=myTabPanel 
  g:tab  
 g:headerTab1/g:header 
 g:FlowPanel ui:field=tab1Panel 
 height=100% width=100%/ 
 g:FlowPanel 
 /g:tab 
 g:tab  
 g:headerTab2/g:header 
 g:FlowPanel ui:field=tab2Panel 
 height=100% width=100% 
 /g:FlowPanel 
 /g:tab 
 /g:TabLayoutPanel 

  And in the View i have..( passing either true or false based on 
 whether i want to show the second tab or hide it. 

  myTabPanel.getTabWidget(1).setVisible(true); 

 And it's not hiding the tab properly.. 

 Any comments.. 

 Thanks.. 

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




RPC does not work with GAE?

2013-04-22 Thread membersound
HI,

I have a little GWT app that I tried to deploy to GAE the first time. The 
clientside app works fine so far, but when executing a RPC request (which 
works on my local machine), there are exceptions about class not found. 
Do I have to make any changes for RPC with GAE? Or may I have forgotten 
anything?

87.164.58.50 - - [22/Apr/2013:09:07:16 -0700] POST /myapp/json HTTP/1.1 
500 0 http://myappde.appspot.com/; Mozilla/5.0 (Windows NT 6.1; WOW64; 
rv:20.0) Gecko/20100101 Firefox/20.0 myappde.appspot.com ms=128 
cpu_ms=151 app_engine_release=1.7.7 
instance=00c61b117c8332cd88265d53cab93b8de36c6e63

W 2013-04-22 09:07:16.330

EXCEPTION 
java.lang.ClassNotFoundException: de.myapp.server.file.DownServlet
at 
com.google.appengine.runtime.Request.process-32af579146635ab3(Request.java)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.mortbay.util.Loader.loadClass(Loader.java:91)
at org.mortbay.util.Loader.loadClass(Loader.java:71)
at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73)
at 
org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at 
org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at 
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at 
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at 
org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at 
com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:480)
at 
com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:487)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:774)
at 
com.google.tracing.TraceContext$DoInTraceContext.runInContext(TraceContext.java:751)
at 
com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:342)
at 
com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:334)
at 
com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:484)
at java.lang.Thread.run(Thread.java:679)

E 2013-04-22 09:07:16.374

javax.servlet.ServletContext log: unavailable
javax.servlet.UnavailableException: de.myapp.server.file.DownServlet
at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:79)
at 
org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at 
org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at 
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at 
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at 
org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at 
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at 
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:219)
at 
com.google.apphosting.runtime.jetty.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:194)
at 
com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:134)
at 
com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:438)
at 
com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:480)
at 
com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:487)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:774)
at 
com.google.tracing.TraceContext$DoInTraceContext.runInContext(TraceContext.java:751)
at 
com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:342)
at 
com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:334)
at 
com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:484)
at 
com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
at java.lang.Thread.run(Thread.java:679)

W 2013-04-22 09:07:16.377

EXCEPTION 
java.lang.ClassNotFoundException: de.myapp.server.file.UpServlet
at 
com.google.appengine.runtime.Request.process-32af579146635ab3(Request.java)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.mortbay.util.Loader.loadClass(Loader.java:91)
at org.mortbay.util.Loader.loadClass(Loader.java:71)
at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73)
at 

File Browsing

2013-04-22 Thread hadar
Hi,

I am using the FileUpload widget to let the user chose file.
I don't want to upload the file just let the user choose one.

I want to control the browse root directory and that the user will not able 
to choose files that are not under the root directory (The directory is Map 
directory to all users).

Can it be done and how ? is there other way than FileUpload ?

Thanks

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




refresh page

2013-04-22 Thread hadar
Hi,

I have application that contain FlexTable.
The data in the table is from DataBase.

I want to update the table (on all clients) when there is change in the db.

How it can be done ?

Thanks

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




Re: Problem with DateBox

2013-04-22 Thread Dominic Warzok
Thanks I will read it maybe I find a solution there ;) 

On Friday, April 19, 2013 12:19:08 PM UTC+2, Jens wrote:


 Maybe there is a problem with winter and summer time?


 That could be, especially for older dates. We also had problems with it, 
 take a look at: 
 https://groups.google.com/d/topic/google-web-toolkit/e7IqbcJIzTY/discussion

 -- J. 


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