views:

15

answers:

0

I am using smartgwt for our application. I have to define a template which our application uses. The template is complex enough that I have to use div or table base structure to build that template.

There are two main sections of website. (1) public view (2) logged in view.

The public view of website uses template and when user logs in; the template is removed and a smartgwt widget is loaded. Therefore the template will be used in public view only.

The problem is that when user logs in I remove the template by using (RootPanel.getBodyElement().removeChild(RootPanel.get("main").getElement());) and when user logs out; I want to restore the template using (RootPanel.getBodyElement().appendChild(RootPanel.get("main").getElement());); but I get null pointer exception (because that “RootPanel.getBodyElement().removeChild(RootPanel.get("main").getElement());” deletes the child node in side body tag therefore I cannot get the template again).

I want to confirm that is there any way to use this html templates with smart gwt when I have to show/hide the template. Or is there any other way using smartgwt native layouts.

Kindly guide me in this regard.

Cheers!

Raza