Wednesday, June 19, 2013

Re: Reference on gwt.xml



On Tuesday, June 18, 2013 10:40:10 PM UTC+2, XU BIAO Lei wrote:
I have an app with the following gwt.xml 

<?xml version="1.0" encoding="UTF-8"?>
<!--
  When updating your version of GWT, you should also update this DTD reference,
  so that your app can take advantage of the latest GWT module capabilities.
-->
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN"
<module rename-to='stockwatcher'>
  <!-- Inherit the core Web Toolkit stuff.                        -->
  <inherits name='com.google.gwt.user.User'/>

  <!-- Inherit the default GWT style sheet.  You can change       -->
  <!-- the theme of your GWT application by uncommenting          -->
  <!-- any one of the following lines.                            -->
  <inherits name='com.google.gwt.user.theme.clean.Clean'/>
  <!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
  <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
  <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>     -->

  <!-- Other module inherits                                      -->
  <inherits name="com.google.gwt.http.HTTP" />

  <!-- Specify the app entry point class.                         -->
  <entry-point class='com.google.gwt.sample.stockwatcher.client.StockWatcher'/>
  
  <!-- Specify the paths for translatable code                    -->
  <source path='client'/>
  <source path='shared'/>

</module>

you can see that I have a reference to a css file in the gwt.xml. From what I observe, that style will get put into the nocache.js and load it when my application start.
Right now, I don't want the reference to be the gwt.xml, Because URL of the CSS file is change dynamicly. I am wondering is it posible that I can inject this CSS during
run time and also the nocache.js?

If the URL of the stylesheet can change dynamically and (more importantly) independently of the GWT application, you have two solutions:
  • load it independently from the GWT app (add a <link rel="stylesheet" href="..."> to the HTML host page)
  • load it from the GWT app's EntryPoint, getting the URL by other means (extracted from the HTML host page –as a JS global variable, or some attribute value on an element–, or GWT-RPC, or whatever) and dynamically creating the <link> element from code (com.google.gwt.dom.client.Document.get().createLinkElement(), etc.)

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate