gwt - Load HTML document to populate HTMLPanel a good idea? -


i want load "pieces" of html set htmlpanels dynamically modified getting id's follows:

htmlpanel dyncontent = new htmlpanel("<div id=\"test_id\"/>"); dyncontent.add(new label("this content dynamically generated."), "test_id"); 

can serve html files client gwt app (it cool load html files served @ application startup)? or have create call server html (say rpc)? sounds jsp solution rather stay away such simple app.

any suggestions welcome!

the answer pretty neat! first found this: best way externalize html in gwt apps?

then tried load static data via client bundle:

public interface resources extends clientbundle {     resources instance = gwt.create(resources.class);      @source("public/html/timesheet.html")     textresource synchronous();  } 

then load resources in html panel:

 htmlpanel dyncontent = new htmlpanel(resources.instance.synchronous().gettext());  dyncontent.add(new label("this content dynamically generated."), "dyncontent");   simplepanel.add(dyncontent);  

the content html file have fetched , populates htmlpanel wanted.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -