Re: displaying static content in gwt
Sorry, I am not getting you.. Do You mean including it into the html file directly by editing the .html file? We are using GWT (with ext) only to design the pages. If I include it using GWT, I'll be using setHtml(String) method to add the html. I dont want to hard code the chunks of html code in string. thx On Oct 26, 2:59 pm, Thomas Broyer t.bro...@gmail.com wrote: On 26 oct, 10:50, usmanf linkusma...@yahoo.com wrote: I am thinking to place most of the design code [html] in the static files with .html and place their contents into the panel's setHtml() instead of writing GWT code for every thing. like for example I have a panel in the top that contains anchors like Home, Support, News etc. Instead of creating a Hyperlink object for each link and setting the style element to format it, I am thinking to read this chunk of code from a html file and use the panels's setHtml (String) to display it. The benefit I can see with this approach is avoid compiling the code even for a small change and also it could be easy to change in the future. Am I thinking in the right direction? Is there any other optimistic way of doing it? Cannot you just include it in your HTML host page instead of creating/ managing it as a GWT widget? (you can still show/hide it using GWT if you want, using e.g. UIObject.setVisible(Document;get().getElementById (header), true)) --~--~-~--~~~---~--~~ 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: Displaying static content on gwt client
Do I need to svn checkout to from the gwt to get files for the UiBinder stuff? We are using gwt 1.7.1 with ext 2.0.1. unable to find any support inside gwt 1.7.1 On Oct 26, 5:05 pm, Sripathi Krishnan sripathi.krish...@gmail.com wrote: There a couple of approaches you can use, each with its pros and cons. 1. You can put it in the initial user request with code using jsp/php/asp - but that would mean your initial page load size is going to increase. If the content is really important - you can use this approach; but for things like news and advertisements - its not worth the extra time it is going to take to see the main content of your application. 2. You can use UiBinder - but it is a compile time thing. You cannot change the content at run time. But it has the best performance - even better than putting your content within jsp/asp/php. If you don't mind recompiling and redeploying your application whenever content changes, this is the best option. 3. You can dynamically download the data using RequestBuilder - but that has the worst performance. It is a new http request to download the html, and perhaps additional requests to download embedded images and CSS. Plus, there are things like Cross Site Scripting to think about (GWT should handle most of it, but you could still get in trouble). But then - it gives you the highest flexibility - no recompilations. The approach you choose depends on how frequently your content changes, how much you care about performance, and how much flexibility you desire. --Sri 2009/10/26 jhulford jhulf...@gmail.com I would suggest using something like jsp / php / asp to generate your GWT host page and have all the static content loaded directly into the page during the initial user request along w/ the code to load up your GWT module. Or if you don't mind using bleeding edge code, you may want to take a look at the new UIBinder stuff in the 2.0 release candidate. On Oct 24, 9:32 am, usmanf linkusma...@yahoo.com wrote: I am designing a home page for my website using GWT ext (GXT). It contains a lot of static contents like news, advert text etc that usually goes on the home page. Firstly I tried separating the static content into html files and reading them using java.io.FileReader to set them on the Panel's setHtml(). I realized that GWT SDK does not allow to use java.io.* on the client side. The only way I have now is to place the static content into hard-coded string values like --~--~-~--~~~---~--~~ 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: Displaying static content on gwt client
You can use GWT 2.0 Milestone 2 from this link - http://code.google.com/p/google-web-toolkit/downloads/list?can=1q=2.0+Milestone+2 Alternatively, you can also build GWT from source. --Sri 2009/10/27 usmanf linkusma...@yahoo.com Do I need to svn checkout to from the gwt to get files for the UiBinder stuff? We are using gwt 1.7.1 with ext 2.0.1. unable to find any support inside gwt 1.7.1 On Oct 26, 5:05 pm, Sripathi Krishnan sripathi.krish...@gmail.com wrote: There a couple of approaches you can use, each with its pros and cons. 1. You can put it in the initial user request with code using jsp/php/asp - but that would mean your initial page load size is going to increase. If the content is really important - you can use this approach; but for things like news and advertisements - its not worth the extra time it is going to take to see the main content of your application. 2. You can use UiBinder - but it is a compile time thing. You cannot change the content at run time. But it has the best performance - even better than putting your content within jsp/asp/php. If you don't mind recompiling and redeploying your application whenever content changes, this is the best option. 3. You can dynamically download the data using RequestBuilder - but that has the worst performance. It is a new http request to download the html, and perhaps additional requests to download embedded images and CSS. Plus, there are things like Cross Site Scripting to think about (GWT should handle most of it, but you could still get in trouble). But then - it gives you the highest flexibility - no recompilations. The approach you choose depends on how frequently your content changes, how much you care about performance, and how much flexibility you desire. --Sri 2009/10/26 jhulford jhulf...@gmail.com I would suggest using something like jsp / php / asp to generate your GWT host page and have all the static content loaded directly into the page during the initial user request along w/ the code to load up your GWT module. Or if you don't mind using bleeding edge code, you may want to take a look at the new UIBinder stuff in the 2.0 release candidate. On Oct 24, 9:32 am, usmanf linkusma...@yahoo.com wrote: I am designing a home page for my website using GWT ext (GXT). It contains a lot of static contents like news, advert text etc that usually goes on the home page. Firstly I tried separating the static content into html files and reading them using java.io.FileReader to set them on the Panel's setHtml(). I realized that GWT SDK does not allow to use java.io.* on the client side. The only way I have now is to place the static content into hard-coded string values like --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
displaying static content in gwt
I am thinking to place most of the design code [html] in the static files with .html and place their contents into the panel's setHtml() instead of writing GWT code for every thing. like for example I have a panel in the top that contains anchors like Home, Support, News etc. Instead of creating a Hyperlink object for each link and setting the style element to format it, I am thinking to read this chunk of code from a html file and use the panels's setHtml (String) to display it. The benefit I can see with this approach is avoid compiling the code even for a small change and also it could be easy to change in the future. Am I thinking in the right direction? Is there any other optimistic way of doing it? --~--~-~--~~~---~--~~ 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: displaying static content in gwt
On 26 oct, 10:50, usmanf linkusma...@yahoo.com wrote: I am thinking to place most of the design code [html] in the static files with .html and place their contents into the panel's setHtml() instead of writing GWT code for every thing. like for example I have a panel in the top that contains anchors like Home, Support, News etc. Instead of creating a Hyperlink object for each link and setting the style element to format it, I am thinking to read this chunk of code from a html file and use the panels's setHtml (String) to display it. The benefit I can see with this approach is avoid compiling the code even for a small change and also it could be easy to change in the future. Am I thinking in the right direction? Is there any other optimistic way of doing it? Cannot you just include it in your HTML host page instead of creating/ managing it as a GWT widget? (you can still show/hide it using GWT if you want, using e.g. UIObject.setVisible(Document;get().getElementById (header), true)) --~--~-~--~~~---~--~~ 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: Displaying static content on gwt client
I would suggest using something like jsp / php / asp to generate your GWT host page and have all the static content loaded directly into the page during the initial user request along w/ the code to load up your GWT module. Or if you don't mind using bleeding edge code, you may want to take a look at the new UIBinder stuff in the 2.0 release candidate. On Oct 24, 9:32 am, usmanf linkusma...@yahoo.com wrote: I am designing a home page for my website using GWT ext (GXT). It contains a lot of static contents like news, advert text etc that usually goes on the home page. Firstly I tried separating the static content into html files and reading them using java.io.FileReader to set them on the Panel's setHtml(). I realized that GWT SDK does not allow to use java.io.* on the client side. The only way I have now is to place the static content into hard-coded string values like --~--~-~--~~~---~--~~ 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: Displaying static content on gwt client
There a couple of approaches you can use, each with its pros and cons. 1. You can put it in the initial user request with code using jsp/php/asp - but that would mean your initial page load size is going to increase. If the content is really important - you can use this approach; but for things like news and advertisements - its not worth the extra time it is going to take to see the main content of your application. 2. You can use UiBinder - but it is a compile time thing. You cannot change the content at run time. But it has the best performance - even better than putting your content within jsp/asp/php. If you don't mind recompiling and redeploying your application whenever content changes, this is the best option. 3. You can dynamically download the data using RequestBuilder - but that has the worst performance. It is a new http request to download the html, and perhaps additional requests to download embedded images and CSS. Plus, there are things like Cross Site Scripting to think about (GWT should handle most of it, but you could still get in trouble). But then - it gives you the highest flexibility - no recompilations. The approach you choose depends on how frequently your content changes, how much you care about performance, and how much flexibility you desire. --Sri 2009/10/26 jhulford jhulf...@gmail.com I would suggest using something like jsp / php / asp to generate your GWT host page and have all the static content loaded directly into the page during the initial user request along w/ the code to load up your GWT module. Or if you don't mind using bleeding edge code, you may want to take a look at the new UIBinder stuff in the 2.0 release candidate. On Oct 24, 9:32 am, usmanf linkusma...@yahoo.com wrote: I am designing a home page for my website using GWT ext (GXT). It contains a lot of static contents like news, advert text etc that usually goes on the home page. Firstly I tried separating the static content into html files and reading them using java.io.FileReader to set them on the Panel's setHtml(). I realized that GWT SDK does not allow to use java.io.* on the client side. The only way I have now is to place the static content into hard-coded string values like --~--~-~--~~~---~--~~ 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: Displaying static content on gwt client
Thanks for the reply. So it means that it is going to be a GET request from the client to the server for the resource once the client will load on the browser. I am thinking to place most of the design code [html] in the static files with .html and place their contents into the panel's setHtml() instead of writing GWT code for every thing. like for example I have a panel in the top that contains anchors like Home, Support, News etc. Instead of creating a Hyperlink object for each link and setting the style element to format it, I am thinking to read this chunk of code from a html file [now use RequestBuilder] and use the panels's setHtml (String) to display it. The benefit I can see with this approach is avoid compiling the code even for a small change and also it could be easy to change in the future. Am I thinking in the right direction? On Oct 25, 3:33 am, Sripathi Krishnan sripathi.krish...@gmail.com wrote: Instead of using java.io.* packages, you can use GWTs RequestBuilder class to achieve the same thing. Only restriction - the static content should be served from the same domain as your web application. RequestBuilder request = new RequestBuilder(RequestBuilder.GET, url /*must be in same domain as your web app*/); try { request.sendRequest(null, new RequestCallback() { public void onResponseReceived(Request request, Response response) { String content = response.getText(); if (response.getStatusCode() != 200) { //handle error } else if (content == null || content.equals()) { //handle error } else { setStaticContentInHtmlPanel(content); } } public void onError(Request request, Throwable exception) { // handle error } }); } catch (RequestException re) { //handle error } --Sri 2009/10/24 usmanf linkusma...@yahoo.com I am designing a home page for my website using GWT ext (GXT). It contains a lot of static contents like news, advert text etc that usually goes on the home page. Firstly I tried separating the static content into html files and reading them using java.io.FileReader to set them on the Panel's setHtml(). I realized that GWT SDK does not allow to use java.io.* on the client side. The only way I have now is to place the static content into hard-coded string values like Panel panel = new Panel(); panel.setHtml(pNews/pp news news nes newsnsnwensd nsdnewes/ p); I have got a lot of static content to display on the home page which is quite annoying to place in the String. Is there any other way/ solution around. 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 google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---
Displaying static content on gwt client
I am designing a home page for my website using GWT ext (GXT). It contains a lot of static contents like news, advert text etc that usually goes on the home page. Firstly I tried separating the static content into html files and reading them using java.io.FileReader to set them on the Panel's setHtml(). I realized that GWT SDK does not allow to use java.io.* on the client side. The only way I have now is to place the static content into hard-coded string values like Panel panel = new Panel(); panel.setHtml(pNews/pp news news nes newsnsnwensd nsdnewes/ p); I have got a lot of static content to display on the home page which is quite annoying to place in the String. Is there any other way/ solution around. 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 google-web-toolkit+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en -~--~~~~--~~--~--~---