Re: Safari 5 - (RangeError): Maximum call stack size exceeded

2010-06-22 Thread pash7ka
There is an Issue 4393 about this bug.

I've applyed dunhamsteve's patch and also in all binarySearch()
functions in Arrays.java and Collections.java changed:
-  final int mid = low + ((high - low)  1)
+  final int length = high - low;
+  final int half = length  1;
+  final int mid = low + half;

and just repacked gwt-user.jar replacing those files.
This worked for me.

On 16 июн, 03:12, DenNukem alt...@gmail.com wrote:
 So did you end up rebuilding the GWT itself? Where do I start to apply
 this patch?

 On Jun 9, 4:31 pm, dunhamst...@gmail.com dunhamst...@gmail.com
 wrote:

  This is occurring for us in the Arrays.mergeSort() code.  A reduced
  testcase (which looks like the binarySearch code) is in the webkit bug
  tracking system at:

     https://bugs.webkit.org/show_bug.cgi?id=40355

  It appears that in some complex expressions the right shift operator
  is not evaluating correctly.  Assigning the result of the right shift
  to a temporary variable and then using it appears to make the problem
  go away.

  As a temporary fix, we're patching Arrays.java:mergeSort() to assign
  the result of the right shift to a temporary variable before using it.
  If you're using binary search you'd need to patch those functions as
  well.  It's a bit of a hack, but it seems to work. I've included our
  patch below, in case it is helpful to someone.

  diff --git a/super/com/google/gwt/emul/java/util/Arrays.java b/super/
  com/google/
  index 89dcc33..b7ba6fa 100644
  --- a/super/com/google/gwt/emul/java/util/Arrays.java
  +++ b/super/com/google/gwt/emul/java/util/Arrays.java
  @@ -1322,7 +1322,8 @@ public class Arrays {
       // recursively sort both halves, using the array as temp space
       int tempLow = low + ofs;
       int tempHigh = high + ofs;
  -    int tempMid = tempLow + ((tempHigh - tempLow)  1);
  +    int half = length  1;
  +    int tempMid = tempLow + half;
       mergeSort(array, temp, tempLow, tempMid, -ofs, comp);
       mergeSort(array, temp, tempMid, tempHigh, -ofs, comp);

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



FormPanel: why it extends SimplePanel?

2010-11-09 Thread pash7ka
Is there a good reason for FormPanel to extend SimplePanel and not
some other panel (like HTMLPanel)?
The problem with SimplePanel is the restriction to only one child,
while most forms contain much more fields. So one shoud use some other
Panel whithin the Form and this leads to unnecessary markup.

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



Re: FormPanel: why it extends SimplePanel?

2010-11-09 Thread pash7ka
Yes, but whith this solution I have
formdiv/div/form
in resulting page, and the inner div is superfluous. Which is the
whole point of my question. )

On 9 ноя, 23:39, Jeff Schwartz jefftschwa...@gmail.com wrote:
 Add an HtmlPanel to it and then add your widgets to the HtmlPanel.

 Jeff

 On Tue, Nov 9, 2010 at 3:34 PM, pash7ka pash...@gmail.com wrote:
  Is there a good reason for FormPanel to extend SimplePanel and not
  some other panel (like HTMLPanel)?
  The problem with SimplePanel is the restriction to only one child,
  while most forms contain much more fields. So one shoud use some other
  Panel whithin the Form and this leads to unnecessary markup.

  --
  You received this message because you are subscribed to the Google Groups
  Google Web Toolkit group.
  To post to this group, send email to google-web-tool...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2Bunsubs 
  cr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.

 --
 Jeff

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



Module can't be loaded when host page has an element with id same as module name

2010-11-13 Thread pash7ka
When I have a div id=test.../div on the host page and have
module rename-to=test in the module xml file, this module can't be
loaded (especialy in IE), because bootstrap code from
module.nocache.js tries to create an iframe with the same id as module
name. Then on the maybeStartModule() it successfully gets the required
element just to find out it's not an iframe and has not contentWindow
property.

