Re: Any easy way to tell which file is for which permutation?
This looks really good Alex, I'll give it a try :) Thank you! On Dec 20, 1:04 am, Alex alex.mof...@gmail.com wrote: I wrote a post about GWT linkers last year and that includes a linker that produces a manifest that shows which generated file goes with which set of properties, including user.agent. Take a look athttp://development.lombardi.com/?p=29to see if it would help you out. On Dec 19, 5:57 pm, peterk peter.ke...@gmail.com wrote: Actually...upon further testing I'm back to square one. Rather strangely it appears that the order listed in the compile report is NOT the order in which the permutations are compiled. For example, the permutation for gecko 1_8 js is the 3rd file to be created but is listed as permutation 7 in the compile report! Hmm. How confusing. It's like GWT is actively trying to prevent you knowing which file is for which target :p Or is there some foolproof way of finding which is which? Cheers! On Dec 19, 11:05 pm, peterk peter.ke...@gmail.com wrote: Eep! Nevermind. I found the -compileReport which shows which permutation number is for which client. Then sorting my files in create order reveals which relates to which permutation number...and thus which target. A bit of a round-about way of doing it, and maybe there's an easier way, but this will do for now! On Dec 19, 10:47 pm, peterk peter.ke...@gmail.com wrote: Hey all, Sorry if this is a silly question but.. ...as you all know, if you compile with a regular number of permutations, you get a variety of javascript files for each of the different target browers. They typically have very random names. I was just wondering is there any easy way to spot which file is for which target? It'd be handy if each file had a comment at the top telling you which target it's for, or if the target was in the filename itself. For my app I need to do some hacking of the nocache.js file, which is why knowing which permutations are for which targets would be helpful to me... Thanks very much for any help! -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Any easy way to tell which file is for which permutation?
Hey all, Sorry if this is a silly question but.. ...as you all know, if you compile with a regular number of permutations, you get a variety of javascript files for each of the different target browers. They typically have very random names. I was just wondering is there any easy way to spot which file is for which target? It'd be handy if each file had a comment at the top telling you which target it's for, or if the target was in the filename itself. For my app I need to do some hacking of the nocache.js file, which is why knowing which permutations are for which targets would be helpful to me... Thanks very much for any help! -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Any easy way to tell which file is for which permutation?
Eep! Nevermind. I found the -compileReport which shows which permutation number is for which client. Then sorting my files in create order reveals which relates to which permutation number...and thus which target. A bit of a round-about way of doing it, and maybe there's an easier way, but this will do for now! On Dec 19, 10:47 pm, peterk peter.ke...@gmail.com wrote: Hey all, Sorry if this is a silly question but.. ...as you all know, if you compile with a regular number of permutations, you get a variety of javascript files for each of the different target browers. They typically have very random names. I was just wondering is there any easy way to spot which file is for which target? It'd be handy if each file had a comment at the top telling you which target it's for, or if the target was in the filename itself. For my app I need to do some hacking of the nocache.js file, which is why knowing which permutations are for which targets would be helpful to me... Thanks very much for any help! -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
Re: Any easy way to tell which file is for which permutation?
Actually...upon further testing I'm back to square one. Rather strangely it appears that the order listed in the compile report is NOT the order in which the permutations are compiled. For example, the permutation for gecko 1_8 js is the 3rd file to be created but is listed as permutation 7 in the compile report! Hmm. How confusing. It's like GWT is actively trying to prevent you knowing which file is for which target :p Or is there some foolproof way of finding which is which? Cheers! On Dec 19, 11:05 pm, peterk peter.ke...@gmail.com wrote: Eep! Nevermind. I found the -compileReport which shows which permutation number is for which client. Then sorting my files in create order reveals which relates to which permutation number...and thus which target. A bit of a round-about way of doing it, and maybe there's an easier way, but this will do for now! On Dec 19, 10:47 pm, peterk peter.ke...@gmail.com wrote: Hey all, Sorry if this is a silly question but.. ...as you all know, if you compile with a regular number of permutations, you get a variety of javascript files for each of the different target browers. They typically have very random names. I was just wondering is there any easy way to spot which file is for which target? It'd be handy if each file had a comment at the top telling you which target it's for, or if the target was in the filename itself. For my app I need to do some hacking of the nocache.js file, which is why knowing which permutations are for which targets would be helpful to me... Thanks very much for any help! -- You received this message because you are subscribed to the Google Groups Google Web Toolkit group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
How to unescape a JSONString?
I'm having some trouble dealing with escaping and unescaping of Java strings for encoding in JSON. I use JSONString to encode a Java string and that seems to work ok. For example, newlines turn into \n, tabs turn into \t and so on. However, given this escaped sequence back, how to I turn this back into an unescaped javastring wheren \n is turned into a newline and so on? If I use stringvalue() on the JSONString it just gives back the same json encoded string with the \n and \t encoding etc. Anyone have any ideas? :) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
OK to host multiple GWT applications/clients on one page?
Hey all, This might seem like an unusual use-case, but I'm wondering if it is OK to host multiple, independent GWT applications on a single HTML page? i.e. to embed two -no-cache.js files from seperate gwt apps in one page? I have done a little testing, I have two trivial gwt clients hosted in a single page at the moment, and they seem to work fine. But will this hold up with more complex apps, or are their gotchas I should look out for? Thanks for any insight! --~--~-~--~~~---~--~~ 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: Possible to insert a widget into the DOM?
Hey Gert, Thanks for the reply! I realised my problem with appending an Element..I was trying to append it to a TextNode which I think isn't allowed. So I've sorted that, I append to the text node's Parent now. On adding Widgets to a certain point in the DOM..this seems to work for me: I create the Widget, and add it to RootPanel. Then, I get its element and append that to the appropriate Node. This moves the widget to the correct place in the DOM, and at first glance I get the behaviours I would expect (e.g. the Widget's clicklisteners work etc.). Is it safe to do things this way or are there other 'gotchas' I should be aware of, when manipulating the position of a Widget's element in the page? Thanks again for all your help! On Jun 11, 10:48 am, gscholt gsch...@gmail.com wrote: Hi, Widgets are added to widgets, elements are added to elements. If you want to put a widget into the dom, I'd use a RootPanel, since it will take care of the unloading that is needed: p = RootPanel.get(currentElement.getId()); p.add(someWidget); if currentElement doesn't have an Id, you could use currentElement.setId(DOM.createUniqueId()); to set one. Note that these are Elements, not Nodes; not every node is an element, and not every node is allowed to have children (which is probably why the appendChild fails, but without more information then an exception it is hard to be sure). Gert On Jun 10, 11:51 pm, peterk peter.ke...@gmail.com wrote: Hey Jason, Thanks for your reply! I'm afraid I'm still running into problems here. First, even just trying to insert an element. I have this code: SpanElement test_element = Document.get().createSpanElement(); test_element.setInnerText(Hello there); currentNode.appendChild(test_element); currentNode is of type Node. This compiles OK, but at run time I get an exception on the appendChild call. How can I add or append an element to a node like this? Secondly..I can't seem to find any wrap method in the Widget class? Any further insight would be greatly appreciated..thanks so much! On Jun 10, 8:41 pm, Jason Essington jason.essing...@gmail.com wrote: Probably the safest thing to do would be to insert an element, then use the widget's .wrap() method to promote that element to a widget. there are other ways, but they are prone to leaking memory. -jason On Jun 10, 2009, at 1:36 PM, peterk wrote: Hey all, I'm walking the DOM tree and would like to append a Widget to certain nodes where certain conditions are met, but I'm not having much success. appendChild expects a Node as its parameter, so I can't just append a type of Widget. It will accept Widget.getElement() as a parameter, but this leads to runtime errors. Is it possible to mix Widgets with the DOM like this or is the only way to add Widgets to a page via the RootPanel.get() ..? If so is there a way to add Widgets to the page based on a desired position in the DOM? I'd like to use a custom widget I've made, having everything wrapped neatly in a class, and not have to revert to lower level stuff.. Thanks for any help :)- Hide quoted text - - Show quoted text - --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Possible to insert a widget into the DOM?
Hey all, I'm walking the DOM tree and would like to append a Widget to certain nodes where certain conditions are met, but I'm not having much success. appendChild expects a Node as its parameter, so I can't just append a type of Widget. It will accept Widget.getElement() as a parameter, but this leads to runtime errors. Is it possible to mix Widgets with the DOM like this or is the only way to add Widgets to a page via the RootPanel.get() ..? If so is there a way to add Widgets to the page based on a desired position in the DOM? I'd like to use a custom widget I've made, having everything wrapped neatly in a class, and not have to revert to lower level stuff.. Thanks for any help :) --~--~-~--~~~---~--~~ 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: Possible to insert a widget into the DOM?
Hey Jason, Thanks for your reply! I'm afraid I'm still running into problems here. First, even just trying to insert an element. I have this code: SpanElement test_element = Document.get().createSpanElement(); test_element.setInnerText(Hello there); currentNode.appendChild(test_element); currentNode is of type Node. This compiles OK, but at run time I get an exception on the appendChild call. How can I add or append an element to a node like this? Secondly..I can't seem to find any wrap method in the Widget class? Any further insight would be greatly appreciated..thanks so much! On Jun 10, 8:41 pm, Jason Essington jason.essing...@gmail.com wrote: Probably the safest thing to do would be to insert an element, then use the widget's .wrap() method to promote that element to a widget. there are other ways, but they are prone to leaking memory. -jason On Jun 10, 2009, at 1:36 PM, peterk wrote: Hey all, I'm walking the DOM tree and would like to append a Widget to certain nodes where certain conditions are met, but I'm not having much success. appendChild expects a Node as its parameter, so I can't just append a type of Widget. It will accept Widget.getElement() as a parameter, but this leads to runtime errors. Is it possible to mix Widgets with the DOM like this or is the only way to add Widgets to a page via the RootPanel.get() ..? If so is there a way to add Widgets to the page based on a desired position in the DOM? I'd like to use a custom widget I've made, having everything wrapped neatly in a class, and not have to revert to lower level stuff.. Thanks for any help :) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Will GWT meet my needs?
Hi there, I'd appreciate any advice on this. I currently have a javascript application that serves as the base of extensions for various browsers, for a service I run. Basically the extensions pull this javascript into whatever webpage the user loads, and the javascript does some stuff with the webpage, and so on, making calls to a server (hosted on AppEngine :)), sending it data and retrieving json (getting around Javascript's same origin policy to do this. The Javascript may be embedded into, say, cnn.com and making calls to my appengine hosted backend). I'm wondering..could I replace my Javascript with a GWT-compiled Javascript file in this scenario? I'm not sure if the nature of GWT deployment would preclude me from embedding a GWT JS file in arbitrary webpages..? I'm sort of tempted by the idea of having 'google optimised' javascript code for my app, and benefiting from GWT's other features and community, but I'm not sure if this is really feasible.. Can anyone say if my scenario is suitable for GWT or not? Thanks in advance! --~--~-~--~~~---~--~~ 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: Will GWT meet my needs?
Hey Ian. Thanks for your reply :) I don't absolutely need the widget stuff, no.. FWIW, I just tried out a very naive first attempt with a simple gwt app that just adds a button to the end of the page. I compiled it for cross-site access (add-linker name=xs / in the .gwt.xml file), and embedding it in a test page on my computer, it seemed to work. But now, getting a firefox extension to add it to the page on a page load..the page just spins forever on a blank page. It'll momentarily load the right page, then 'redirect', almost, and show a blank page that's perpetually loading.. Not sure if there's a quick and easy answer to that one! Maybe I've missed another thing you have to do for embedding a gwt app into a page not hosted on the same domain. On May 27, 9:17 pm, Ian Petersen ispet...@gmail.com wrote: I think it depends on what you're doing when you modify the page. As of GWT 1.5 (the last version I've used personally), it's difficult to construct a Widget around an existing DOM element. On the other hand, if you don't need GWT's Widget API, then GWT is exactly what you need. Some people are confused by GWT's offering, but it's really important to remember that it's a very modular tool. The only thing you need to have in order to say you're using GWT is the GWT compiler. The download also includes various modules for doing things in a web page, though, that make your life easier. At the very bottom is the DOM API that mirrors the browser's DOM API into Java. There's also a module for doing AJAXy stuff, and an RPC-over-HTTP module that's built on top of that. If it suits you, you can use the Widget API, but it's not necessary. Ian --~--~-~--~~~---~--~~ 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: Will GWT meet my needs?
Hey Ian, Thanks very much for your reply. I don't absolutely need the widget-y stuff, no.. I gave this a quick bash to see if I could get something working quickly. I have a simple GWT app that should add a button to the end of the page it loads in. It works OK in a test page on my machine, loading the .js file from a remote server (I have compiled it for cross site access). However when I get a firefox extension to embed the script in a page on page load, it seems to lock up the page.. it'll load the right page initially, but then it 'redirects', almost, to a blank page and loads i perpetually. Not sure if there's a quick and easy answer to that question, maybe there's more configuration that needs doing in order to allow a gwt app to be dynamically added to an arbitrary page (?) On May 27, 9:17 pm, Ian Petersen ispet...@gmail.com wrote: I think it depends on what you're doing when you modify the page. As of GWT 1.5 (the last version I've used personally), it's difficult to construct a Widget around an existing DOM element. On the other hand, if you don't need GWT's Widget API, then GWT is exactly what you need. Some people are confused by GWT's offering, but it's really important to remember that it's a very modular tool. The only thing you need to have in order to say you're using GWT is the GWT compiler. The download also includes various modules for doing things in a web page, though, that make your life easier. At the very bottom is the DOM API that mirrors the browser's DOM API into Java. There's also a module for doing AJAXy stuff, and an RPC-over-HTTP module that's built on top of that. If it suits you, you can use the Widget API, but it's not necessary. Ian --~--~-~--~~~---~--~~ 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: Will GWT meet my needs?
Oops! Sorry for the double reply. I thought the first one hadn't gone through. I think I've found what the problem is with what I was doing..it seems GWT isn't designed to be added dynamically to a page after the fact. A blog post here alludes to the problem: http://www.pathf.com/blogs/2007/08/bjax-a-quick-ha/ The fix there worked with GWT 1.4, but I've hacked through my own nocache.hs to make similar changes, and now it appears to be loaded properly to my pages 'after the fact', after onLoad's already fired etc. I do wonder if this is 'safe' though? Does GWT make other assumptions that would make it dangerous to dynamically add it to a page after the initial page load, or am I OK? Cheers, On May 27, 9:39 pm, peterk peter.ke...@gmail.com wrote: Hey Ian, Thanks very much for your reply. I don't absolutely need the widget-y stuff, no.. I gave this a quick bash to see if I could get something working quickly. I have a simple GWT app that should add a button to the end of the page it loads in. It works OK in a test page on my machine, loading the .js file from a remote server (I have compiled it for cross site access). However when I get a firefox extension to embed the script in a page on page load, it seems to lock up the page.. it'll load the right page initially, but then it 'redirects', almost, to a blank page and loads i perpetually. Not sure if there's a quick and easy answer to that question, maybe there's more configuration that needs doing in order to allow a gwt app to be dynamically added to an arbitrary page (?) On May 27, 9:17 pm, Ian Petersen ispet...@gmail.com wrote: I think it depends on what you're doing when you modify the page. As of GWT 1.5 (the last version I've used personally), it's difficult to construct a Widget around an existing DOM element. On the other hand, if you don't need GWT's Widget API, then GWT is exactly what you need. Some people are confused by GWT's offering, but it's really important to remember that it's a very modular tool. The only thing you need to have in order to say you're using GWT is the GWT compiler. The download also includes various modules for doing things in a web page, though, that make your life easier. At the very bottom is the DOM API that mirrors the browser's DOM API into Java. There's also a module for doing AJAXy stuff, and an RPC-over-HTTP module that's built on top of that. If it suits you, you can use the Widget API, but it's not necessary. Ian --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Strange problem - adding a GWT JS file to a page after page has loaded in a browser extension
Hey all, I'm experimenting with developing firefox extensions, and along the way I ran into a weird issue when trying to insert a gwt javascript file into a page loaded by the browser. That is, after the page has loaded, I want to add: script type=text/javascript language=javascript src=path/to/my/ gwt/js/file/script And I do this to the page in the firefox extension using its DOM. The GWT file is on another domain, but it's been compiled for cross- site compatability. It works fine when embedded in other pages on other domains in 'the normal way'. Other javascript and javascript files (non GWT JS files) embed fine via my firefox extension using this method. But when I try to embed my GWT JS, the page just seems to perpetually load.. I took a look at the generated source, and it looks like this: script!-- window.__gwtStatsEvent window.__gwtStatsEvent ({moduleName:com.optime.MyApplication, subSystem:startup,evtGroup: loadExternalRefs, millis:(new Date()).getTime(),type: end});window.__gwtStatsEvent window.__gwtStatsEvent ({moduleName:com.optime.MyApplication, subSystem:startup,evtGroup: moduleStartup, millis:(new Date()).getTime(),type: moduleRequested});document.write(script src=\http://www.google.ie/ 8BDF4B7FBE694A7FEF2081ED89CCB5BB.cache.js\/scr + ipt); --/scriptscript src=http://www.google.ie/ 8BDF4B7FBE694A7FEF2081ED89CCB5BB.cache.js/script The page I was looking at here was google.ie, with the extension trying to add my GWT file to the DOM. The first obvious problem I can see is that it seems to be looking for other associated GWT files directly on the google.ie domain rather than where they actually are on my own server. This might be a really silly problem or oversight on my part..but is this expected behaviour? Anyone have any ideas how to fix this? Thanks in advance for any insight! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---