I have this DIV on my application jsp page which I need to “inject” in to a GWT VerticalPanel. Coded on top of the iframe tag which contains “__gwt_historyFrame” :
index.jsp
<div class="footer" id="footer" style="display:none">
<p>Copyright © 2012 MyCompany. All Rights Reserved.</p>
<a href="#">FAQ</a>
<a href="#">Privacy</a>
<a href="#">API</a>
<a href="#">Contact Us</a>
</div>
I am inserting the DIV to the view with this code:
DivElement footer = (DivElement) document.getElementById("footer");
verticalPanel.getElement().appendChild(footer);
However it does not show up, although the getElementById does not return null
What is the correct way to do this?
There are 2 things:
display: noneof thefooter:footer.getStyle().clearDisplay()VerticalPanelis an HTML table, and adding adivto atableis likely to not work.If I were you, I’d rather use
HTML.wrap(footer)orHTMLPanel.wrap(footer)and add that widget to theVerticalPanel, as a widget.