I think this should be at least documented, or, better, fixed: id of
the frame should be generated with the algorithm same as with css
class names in UiBinder and/or somehow controlled.

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



AutoBean with JSONP

2011-08-22 Thread pash7ka
Hi! I'm trying to use AutoBean framework to transfer data from server
to GWT App. GWT-RPC is not good for me, because i need to cache
responces.
So I'm trying to use JsonpRequestBuilder to fetch data and AutoBean
framework for encoding/decoding.

The simple (and not working) aproach is like this:
  servlet's doGet() method ---
String json = AutoBeanCodex.encode(data).getPayload();
String callback = request.getParameter(callback);
PrintWriter out = response.getWriter();
try {
out.write(callback);
out.write(();
out.write(json);
out.write(););
} finally {
out.close();
}

--- client ---
JsonpRequestBuilder jrb; // = ...
jrb.requestString(url, new AsyncCallbackString(){
public void onSuccess(String result) {
AutoBeanDataType bean = AutoBeanCodex.decode(factory,
DataType.class, result);
DataType data = bean.as();
//
}
public void onFailure(Throwable caught) {
}
});
-
Unfortunately, this does not work, because returned data is not
actualy a String, it's a JavaScript object.

I've tried to escape json on the server to make it String:
---
out.write(callback);
out.write((\);
out.write(escape(json));
out.write(\););
---
This works, but in my case it increases responce size from 700kb to
3Mb which is really not good.

Any ideas what to with this?

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



Re: AutoBean with JSONP

2011-08-22 Thread pash7ka
I've found a solution: it's possible to convert Object to String on
the client:
---
JsonpRequestBuilder jrb; // = ...
jrb.requestObject(url, new AsyncCallbackJavaScriptObject(){
public void onSuccess(String result) {
JSONObject jsObj = new JSONObject(result);
AutoBeandatatype bean = AutoBeanCodex.decode(factory,
DataType.class, jsObj.toString());
DataType data = bean.as();
//
}
public void onFailure(Throwable caught) {
}
});
-
But I don't know about performance: parsing this object 2 times on the
client may be slow.
May be there are some better solutions?

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



Integer and int are not equal... Especially if received via JSNI

2012-09-14 Thread pash7ka
I've spent a huge amount of time trying to find the source of one strange 
bug in my app, so I want to share what I've found.
First I should say I'm using GWT 2.3 currently, so i don't know if the 
described behavior changed in latest version.

My app is receiving some data from my server, displays it and after some 
user actions send something from this data back to the server.
I’ve used standart GWT RPC for this data exchange and everything was fine.
Then we decided to receive that data via JSON requests and here my trubles 
started: trying to send data back to the server (with the old GWT RPC 
method) throwed the com.google.gwt.user.client.rpc.SerializationException: 
undefined at Unknown.anonymous(Unknown Source).

Well, I’m not going to tell all the steps how I’ve found the problem, just 
the result.
My data class looks like this: 
public final class MyDataObj  extends JavaScriptObject {
//… NoArgs constructor and other stuff
public final native Ineger getMyDataVal() /*-{ return this.myDataVal; }-*/;
}

I’ve used Integer and not int here because null value is perfectly valid 
here and has its own meaning.
But in JSON this was a normal JavaScript integer or the absence of the 
property.
It was fine. Just until GWT had to serialize this Integer for RPC. Or until 
I’ve tried to use toString() or intValue() on it. That fails, since this 
was not an Integer.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/qMjpqA8NryEJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Integer and int are not equal... Especially if received via JSNI

2012-09-17 Thread pash7ka
Yes, this manual boxing is what i did to solve this.

I don't use DevMode because it's a bit difficult to configure my 
environment for it: i use JBoss as my app server and the app is deployed 
via .ear archive with some other modules it needs to work... I'm sure it's 
possible to configure somehow, just i didn't need it. :)

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/GDMftMpDRz8J.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.