As I get some problem with integrating Html code from designer work in Gxt, I decided to run very simple test and start by using the Gwt HtmlPanel, and I can't explain why the javascript included is not rendered.
public class TestHTML implements EntryPoint {
public void onModuleLoad() {
String contenu = "<html>"
+"<head>"
+" <script type='text/javascript'>"
+"function functionOne() { alert('You clicked the top text'); }"
+"function functionTwo() { alert('You clicked the bottom text'); }"
+"</script>"
+"</head>"
+"<body>"
+"<p><a href='#' onClick='functionOne();'>Top Text</a></p>"
+"<p><a href='javascript:functionTwo();'>Bottom Text</a></p>"
+"</body>"
+"</html>";
HTMLPanel htmlPanel = new HTMLPanel(contenu);
ContentPanel content = new ContentPanel();
content.add(htmlPanel);
RootPanel.get().add(content);
}
}
I can't find out the javascript function in the browser (I looked with firebug) Is there somebody with an answer or advise ? Regards