Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Loading html dynamically from file instead of having static page.

 
Tadas Davidsonas
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

Just wondering about GWT possibilities.

The problem is like this: I want to load html and css templates dynamically instead of having static html page.

What is the best way to do it?

I know that it is possible to load html to Rootpanel id but is it possible to load entire html page dynamically?

And after loading html I'll still need to add some buttons GWT classes.(sometimes GWT is ugly about doing this after loading plain html).

Thank you.
 
Maneesh Godbole
Saloon Keeper
Posts: 11092
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can always have a servlet/JSP serve you the HTML on the fly. Or did I misunderstand your question?
 
ahmed dohar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, It is very easy all the content of your static html put it in String variable then add this variable in HTML widget like this:


 
Federico Kereki
author
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For dynamic CSS work, you could give a look to CSS resource bundles.

As to loading HTML, you could get the code from the server by using RPC, but wouldn't that somehow beat the idea of client-side code?

Hope this helps!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic