Re: Problem with JSNI call to java method from javascript
On Sat, Nov 15, 2008 at 8:31 AM, Manish Kumar [EMAIL PROTECTED] wrote: Hi, Thanks for your much needed help. U welcome :) This seems working but it calls the same method twice so my original value is lost. Strange could you send me your code ? Any idea about this. Regards Manish - Original Message - From: olivier nouguier [EMAIL PROTECTED] To: Google-Web-Toolkit@googlegroups.com Sent: Friday, November 14, 2008 10:07 PM Subject: Re: Problem with JSNI call to java method from javascript hum it should works ... (you don't give the this reference ... Here a full sample that work :) ### GWT module package test.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.Window; public class MyModule implements EntryPoint { public void onModuleLoad() { init(this); } public void gwtFunction(String message) { Window.alert(message); } private native void init(MyModule zis) /*-{ $wnd.injectedFunction = function(message){ [EMAIL PROTECTED]::gwtFunction(Ljava/lang/String;)(message) } if($wnd.jsOnload){ $wnd.jsOnload(); } }-*/; } ### ### HTML hosted page ### html head !-- -- !-- Any title is fine -- !-- -- titleWrapper HTML for MyModule/title !-- -- !-- Use normal html, such as style-- !-- -- style body,td,a,div,.p{font-family:arial,sans-serif} div,td{color:#00} a:link,.w,.w a:link{color:#cc} a:visited{color:#551a8b} a:active{color:#ff} /style !-- -- !-- This script loads your compiled module. -- !-- If you add any GWT meta tags, they must -- !-- be added before this line.-- !-- -- /head !-- -- !-- The body can have arbitrary html, or -- !-- you can leave the body empty if you want -- !-- to create a completely dynamic ui -- !-- -- body !-- OPTIONAL: include this if you want history support -- iframe src=javascript:'' id=__gwt_historyFrame style=width:0;height:0;border:0/iframe script type=text/javascript language=javascript src=test.MyModule.nocache.js/script script type=text/javascript function jsOnload(){ injectedFunction(Helo); } /script /body /html ### On Fri, Nov 14, 2008 at 3:37 PM, Manish Kumar [EMAIL PROTECTED] wrote: Hi olivier, Thanks for your kind help. I tried this , this does not work with the exception Could not find a native method with the signature '@com.pm.output.html.gwt.model.comment.client.PMGWTHtmlUtils::exportStaticMethod()' which was not coming before. Please let us know where am I conceptually wrong.If anybody have alternative idea , plz pass it. Regards Manish - Original Message - From: olivier nouguier [EMAIL PROTECTED] To: Google-Web-Toolkit@googlegroups.com Sent: Friday, November 14, 2008 7:36 PM Subject: Re: Problem with JSNI call to java method from javascript Hi, I suspect (?) that your js code is call to soon ... The GWT is not yet initialized Please try this: ### GWT patch ### static native void exportStaticMethod() /*-{ $wnd.invokeGWT = function(bId,cId,mId,mName,cName){ [EMAIL PROTECTED]::invokeGWT(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;) (bId,cId,mId,mName,cName); }; // Lazy call to onLoad if($wnd.my_onload){ $wnd.my_onload(); } }-*/ ; ### JS Patch in HTML page // This function will be called by GWT module. function my_onload(){ invokeGWT( ,,,, ); } By doing this the invokeGWT is call after the module initialise. HIH -- Si l'ignorance peut servir de consolation, elle n'en est pas moins illusoire. -- Si l'ignorance peut servir de consolation, elle n'en est pas moins illusoire. -- Si l'ignorance peut servir de consolation, elle n'en est pas moins illusoire. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Images from DB
Greetings. I'm dynamically reading images stored in the DB and I need to render them in the screen The Image Widget reads only static URLs so I need to have the images saved in a temp directory (but still accessible from regular URL). I'm wondering if there is any other smart way of doing this. Any light out there? Thanks! --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Firefox rendering wrong
Hi, Are you using any borders/margins/padding with your panels? If you are this is might be the cause of your problem Google IE broken box model. You will find info about the difference between how IE and FF (and other browsers) handle borders etc . Basically the issue is this: say you have a panel that is set to 100px X 100px, and you add a 5px border to it. IE renders this 100 x 100 total (so the actual box is now 90 x 90), whereas FF renders it as 110 x 110 total (so the actual box remains 100 x 100). Another way of looking at it is that FF works from inside out whereas IE works from outside in. Actually the FF approach follows W3C standards whereas IE does not (hence IE broken box model). In some situations GWT deals with this automatically for you, in others it doesn't. You will find a lot of different approaches to dealing with this on the net using javascript/CSS techniques because this problem has been around a long time. With GWT there are a range of more Java oriented techniques available revolving around how you go about nesting and separating primary display containers and their contents. If you create a short EntryPoint test class that demonstrates your particular issue and post it here I'm sure you will get a range of solution options suggested. regards gregor On Nov 15, 2:32 am, reechard [EMAIL PROTECTED] wrote: yes -- I am experiencing this. Wondering if I need to use some kind of browser-specific CSS style to fix it... On Nov 14, 5:29 pm, jsantaelena [EMAIL PROTECTED] wrote: Hi all, My GWT application render very well in IE, but in FF the panels (VerticalPanes, HorizontalPanels and FlexTables) overlaps, all of them. Have somebody expereinced this? Thanks! --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Problem with JSNI call to java method from javascript
Hi olivier, The code i have written as follows : public void onModuleLoad() { try{exportStaticMethod(this); }catch(Exception re){ MessageBox.alert(re.getMessage()); } } public native void exportStaticMethod(PMGWTHtmlUtils pmGWTHtmlUtils) /*-{ $wnd.invokeGWT = function(bId,cId,mId,mName,cName) { [EMAIL PROTECTED]::invokeGWT(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)(bId,cId,mId,mName,cName); }; if($wnd.callGWTUtils){ $wnd.callGWTUtils(); } }-*/; public void invokeGWT( String bId,String cId,String mId,String mName,String cName ) throws RequestException { System.out.println( :+ bId); } in javascript : function callGWTUtils( bttnId ) { alert('xxx'+ bttnId); invokeGWT( bttnId,,,, ); /*if( currDispId != null ){ invokeGWT( bttnId,currDispId ); }*/ } Html stuffs: html head !-- -- !-- Any title is fine -- !-- -- titlePM HTML-GWT Wrapper/title !-- -- !-- The module reference below is the link -- !-- between html and your Web Toolkit module -- !-- -- meta name='gwt:module' content='com.pm.output.html.gwt.model.comment.PMGWTHtmlUtils'/meta !-- -- !-- Link CSS file -- !-- -- link type=text/css rel='stylesheet' href='ExGwtExt.css'/link link rel=stylesheet type=text/css href=js/ext/resources/css/ext-all.css/link link rel=stylesheet type=text/css href=js/ext/resources/css/xtheme-aero.css//link script type=text/javascript src=js/ext/adapter/yui/yui-utilities.js/script script type=text/javascript src=js/ext/adapter/yui/ext-yui-adapter.js/script script src=js/sh/shCore.js/script script src=js/sh/shBrushJava.js/script style * { font-family:Courier New,monospace; padding: 0; margin: 0; white-space: nowrap; font-size: 11px; } .dp-highlighter { white-space: nowrap; overflow: visible; width: 600px; font-size: 11px; font-family:Courier New,monospace; } /style /head !-- -- !-- The body can have arbitrary html, or -- !-- we leave the body empty because we want -- !-- to create a completely dynamic ui -- !-- -- body script type=text/javascript src=js/ext/ext-all.js/script script type=text/javascript src=js/ext/ext-base.js/script !-- -- !-- This script is required bootstrap stuff. -- !-- You can put it in the HEAD, but startup -- !-- is slightly faster if you include it here. -- !-- -- script language=javascript src=com.pm.output.html.gwt.model.comment.PMGWTHtmlUtils.nocache.js/script script language=javascript src=js/ext/pmxslutils.js/script iframe onload=javascript:callGWTUtils('v7')/ /body /html Please let us know where i am wrong. Regards Manish - Original Message - From: olivier nouguier [EMAIL PROTECTED] To: Google-Web-Toolkit@googlegroups.com Sent: Saturday, November 15, 2008 3:43 PM Subject: Re: Problem with JSNI call to java method from javascript On Sat, Nov 15, 2008 at 8:31 AM, Manish Kumar [EMAIL PROTECTED] wrote: Hi, Thanks for your much needed help. U welcome :) This seems working but it calls the same method twice so my original value is lost. Strange could you send me your code ? Any idea about this. Regards Manish - Original Message - From: olivier nouguier [EMAIL PROTECTED] To: Google-Web-Toolkit@googlegroups.com Sent: Friday, November 14, 2008 10:07 PM Subject: Re: Problem with JSNI call to java method from javascript hum it should works ... (you don't give the this reference ... Here a full sample that work :) ### GWT module package test.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.Window; public class MyModule implements EntryPoint { public void onModuleLoad() { init(this); } public void gwtFunction(String message) { Window.alert(message); } private native void init(MyModule zis) /*-{ $wnd.injectedFunction = function(message){ [EMAIL PROTECTED]::gwtFunction(Ljava/lang/String;)(message) } if($wnd.jsOnload){ $wnd.jsOnload(); } }-*/; } ### ### HTML hosted page ### html head !-- -- !-- Any title is fine -- !-- -- titleWrapper HTML for MyModule/title !-- -- !-- Use normal html, such as style-- !-- -- style body,td,a,div,.p{font-family:arial,sans-serif} div,td{color:#00} a:link,.w,.w a:link{color:#cc} a:visited{color:#551a8b} a:active{color:#ff} /style !--
Re: Only digits in TextBox: differences between Firefox and IE
If anyone else is looking for this, I've added more error checking that might come in handy. The error checking presumes that zero is not a valid entry. You could combine the if statements. I've posted them this way for conprehension. //class vars public static final int QTY_BOX_LENGTH = 2; public String previousValue; //use a focus and a keyboard listener //If we lose focus with a zero value, reset public void onLostFocus(Widget sender) { if ( ((TextBoxBase) sender).getText().length() == 0 || ((TextBoxBase) sender).getText().equals(0) ) { ((TextBoxBase) sender).setText(this.previousValue); } } public void onKeyDown(Widget sender, char keyCode, int modifiers) { switch(keyCode) { case KEY_LEFT: case KEY_RIGHT: case KEY_BACKSPACE: case KEY_DELETE: return; } if ( !Character.isDigit(keyCode) ) { ((TextBoxBase) sender).cancelKey(); return; } //entry past the max length specified is prohibited if ( ((TextBoxBase) sender).getText().length() = QTY_BOX_LENGTH ) { ((TextBoxBase) sender).cancelKey(); return; } //if a user enters zero as the first character, cancel the key if ( ( (((TextBoxBase) sender).getText().length() == 0) (keyCode == '0') ) ) { ((TextBoxBase) sender).cancelKey(); return; } } public void onKeyUp(Widget sender, char keyCode, int modifiers) { //If the user enters zero, ahead of an existing value, reset to the existing value String s = ((TextBoxBase) sender).getText(); if ( s.substring(0,1).equals(0) ) { ((TextBoxBase) sender).setText(s.substring(1)); return; } //reset the previousValue var or do whatever is next... foo(); } On Nov 6, 1:05 am, Schimki86 [EMAIL PROTECTED] wrote: I use a KeyboardListener to check the typed character. I've seen this example in the book GWT in Action: public void onKeyUp(Widget sender, char keyCode, int modifiers) { if (!Character.isDigit(keyCode)) { ((TextBox)sender).cancelKey(); return; } } In IE it works but in FF the Listeners is listen to the control-, delete- and backspace- key too. I can't delete an character because these keys are no digits. How can I check if the keys are a control, delete or the backspace? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Problem with JSNI call to java method from javascript
Seem logic that the callback is called twice ... - HTML: onload of your frame with a parameter - GWT: onModuleLoad *without* parameter On Sat, Nov 15, 2008 at 11:40 AM, Manish Kumar [EMAIL PROTECTED] wrote: Hi olivier, The code i have written as follows : public void onModuleLoad() { try{exportStaticMethod(this); }catch(Exception re){ MessageBox.alert(re.getMessage()); } } public native void exportStaticMethod(PMGWTHtmlUtils pmGWTHtmlUtils) /*-{ $wnd.invokeGWT = function(bId,cId,mId,mName,cName) { [EMAIL PROTECTED]::invokeGWT(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)(bId,cId,mId,mName,cName); }; if($wnd.callGWTUtils){ $wnd.callGWTUtils(); } }-*/; public void invokeGWT( String bId,String cId,String mId,String mName,String cName ) throws RequestException { System.out.println( :+ bId); } in javascript : function callGWTUtils( bttnId ) { alert('xxx'+ bttnId); invokeGWT( bttnId,,,, ); /*if( currDispId != null ){ invokeGWT( bttnId,currDispId ); }*/ } Html stuffs: html head !-- -- !-- Any title is fine -- !-- -- titlePM HTML-GWT Wrapper/title !-- -- !-- The module reference below is the link -- !-- between html and your Web Toolkit module -- !-- -- meta name='gwt:module' content='com.pm.output.html.gwt.model.comment.PMGWTHtmlUtils'/meta !-- -- !-- Link CSS file -- !-- -- link type=text/css rel='stylesheet' href='ExGwtExt.css'/link link rel=stylesheet type=text/css href=js/ext/resources/css/ext-all.css/link link rel=stylesheet type=text/css href=js/ext/resources/css/xtheme-aero.css//link script type=text/javascript src=js/ext/adapter/yui/yui-utilities.js/script script type=text/javascript src=js/ext/adapter/yui/ext-yui-adapter.js/script script src=js/sh/shCore.js/script script src=js/sh/shBrushJava.js/script style * { font-family:Courier New,monospace; padding: 0; margin: 0; white-space: nowrap; font-size: 11px; } .dp-highlighter { white-space: nowrap; overflow: visible; width: 600px; font-size: 11px; font-family:Courier New,monospace; } /style /head !-- -- !-- The body can have arbitrary html, or -- !-- we leave the body empty because we want -- !-- to create a completely dynamic ui -- !-- -- body script type=text/javascript src=js/ext/ext-all.js/script script type=text/javascript src=js/ext/ext-base.js/script !-- -- !-- This script is required bootstrap stuff. -- !-- You can put it in the HEAD, but startup -- !-- is slightly faster if you include it here. -- !-- -- script language=javascript src=com.pm.output.html.gwt.model.comment.PMGWTHtmlUtils.nocache.js/script script language=javascript src=js/ext/pmxslutils.js/script iframe onload=javascript:callGWTUtils('v7')/ /body /html Please let us know where i am wrong. Regards Manish - Original Message - From: olivier nouguier [EMAIL PROTECTED] To: Google-Web-Toolkit@googlegroups.com Sent: Saturday, November 15, 2008 3:43 PM Subject: Re: Problem with JSNI call to java method from javascript On Sat, Nov 15, 2008 at 8:31 AM, Manish Kumar [EMAIL PROTECTED] wrote: Hi, Thanks for your much needed help. U welcome :) This seems working but it calls the same method twice so my original value is lost. Strange could you send me your code ? Any idea about this. Regards Manish - Original Message - From: olivier nouguier [EMAIL PROTECTED] To: Google-Web-Toolkit@googlegroups.com Sent: Friday, November 14, 2008 10:07 PM Subject: Re: Problem with JSNI call to java method from javascript hum it should works ... (you don't give the this reference ... Here a full sample that work :) ### GWT module package test.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.Window; public class MyModule implements EntryPoint { public void onModuleLoad() { init(this); } public void gwtFunction(String message) { Window.alert(message); } private native void init(MyModule zis) /*-{ $wnd.injectedFunction = function(message){ [EMAIL PROTECTED]::gwtFunction(Ljava/lang/String;)(message) } if($wnd.jsOnload){ $wnd.jsOnload(); } }-*/; } ### ### HTML hosted page ### html head !-- -- !-- Any title is fine -- !-- -- titleWrapper HTML for MyModule/title !-- -- !-- Use
networking problem
hi all, I am creating an application for computing image features using GWT. When we select an image from server, features are computed and stored in database. But when we use the application from a client and select an image from a client machine, image features are not computed. THis is the case for some of the images on client machine but for some of the images on client machine, features get computed. For the same image, features are not computed of the image is on client machine but features get computed if the image is on server. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
getValuesAString() of HTMLEditor returns text containing HTML tags and HTML character
Hi, I am using HTMLEditor to enter some text.When I get the entered text using getValuesAString() , this returns text including HTML tags(br/) and HTML character (nbsp;) which causes problem while being parsed in the xml including these text. Can anybody let us know how to avoid this except using CDATA. Regards Manish --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Problem with JSNI call to java method from javascript
Hi , Yes, you are correct. But how can we stop this.And also I may need to use the callGWTUtils javascript api with parameter html tag id. Thanks again for quick reply. Regards Manish - Original Message - From: olivier nouguier [EMAIL PROTECTED] To: Google-Web-Toolkit@googlegroups.com Sent: Saturday, November 15, 2008 4:44 PM Subject: Re: Problem with JSNI call to java method from javascript Seem logic that the callback is called twice ... - HTML: onload of your frame with a parameter - GWT: onModuleLoad *without* parameter On Sat, Nov 15, 2008 at 11:40 AM, Manish Kumar [EMAIL PROTECTED] wrote: Hi olivier, The code i have written as follows : public void onModuleLoad() { try{exportStaticMethod(this); }catch(Exception re){ MessageBox.alert(re.getMessage()); } } public native void exportStaticMethod(PMGWTHtmlUtils pmGWTHtmlUtils) /*-{ $wnd.invokeGWT = function(bId,cId,mId,mName,cName) { [EMAIL PROTECTED]::invokeGWT(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)(bId,cId,mId,mName,cName); }; if($wnd.callGWTUtils){ $wnd.callGWTUtils(); } }-*/; public void invokeGWT( String bId,String cId,String mId,String mName,String cName ) throws RequestException { System.out.println( :+ bId); } in javascript : function callGWTUtils( bttnId ) { alert('xxx'+ bttnId); invokeGWT( bttnId,,,, ); /*if( currDispId != null ){ invokeGWT( bttnId,currDispId ); }*/ } Html stuffs: html head !-- -- !-- Any title is fine -- !-- -- titlePM HTML-GWT Wrapper/title !-- -- !-- The module reference below is the link -- !-- between html and your Web Toolkit module -- !-- -- meta name='gwt:module' content='com.pm.output.html.gwt.model.comment.PMGWTHtmlUtils'/meta !-- -- !-- Link CSS file -- !-- -- link type=text/css rel='stylesheet' href='ExGwtExt.css'/link link rel=stylesheet type=text/css href=js/ext/resources/css/ext-all.css/link link rel=stylesheet type=text/css href=js/ext/resources/css/xtheme-aero.css//link script type=text/javascript src=js/ext/adapter/yui/yui-utilities.js/script script type=text/javascript src=js/ext/adapter/yui/ext-yui-adapter.js/script script src=js/sh/shCore.js/script script src=js/sh/shBrushJava.js/script style * { font-family:Courier New,monospace; padding: 0; margin: 0; white-space: nowrap; font-size: 11px; } .dp-highlighter { white-space: nowrap; overflow: visible; width: 600px; font-size: 11px; font-family:Courier New,monospace; } /style /head !-- -- !-- The body can have arbitrary html, or -- !-- we leave the body empty because we want -- !-- to create a completely dynamic ui -- !-- -- body script type=text/javascript src=js/ext/ext-all.js/script script type=text/javascript src=js/ext/ext-base.js/script !-- -- !-- This script is required bootstrap stuff. -- !-- You can put it in the HEAD, but startup -- !-- is slightly faster if you include it here. -- !-- -- script language=javascript src=com.pm.output.html.gwt.model.comment.PMGWTHtmlUtils.nocache.js/script script language=javascript src=js/ext/pmxslutils.js/script iframe onload=javascript:callGWTUtils('v7')/ /body /html Please let us know where i am wrong. Regards Manish - Original Message - From: olivier nouguier [EMAIL PROTECTED] To: Google-Web-Toolkit@googlegroups.com Sent: Saturday, November 15, 2008 3:43 PM Subject: Re: Problem with JSNI call to java method from javascript On Sat, Nov 15, 2008 at 8:31 AM, Manish Kumar [EMAIL PROTECTED] wrote: Hi, Thanks for your much needed help. U welcome :) This seems working but it calls the same method twice so my original value is lost. Strange could you send me your code ? Any idea about this. Regards Manish - Original Message - From: olivier nouguier [EMAIL PROTECTED] To: Google-Web-Toolkit@googlegroups.com Sent: Friday, November 14, 2008 10:07 PM Subject: Re: Problem with JSNI call to java method from javascript hum it should works ... (you don't give the this reference ... Here a full sample that work :) ### GWT module package test.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.Window; public class MyModule implements EntryPoint { public void onModuleLoad() { init(this); } public void gwtFunction(String message) { Window.alert(message); } private native void init(MyModule zis) /*-{ $wnd.injectedFunction = function(message){ [EMAIL
Re: Images from DB
use a standard servlet - it's just a URL as far as the client is concerned. Here's an example I found: // This method is called by the servlet container to process a GET request. public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { // Get the absolute path of the image ServletContext sc = getServletContext(); String filename = sc.getRealPath(image.gif); // Get the MIME type of the image String mimeType = sc.getMimeType(filename); if (mimeType == null) { sc.log(Could not get MIME type of +filename); resp.setStatus (HttpServletResponse.SC_INTERNAL_SERVER_ERROR); return; } // Set content type resp.setContentType(mimeType); // Set content size File file = new File(filename); resp.setContentLength((int)file.length()); // Open the file and output streams FileInputStream in = new FileInputStream(file); OutputStream out = resp.getOutputStream(); // Copy the contents of the file to the output stream byte[] buf = new byte[1024]; int count = 0; while ((count = in.read(buf)) = 0) { out.write(buf, 0, count); } in.close(); out.close(); } You need to adapt this to: 1) Strip the image name from the HttpRequest URL so you can use it to build your JDBC query. 2) Check your DB docs to see how to get an InputStream (as opposed a byte array) out of the ResultSet 3) Then you plug this InputStream into the response OutputStream instead of the FileInputStream used in the example 4) I'm not sure what the significance of the MimeType bit in the example is - you might be able to just set this to a constant if it's needed The main idea is that you set up streams piping the image bytes directly from your DB out to the client using a small byte buffer (say 1024 bytes as in example) in the servlet. This avoids creating big byte [] objects on the web server which hammers memory. regards gregor On Nov 15, 6:52 am, CodeABunch [EMAIL PROTECTED] wrote: Greetings. I'm dynamically reading images stored in the DB and I need to render them in the screen The Image Widget reads only static URLs so I need to have the images saved in a temp directory (but still accessible from regular URL). I'm wondering if there is any other smart way of doing this. Any light out there? Thanks! --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: gwt-maps-1.0.1, Unterminated string constant error
Hi Eric, I will try in their forum, thanks. /Rasmus On 14 Nov., 19:47, Eric Ayers [EMAIL PROTECTED] wrote: Hi Rasmus, This doesn't appear to be realted to GWT or the Google API Wrappers for GWT. Check over and search the Google-Maps-Api google group and let us know if anything turns up. Be sure to observe their posting guidelines. -Eric. On Fri, Nov 14, 2008 at 10:37 AM, Rasmus H [EMAIL PROTECTED] wrote: I have been trying for a while now to get gwt-maps-1.0.1 to work with gwt-windows-1.5.3 but I am again and again encountering the same error: Unterminated string constant on line 220. I have tried the following: - project made using the gwt-maps guide and clean project - placing the maps script tag about anywhere in the gwt.xml and HTML file - different HTML description tags - different versions of GWT and gwt-maps When I compile everything runs fine in Firefox and Chrome but IE 7.0 refuses to run the code. I have tried to look through the JavaScripts and I found that the problem arises in http://maps.google.com/intl/da_ALL/mapfiles/132e/maps2.api/main.js which is loaded from http://maps.google.com/maps?gwt=1file=apiv=2key=xxx 220: var ag= [opera,msie,applewebkit,firefox,camino,mozilla],bg= [x11;,macintosh,windows];function cg(a){var b=this;b.agent=a;b.type=-1;b.os=-1;b.cpu=-1;b.version=0;b.revision=0;var a=a.toLowerCase();for(var c=0;cj(ag);c++){var d=ag[c];if(a.indexOf(d)! =-1){b.type=c;var e=new RegExp(d+[ /]?([0-9]+(.[0-9]+)?));if(e.exec (a))b.version=parseFloat(RegExp.$1);break}}for(var c=0;cj(bg);c++) {var d=bg[c];if(a.indexOf(d)!=-1){b.os=c;break}}if(b.os==1a.indexOf (intel)!=-1)b.cpu=0;if(b.xa() 221: /\brv:\s*(\d+\.\d+)/.exec(a))b.revision=parseFloat(RegExp.$1)} Does anybody have a clue what I am doing wrong? Thanks. -- Eric Z. Ayers - GWT Team - Atlanta, GA USAhttp://code.google.com/webtoolkit/ --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: getValuesAString() of HTMLEditor returns text containing HTML tags and HTML character
You could write a small native JS method that substitutes and for amp;, and for lt;. Typically that is all that you would need to make the char data XML compliant. Rob On Sat, Nov 15, 2008 at 6:11 AM, Manish Kumar [EMAIL PROTECTED] wrote: Hi, I am using HTMLEditor to enter some text.When I get the entered text using getValuesAString() , this returns text including HTML tags(br/) and HTML character (nbsp;) which causes problem while being parsed in the xml including these text. Can anybody let us know how to avoid this except using CDATA. Regards Manish --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Firefox rendering wrong
I'm not setting large border (1px or 2px) and i'm not using margins or padding. Why not happens with GWT Showcase? Another intersting thing is, after each refresh, FF renders my applicatios more massed. I'm using this DOCTYPE: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http:// www.w3.org/TR/html4/loose.dtd And my CSS just sets fonts, colors, backgrounds... On 15 nov, 08:43, gregor [EMAIL PROTECTED] wrote: Hi, Are you using any borders/margins/padding with your panels? If you are this is might be the cause of your problem Google IE broken box model. You will find info about the difference between how IE and FF (and other browsers) handle borders etc . Basically the issue is this: say you have a panel that is set to 100px X 100px, and you add a 5px border to it. IE renders this 100 x 100 total (so the actual box is now 90 x 90), whereas FF renders it as 110 x 110 total (so the actual box remains 100 x 100). Another way of looking at it is that FF works from inside out whereas IE works from outside in. Actually the FF approach follows W3C standards whereas IE does not (hence IE broken box model). In some situations GWT deals with this automatically for you, in others it doesn't. You will find a lot of different approaches to dealing with this on the net using javascript/CSS techniques because this problem has been around a long time. With GWT there are a range of more Java oriented techniques available revolving around how you go about nesting and separating primary display containers and their contents. If you create a short EntryPoint test class that demonstrates your particular issue and post it here I'm sure you will get a range of solution options suggested. regards gregor On Nov 15, 2:32 am, reechard [EMAIL PROTECTED] wrote: yes -- I am experiencing this. Wondering if I need to use some kind of browser-specific CSS style to fix it... On Nov 14, 5:29 pm, jsantaelena [EMAIL PROTECTED] wrote: Hi all, My GWT application render very well in IE, but in FF the panels (VerticalPanes, HorizontalPanels and FlexTables) overlaps, all of them. Have somebody expereinced this? Thanks! --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
RPC, database connection reality check?
Hi, I am testing out a simple RPC call (as in the StockWatcher example). I'm pulling some records from a database in the service now: public class MyServiceImpl extends RemoteServiceServlet implements IMyService public Stuff[] getStuff(String criteria) { Class.forName(com.mysql.jdbc.Driver).newInstance(); con = DriverManager.getConnection(jdbc:mysql://127.0.0.1:3306/ test,username,password); stmt = con.createStatement(); rs = stmt.executeQuery(SELECT * FROM blah); while (rs.next()) { ... } } return stuff; } It works fine, but I'm wondering about performance if I have several thousand users calling this webservice simultaneously - would each client be creating a brand new connection to my database when this RPC function is called? If so, is that going to hold up for large volumes of users? If not, can I somehow keep one db connection alive on my server to pass around to new clients instead of constantly reconnecting? Thanks --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: RPC, database connection reality check?
yes and yes. I would recommend you check out conection pooling - you should be able to get your servlet container to hold a pool of connections open that your code can then request to use as needed. You'll need to do two things: a) set up pooling on your container and b) change your code slightly to use the pooled connections. Set up in your container is not usually difficult, but is often container specific. For example, Tomcat can be set up as follows: http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html Some of the principles to move from what you have in your current code to code that uses conection pooling are in this article: http://www.javaranch.com/journal/200601/JDBCConnectionPooling.html Hope that helps. //Adam On 15 Nov, 15:57, markww [EMAIL PROTECTED] wrote: Hi, I am testing out a simple RPC call (as in the StockWatcher example). I'm pulling some records from a database in the service now: public class MyServiceImpl extends RemoteServiceServlet implements IMyService public Stuff[] getStuff(String criteria) { Class.forName(com.mysql.jdbc.Driver).newInstance(); con = DriverManager.getConnection(jdbc:mysql://127.0.0.1:3306/ test,username,password); stmt = con.createStatement(); rs = stmt.executeQuery(SELECT * FROM blah); while (rs.next()) { ... } } return stuff; } It works fine, but I'm wondering about performance if I have several thousand users calling this webservice simultaneously - would each client be creating a brand new connection to my database when this RPC function is called? If so, is that going to hold up for large volumes of users? If not, can I somehow keep one db connection alive on my server to pass around to new clients instead of constantly reconnecting? Thanks --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Observer pattern on this design, yes or no/how and why?
Wow. That seems too easy. =D Seems GWT really simplified observer pattern there, was thinking of doing some extending of the observable class in Java, good thing GWT 1.5 has it already, and its much simpler. thanks a lot. On 14 Nob, 20:50, gregor [EMAIL PROTECTED] wrote: Oh, as to why, well as you see ConfigPanel has no real knowledge of the other panels that are listening to it and does need to call any methods on them. As a result any number of panels can be registered as a listener with it, and subsequently swapped out for new ones if required, without affecting ConfigPanel's code at all. It is up to the listeners to decide for themselves, individually, what they need to do when they receive a change event. So there is a very weak association between ConfigPanel and it's listeners and none at all between the listeners == low coupling == application components easy to change and maintain. On Nov 14, 12:40 pm, gregor [EMAIL PROTECTED] wrote: GWT has a range of Observer/Observable gadgets off the shelf: SourcesEvents Listener and xxxListenerCollection utility classes. If they don't work quite right for you, it's easy to copy the principle and design your own event handling interfaces. You could have your config Composite implement SourcesChangeEvents, for example. Then Comps 1 2 can implement ChangeListener and are registered with the config Comp. It might work like so: public class ConfigPanel extends Composite implements SourcesChangeEvents { private ChangeListenerCollection listeners = new ChangeListenerCollection(); private Button saveBtn = new Button(Save,new ClickListener() { public void onClick(Widget widget) { // you want to send the ConfigPanel itself, not the Button! // if you just used this it would send the button listeners.fireChange(ConfigPanel.this).; } }); } public class Comp1 extends Composite implements changeListener { public void onChange(Widget sender) { is (sender instanceof ConfigPanel) { ConfigPanel configPanel = (ConfigPanel) sender; // call whatever methods you need } } Don't forget you have to register Comp1 as a lister with ConfigPanel somewhere or it won't work, e.g.: confPanel.addChangeListener(comp1); And that's about it - goodbye to your static method calls. regards gregor On Nov 14, 8:45 am, mives29 [EMAIL PROTECTED] wrote: i meant static methods, not static classes (2nd paragraph 2nd line) On Nov 14, 4:43 pm, mives29 [EMAIL PROTECTED] wrote: I'd go straight to what I want to do. I have 3 composites in 1 panel, in 1 entrypoint. I have another entrypoint that pops up when you click a link on the 2nd composite on the 1st entrypoint. on that second entrypoint you can configure stuff, that will affect the displayed data on the first entrypoint's composites. now, im thinking (actually, a friend thought of it, not me) that the observer pattern is great to use in here, as the 3 composites of the 1st entrypoint will listen to whatever the second entrypoint configures, then change themselves according to the specified configurations on the second entrypoint. Currently, I do the changes on the first entrypoint's composites by calling their static classes (from the second entrypoint's clicklisteners and stuff) that configures them, which I think is not a very good practice to implement because it's not easily extensible and not that good of a design. Now, is it wise to use the observer pattern(personally, I think it is)? If yes, how do you implement that on GWT 1.5? (we use GWT 1.5.2) thanks in advance mives29 --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Images from DB
Thanks a bunch! -- From: gregor [EMAIL PROTECTED] Sent: Saturday, November 15, 2008 7:50 AM To: Google Web Toolkit Google-Web-Toolkit@googlegroups.com Subject: Re: Images from DB use a standard servlet - it's just a URL as far as the client is concerned. Here's an example I found: // This method is called by the servlet container to process a GET request. public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { // Get the absolute path of the image ServletContext sc = getServletContext(); String filename = sc.getRealPath(image.gif); // Get the MIME type of the image String mimeType = sc.getMimeType(filename); if (mimeType == null) { sc.log(Could not get MIME type of +filename); resp.setStatus (HttpServletResponse.SC_INTERNAL_SERVER_ERROR); return; } // Set content type resp.setContentType(mimeType); // Set content size File file = new File(filename); resp.setContentLength((int)file.length()); // Open the file and output streams FileInputStream in = new FileInputStream(file); OutputStream out = resp.getOutputStream(); // Copy the contents of the file to the output stream byte[] buf = new byte[1024]; int count = 0; while ((count = in.read(buf)) = 0) { out.write(buf, 0, count); } in.close(); out.close(); } You need to adapt this to: 1) Strip the image name from the HttpRequest URL so you can use it to build your JDBC query. 2) Check your DB docs to see how to get an InputStream (as opposed a byte array) out of the ResultSet 3) Then you plug this InputStream into the response OutputStream instead of the FileInputStream used in the example 4) I'm not sure what the significance of the MimeType bit in the example is - you might be able to just set this to a constant if it's needed The main idea is that you set up streams piping the image bytes directly from your DB out to the client using a small byte buffer (say 1024 bytes as in example) in the servlet. This avoids creating big byte [] objects on the web server which hammers memory. regards gregor On Nov 15, 6:52 am, CodeABunch [EMAIL PROTECTED] wrote: Greetings. I'm dynamically reading images stored in the DB and I need to render them in the screen The Image Widget reads only static URLs so I need to have the images saved in a temp directory (but still accessible from regular URL). I'm wondering if there is any other smart way of doing this. Any light out there? Thanks! --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
applicationCreator failed to start
Hi. applicationCreator faild to start in my windows sys. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
missing images in IE
Greetings, using the following code will result in image not being loaded: FlexTable table = new FlexTable(); Image img = new Image(icons/img.png); table.setWidget(0, 0, img); Image img2 = new Image(icons/img2.png); table.setWidget(0, 0, img2); Internal symptoms: -- img has both __pendingSrc and src attributes set -- img2 has only __pendingSrc set -- srcImgMap contains img with img2 as its child I suspect that when img is removed from table it can no longer receive onload event and therefore will never update children's src attribute and remove itself from the srcImgMap. Is my suspicion correct? Anybody has a fix/workaround for this? Thanks for any response! --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Firefox rendering wrong
Hi jsantaelena, Even one pixel will the do the damage if you have two widgets right up against each other. if you run Showcase from here: http://gwt.google.com/samples/Showcase/Showcase.html#CwCheckBox and open it full screen in both IE FF, you will see (by switching their window tabs, this makes it obvious) that it is actually slightly different in each browser, the extent of the difference depending on which example you select (at least it is in my IE FF setups, but that's the point isn't it). Now if you look through the Showcase code to see why a particular example of interest is different between IE FF you find it probably has to do with the box model issue. I haven't done this with Showcase, but I did it with its previous GWT 1.4.x incarnation KitchenSink when I faced exactly your problem last year. So unfortunately I can't point you to the exact code/CSS that demonstrates it in Showcase. In 1.4.x KitchenSink you can see it clearly in the HorizontalSplitPanel demo. Google don't seem to care that it looks slightly different (pixel for pixel) in IE FF because as an application it works perfectly well in both browsers. The way they design UI's makes the difference irrelevant. Notice the spacings between the widgets. But if you design a layout that puts widgets right up against each other, a more windows/ desktop style UI design so to speak, you suddenly run into trouble with this box model problem (whereas Google seem to walk around it by designing the problem out). Some might say that the Google GWT team, faced with competition from Ext-JS (and their extended family of GWT-Ext wrappers) are being reluctantly dragged, kicking and screaming, into a more windows friendly approach. Others might argue that in reality it is Google who are dragging us die hard desktop/business application programmers, similarly kicking and screaming, into a 21st century where the likes of GWT and Gears are swiftly making the Windows desktop paradigm old hat - Web 3.0 perhaps. FWIW I started 2007 in the former camp, I am now in the latter. Anyway enough musing. It is possible to make a cross-browser Windows style UI with GWT but you have to do some extra work depending on exactly what you want to do. regards gregor On Nov 15, 2:06 pm, jsantaelena [EMAIL PROTECTED] wrote: I'm not setting large border (1px or 2px) and i'm not using margins or padding. Why not happens with GWT Showcase? Another intersting thing is, after each refresh, FF renders my applicatios more massed. I'm using this DOCTYPE: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; And my CSS just sets fonts, colors, backgrounds... On 15 nov, 08:43, gregor [EMAIL PROTECTED] wrote: Hi, Are you using any borders/margins/padding with your panels? If you are this is might be the cause of your problem Google IE broken box model. You will find info about the difference between how IE and FF (and other browsers) handle borders etc . Basically the issue is this: say you have a panel that is set to 100px X 100px, and you add a 5px border to it. IE renders this 100 x 100 total (so the actual box is now 90 x 90), whereas FF renders it as 110 x 110 total (so the actual box remains 100 x 100). Another way of looking at it is that FF works from inside out whereas IE works from outside in. Actually the FF approach follows W3C standards whereas IE does not (hence IE broken box model). In some situations GWT deals with this automatically for you, in others it doesn't. You will find a lot of different approaches to dealing with this on the net using javascript/CSS techniques because this problem has been around a long time. With GWT there are a range of more Java oriented techniques available revolving around how you go about nesting and separating primary display containers and their contents. If you create a short EntryPoint test class that demonstrates your particular issue and post it here I'm sure you will get a range of solution options suggested. regards gregor On Nov 15, 2:32 am, reechard [EMAIL PROTECTED] wrote: yes -- I am experiencing this. Wondering if I need to use some kind of browser-specific CSS style to fix it... On Nov 14, 5:29 pm, jsantaelena [EMAIL PROTECTED] wrote: Hi all, My GWT application render very well in IE, but in FF the panels (VerticalPanes, HorizontalPanels and FlexTables) overlaps, all of them. Have somebody expereinced this? Thanks! --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: RPC, database connection reality check?
Ok thanks, makes sense, Mark On Nov 15, 10:09 am, Adam T [EMAIL PROTECTED] wrote: yes and yes. I would recommend you check out conection pooling - you should be able to get your servlet container to hold a pool of connections open that your code can then request to use as needed. You'll need to do two things: a) set up pooling on your container and b) change your code slightly to use the pooled connections. Set up in your container is not usually difficult, but is often container specific. For example, Tomcat can be set up as follows:http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howt... Some of the principles to move from what you have in your current code to code that uses conection pooling are in this article:http://www.javaranch.com/journal/200601/JDBCConnectionPooling.html Hope that helps. //Adam On 15 Nov, 15:57, markww [EMAIL PROTECTED] wrote: Hi, I am testing out a simple RPC call (as in the StockWatcher example). I'm pulling some records from a database in the service now: public class MyServiceImpl extends RemoteServiceServlet implements IMyService public Stuff[] getStuff(String criteria) { Class.forName(com.mysql.jdbc.Driver).newInstance(); con = DriverManager.getConnection(jdbc:mysql://127.0.0.1:3306/ test,username,password); stmt = con.createStatement(); rs = stmt.executeQuery(SELECT * FROM blah); while (rs.next()) { ... } } return stuff; } It works fine, but I'm wondering about performance if I have several thousand users calling this webservice simultaneously - would each client be creating a brand new connection to my database when this RPC function is called? If so, is that going to hold up for large volumes of users? If not, can I somehow keep one db connection alive on my server to pass around to new clients instead of constantly reconnecting? Thanks --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Firefox rendering wrong
Ok, I can undertand what you said. But, in your Shoucase example the differences are acceptable. In my case the direfferences makes my application unusable in FF. I thought this could be justa a div display block instead of inline, or something like that. But... my mistake... Thanks a lot On Sat, Nov 15, 2008 at 4:15 PM, gregor [EMAIL PROTECTED]wrote: Hi jsantaelena, Even one pixel will the do the damage if you have two widgets right up against each other. if you run Showcase from here: http://gwt.google.com/samples/Showcase/Showcase.html#CwCheckBox and open it full screen in both IE FF, you will see (by switching their window tabs, this makes it obvious) that it is actually slightly different in each browser, the extent of the difference depending on which example you select (at least it is in my IE FF setups, but that's the point isn't it). Now if you look through the Showcase code to see why a particular example of interest is different between IE FF you find it probably has to do with the box model issue. I haven't done this with Showcase, but I did it with its previous GWT 1.4.x incarnation KitchenSink when I faced exactly your problem last year. So unfortunately I can't point you to the exact code/CSS that demonstrates it in Showcase. In 1.4.x KitchenSink you can see it clearly in the HorizontalSplitPanel demo. Google don't seem to care that it looks slightly different (pixel for pixel) in IE FF because as an application it works perfectly well in both browsers. The way they design UI's makes the difference irrelevant. Notice the spacings between the widgets. But if you design a layout that puts widgets right up against each other, a more windows/ desktop style UI design so to speak, you suddenly run into trouble with this box model problem (whereas Google seem to walk around it by designing the problem out). Some might say that the Google GWT team, faced with competition from Ext-JS (and their extended family of GWT-Ext wrappers) are being reluctantly dragged, kicking and screaming, into a more windows friendly approach. Others might argue that in reality it is Google who are dragging us die hard desktop/business application programmers, similarly kicking and screaming, into a 21st century where the likes of GWT and Gears are swiftly making the Windows desktop paradigm old hat - Web 3.0 perhaps. FWIW I started 2007 in the former camp, I am now in the latter. Anyway enough musing. It is possible to make a cross-browser Windows style UI with GWT but you have to do some extra work depending on exactly what you want to do. regards gregor On Nov 15, 2:06 pm, jsantaelena [EMAIL PROTECTED] wrote: I'm not setting large border (1px or 2px) and i'm not using margins or padding. Why not happens with GWT Showcase? Another intersting thing is, after each refresh, FF renders my applicatios more massed. I'm using this DOCTYPE: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; And my CSS just sets fonts, colors, backgrounds... On 15 nov, 08:43, gregor [EMAIL PROTECTED] wrote: Hi, Are you using any borders/margins/padding with your panels? If you are this is might be the cause of your problem Google IE broken box model. You will find info about the difference between how IE and FF (and other browsers) handle borders etc . Basically the issue is this: say you have a panel that is set to 100px X 100px, and you add a 5px border to it. IE renders this 100 x 100 total (so the actual box is now 90 x 90), whereas FF renders it as 110 x 110 total (so the actual box remains 100 x 100). Another way of looking at it is that FF works from inside out whereas IE works from outside in. Actually the FF approach follows W3C standards whereas IE does not (hence IE broken box model). In some situations GWT deals with this automatically for you, in others it doesn't. You will find a lot of different approaches to dealing with this on the net using javascript/CSS techniques because this problem has been around a long time. With GWT there are a range of more Java oriented techniques available revolving around how you go about nesting and separating primary display containers and their contents. If you create a short EntryPoint test class that demonstrates your particular issue and post it here I'm sure you will get a range of solution options suggested. regards gregor On Nov 15, 2:32 am, reechard [EMAIL PROTECTED] wrote: yes -- I am experiencing this. Wondering if I need to use some kind of browser-specific CSS style to fix it... On Nov 14, 5:29 pm, jsantaelena [EMAIL PROTECTED] wrote: Hi all, My GWT application render very well in IE, but in FF the panels (VerticalPanes, HorizontalPanels and FlexTables) overlaps, all of them. Have somebody expereinced this?
Javascript object - what are our options?
Hi, Can we use objects created in native javascript code in our GWT apps? There's a library I want to use which creates an object and uses it like: Car = new Car(); car.onDrive = function(ntype, from, to) { if (! ntype) { whatever(); } } I wouldn't have a representation of this object in my GWT code, I guess it would just live in JNDI blocks. But I'm not sure how we go about doing something like that. In my mind it would look something like: public class MyAppGWT implements EntryPoint { public void onModuleLoad() { // Allocate native js which I want to be persistent somehow... allocateJsObject(); } public static native void allocateJsObject() /*-{ script src=http://lpath_to_lib_src/GreatLibrary.js;/ script Car car = new Car(); car.onDrive = function(from, to) { return ok driving?; }-*/; public static native void driveWrapper() /*{ // Recover the global car instance somehow and use it? car.drive(NY, LA); }*/; Yeah so how will Car persist in the application - is it now alive for the duration of my app, or will it die after allocateJsObject() exits? The object itself only really takes in and then produces text,so I'm guessing it is possible to hook up in some way. Thanks --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Firefox rendering wrong
So express exactly what they are. On Nov 15, 6:38 pm, Jose Santa Elena [EMAIL PROTECTED] wrote: Ok, I can undertand what you said. But, in your Shoucase example the differences are acceptable. In my case the direfferences makes my application unusable in FF. I thought this could be justa a div display block instead of inline, or something like that. But... my mistake... Thanks a lot On Sat, Nov 15, 2008 at 4:15 PM, gregor [EMAIL PROTECTED]wrote: Hi jsantaelena, Even one pixel will the do the damage if you have two widgets right up against each other. if you run Showcase from here: http://gwt.google.com/samples/Showcase/Showcase.html#CwCheckBox and open it full screen in both IE FF, you will see (by switching their window tabs, this makes it obvious) that it is actually slightly different in each browser, the extent of the difference depending on which example you select (at least it is in my IE FF setups, but that's the point isn't it). Now if you look through the Showcase code to see why a particular example of interest is different between IE FF you find it probably has to do with the box model issue. I haven't done this with Showcase, but I did it with its previous GWT 1.4.x incarnation KitchenSink when I faced exactly your problem last year. So unfortunately I can't point you to the exact code/CSS that demonstrates it in Showcase. In 1.4.x KitchenSink you can see it clearly in the HorizontalSplitPanel demo. Google don't seem to care that it looks slightly different (pixel for pixel) in IE FF because as an application it works perfectly well in both browsers. The way they design UI's makes the difference irrelevant. Notice the spacings between the widgets. But if you design a layout that puts widgets right up against each other, a more windows/ desktop style UI design so to speak, you suddenly run into trouble with this box model problem (whereas Google seem to walk around it by designing the problem out). Some might say that the Google GWT team, faced with competition from Ext-JS (and their extended family of GWT-Ext wrappers) are being reluctantly dragged, kicking and screaming, into a more windows friendly approach. Others might argue that in reality it is Google who are dragging us die hard desktop/business application programmers, similarly kicking and screaming, into a 21st century where the likes of GWT and Gears are swiftly making the Windows desktop paradigm old hat - Web 3.0 perhaps. FWIW I started 2007 in the former camp, I am now in the latter. Anyway enough musing. It is possible to make a cross-browser Windows style UI with GWT but you have to do some extra work depending on exactly what you want to do. regards gregor On Nov 15, 2:06 pm, jsantaelena [EMAIL PROTECTED] wrote: I'm not setting large border (1px or 2px) and i'm not using margins or padding. Why not happens with GWT Showcase? Another intersting thing is, after each refresh, FF renders my applicatios more massed. I'm using this DOCTYPE: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; And my CSS just sets fonts, colors, backgrounds... On 15 nov, 08:43, gregor [EMAIL PROTECTED] wrote: Hi, Are you using any borders/margins/padding with your panels? If you are this is might be the cause of your problem Google IE broken box model. You will find info about the difference between how IE and FF (and other browsers) handle borders etc . Basically the issue is this: say you have a panel that is set to 100px X 100px, and you add a 5px border to it. IE renders this 100 x 100 total (so the actual box is now 90 x 90), whereas FF renders it as 110 x 110 total (so the actual box remains 100 x 100). Another way of looking at it is that FF works from inside out whereas IE works from outside in. Actually the FF approach follows W3C standards whereas IE does not (hence IE broken box model). In some situations GWT deals with this automatically for you, in others it doesn't. You will find a lot of different approaches to dealing with this on the net using javascript/CSS techniques because this problem has been around a long time. With GWT there are a range of more Java oriented techniques available revolving around how you go about nesting and separating primary display containers and their contents. If you create a short EntryPoint test class that demonstrates your particular issue and post it here I'm sure you will get a range of solution options suggested. regards gregor On Nov 15, 2:32 am, reechard [EMAIL PROTECTED] wrote: yes -- I am experiencing this. Wondering if I need to use some kind of browser-specific CSS style to fix it... On Nov 14, 5:29 pm, jsantaelena [EMAIL PROTECTED] wrote: Hi all, My GWT application render
Re: Javascript object - what are our options?
Hi, Check out the JSNI documentation here: http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5s=google-web-toolkit-doc-1-5t=DevGuideMarshaling, which talks about the JavaScriptObject that you want to use. Basically you can hold on to an javascript object that is opaque to the java code. You can either pass it to future calls, or access the member directly from your class: public class GWTCar { private JavaScriptObject jsCar; public GWTCar() { jsCar = allocateJsObject(); driveCar(jsCar); // Pass the car to this version altDriveCar(); // This version retrieves it from the class } public native JavaScriptObject allocateJsObject() /*-{ Car car = new Car(); return car; }-*/ public native void driveCar(JavaScriptObject car) /*-{ car.drive(NY, LA); }-*/ public native void altDriveCar() /*-{ var car = [EMAIL PROTECTED]::jsCar; car.drive(NY, LA); }-*/ } Your best bet is to actually wrap the javascript functionality in a separate class, which can then be created and accessed fully in Java, as shown above, so the javascript is fully encapsulated away. jk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: applicationCreator failed to start
Hi, Did You set GWT_HOME? Did You add it into path? It's needed to run windows script (.bat) on console from any directory in your discs. Failed means? Windows means? Try read this: http://code.google.com/webtoolkit/gettingstarted.html Chapter: Creating an Application from Scratch and http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5s=google-web-toolkit-doc-1-5t=DevGuideApplicationCreator Michal Google King napisał(a): Hi. applicationCreator faild to start in my windows sys. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Javascript object - what are our options?
Great that looks perfect, thanks for the example, Mark On Nov 15, 2:52 pm, kozura [EMAIL PROTECTED] wrote: Hi, Check out the JSNI documentation here:http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5s=goog..., which talks about the JavaScriptObject that you want to use. Basically you can hold on to an javascript object that is opaque to the java code. You can either pass it to future calls, or access the member directly from your class: public class GWTCar { private JavaScriptObject jsCar; public GWTCar() { jsCar = allocateJsObject(); driveCar(jsCar); // Pass the car to this version altDriveCar(); // This version retrieves it from the class } public native JavaScriptObject allocateJsObject() /*-{ Car car = new Car(); return car; }-*/ public native void driveCar(JavaScriptObject car) /*-{ car.drive(NY, LA); }-*/ public native void altDriveCar() /*-{ var car = [EMAIL PROTECTED]::jsCar; car.drive(NY, LA); }-*/ } Your best bet is to actually wrap the javascript functionality in a separate class, which can then be created and accessed fully in Java, as shown above, so the javascript is fully encapsulated away. jk --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Using website's CSS in RichTextArea
Hi all, I'm trying to do a WYSIWYG area that could be easily adapted to several websites (that is to say without requiring to change the stylesheet). Is there any way to use the website's stylesheet in a RichTextArea instead of the .gwt-RichTextArea {} ? I've tried to change the styleSheetName, but it doesn't work (and I don't really know where it takes its css when I remove everything). --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Javascript object - what are our options?
Look at JavaScriptObject: http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5s=google-web-toolkit-doc-1-5t=DevGuideOverlayTypes In particular you might write something like this: public class Car extends JavaScriptObject { public static final native Car newCar() /*-{ return new Car(); }-*/; protected Car() { } public final native void drive(String from, String to)/*-{ this.drive(from, to); }-*/ } On Sat, Nov 15, 2008 at 11:00, markww [EMAIL PROTECTED] wrote: Hi, Can we use objects created in native javascript code in our GWT apps? There's a library I want to use which creates an object and uses it like: Car = new Car(); car.onDrive = function(ntype, from, to) { if (! ntype) { whatever(); } } I wouldn't have a representation of this object in my GWT code, I guess it would just live in JNDI blocks. But I'm not sure how we go about doing something like that. In my mind it would look something like: public class MyAppGWT implements EntryPoint { public void onModuleLoad() { // Allocate native js which I want to be persistent somehow... allocateJsObject(); } public static native void allocateJsObject() /*-{ script src=http://lpath_to_lib_src/GreatLibrary.js;/ script Car car = new Car(); car.onDrive = function(from, to) { return ok driving?; }-*/; public static native void driveWrapper() /*{ // Recover the global car instance somehow and use it? car.drive(NY, LA); }*/; Yeah so how will Car persist in the application - is it now alive for the duration of my app, or will it die after allocateJsObject() exits? The object itself only really takes in and then produces text,so I'm guessing it is possible to hook up in some way. Thanks --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Theming a custom widget
Hoping to get a response as I didn't get any before. For a custom widget with panels, I would like to stylize the panels based on the selected theme - ie different styles for different themes. How could I do this? On Nov 13, 7:45 pm, Riyaz Mansoor [EMAIL PROTECTED] wrote: Yes this is my problem. I've got panels that I am styling with css. I would like to detect what is currently selected/applied theme and apply appropriate styles to these panels so that there is a formatting consistency when the theme is changed to, say, Chrome. have panels and tables in your custom-widget you have to define the CSS rules yourself. You can link your own CSS file with a stylesheet tag in the module xml file. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Adding emulation class
I'm trying to add some emulation classes for integration with WebObjects. For example, the class NSTimestamp extends java.sql.Timestamp, which is already emulated. I've written the emulation class and the CustomFieldSerializer (the class implements java.io.Serializable). The CustomFieldSerializer is mostly copied from the Timestamp one. The class works on the client with no serialization. But when I do an RPC request using it I get this error: [ERROR] This application is out of date, please click the refresh button on your browser. com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException: This application is out of date, please click the refresh button on your browser. at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived (RequestCallbackAdapter.java:204) at com.google.gwt.http.client.Request.fireOnResponseReceivedImpl (Request.java:254) at com.google.gwt.http.client.Request.fireOnResponseReceivedAndCatch (Request.java:226) at com.google.gwt.http.client.Request.fireOnResponseReceived (Request.java:217) Stepping through it a bit, I see that the preceding exception is SerializationException: com.webobjects.foundation.NSTimestamp which seems to mean that there was a problem serializing that class. I've verified that the custom serializer's serialize method is getting called and works. What else is needed to support serialization? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Adding emulation class
Actually, I created a new project with just this code and it WORKS. The difference is my real project isn't using RemoteServiceServlet. I'm just using the RPC class directly as described in it's javadoc; I have a function: public String processCall(String payload) throws SerializationException { try { RPCRequest rpcRequest = RPC.decodeRequest(payload, this.getClass ()); return RPC.invokeAndEncodeResponse(this, rpcRequest.getMethod(), rpcRequest.getParameters()); } catch (IncompatibleRemoteServiceException ex) { return RPC.encodeResponseForFailure(null, ex); } } I'm wondering if it is using the default serialization policy instead of a generated one. I tried creating a custom SerializationPolicy class that allows everything and passed it to RPC.invokeAndEncodeResponse but it didn't change anything. How can I tell what policy is being used? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
ScrollTable scroll position
sorry I can't write English well.. I have make keyboard shortcut like GMail.. problem../ when I input key ( j key ) scroll down. but I can't.. int scrollPosition = 20; scrollTable.getElement().setScrollTop(scrollPosition); - it not work http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/940e0c84b59965fa/381b38370aeb8afd?lnk=raot I see this link.. but source code. error... private static native void crollTables(ScrollTable table) { error... [EMAIL PROTECTED]::scrollTables (Z) (false); } please tell me... --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
Re: Javascript object - what are our options?
Ok those links and examples provided helped a lot, I think I have most of it now. One problem though, when allocating my javascript object, execution just kind of dies with no error when trying to allocate an internal DOMParser instance, like: // car.js Car = function() { var parser = new DOMParser(); } I'm not sure why this is, I'm just testing by placing alerts around the code (sadly). The execution stops on that line and returns back to my original allocation function, and the returned JavaScriptObject instance is null: private native JavaScriptObject _allocateCar() /*-{ return new $wnd.Car(); // will return null. }-*/; Whether this is related or not, I don't know, but I have to place $wnd before the type in order for GWT to take it. Well I'm pretty much stuck on this, if anyone has any ideas that'd be great. This is a 3rd party library I'm trying to use, it'd be a lot easier if it were in GWT already, Thanks On Nov 15, 2:08 pm, Shawn Pearce [EMAIL PROTECTED] wrote: Look at JavaScriptObject:http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5s=goog... In particular you might write something like this: public class Car extends JavaScriptObject { public static final native Car newCar() /*-{ return new Car(); }-*/; protected Car() { } public final native void drive(String from, String to)/*-{ this.drive(from, to); }-*/ } On Sat, Nov 15, 2008 at 11:00, markww [EMAIL PROTECTED] wrote: Hi, Can we use objects created in native javascript code in our GWT apps? There's a library I want to use which creates an object and uses it like: Car = new Car(); car.onDrive = function(ntype, from, to) { if (! ntype) { whatever(); } } I wouldn't have a representation of this object in my GWT code, I guess it would just live in JNDI blocks. But I'm not sure how we go about doing something like that. In my mind it would look something like: public class MyAppGWT implements EntryPoint { public void onModuleLoad() { // Allocate native js which I want to be persistent somehow... allocateJsObject(); } public static native void allocateJsObject() /*-{ script src=http://lpath_to_lib_src/GreatLibrary.js;/ script Car car = new Car(); car.onDrive = function(from, to) { return ok driving?; }-*/; public static native void driveWrapper() /*{ // Recover the global car instance somehow and use it? car.drive(NY, LA); }*/; Yeah so how will Car persist in the application - is it now alive for the duration of my app, or will it die after allocateJsObject() exits? The object itself only really takes in and then produces text,so I'm guessing it is possible to hook up in some way. Thanks --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~--~~~~--~~--~--~---
[gwt-contrib] Re: Proposal: Simplification of ScrollTable
Some more observations regarding PagingScrollTable: Right now the developer is responsible for calling setRowCount on the table model after retrieving data. If you don't call this method you'll get strange results like flashing empty table + endless paging. Unfortunately there is no method like getRowCount() defined in the Response. The if you are using paging in conjunction with remote requests there is no way to get the number of total available rows (they differ from the actual requested rows as they are limited by the page size). Proposal: Add the getRowCount() method to the Reponse and call the setRowCount on the table model in the callback. I've implemented this in my branch. While implementing this I found it very annoying that Iterators are used heavily insted of Collections, so you can never tell easily how many rows are available in total. What is the reason for using Iterators instead of Collections? Maybe it's just me but my guts tell me Iterators are error prone and scaring... --~--~-~--~~~---~--~~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~--~~~~--~~--~--~---