navPageHeader wnels2  2008-01-31 13:48
Status: Closed
 
I think this is a quick question. Can you tell me how to set the title of the GWT page that I am loading? By default it is set to hostname:container (it's style is labeled navPageHeader). I think I need to set the <html><title> for the document as well.
If you could point me to some example code I would be grateful.
 
Thanks,
Bill
 
 
jeckels responded:  2008-02-01 10:12
Hi Bill,

The exact method depends on what kind of controller you're using, but in either case you'll need to modify the NavTree object. The last item added will be used as the title in the body of the page as well as the <html><title>.

If you're using a Spring controller (meaning your controller subclasses SpringActionController), which is the new and preferred way, your Action class should have an appendNavTrail() method which lets you add to the NavTree.

If you're using a Beehive controller (meaning your controller subclasses ViewController), you need to make sure that you're building a NavTrailConfig with the right NavTree. Check out org.labkey.core.admin.AdminController._renderInTemplate() for an example.

Additionally, you can call setTitle() on your GWTView object to set its own title. You might need call setFrame(FrameType.PORTAL) on it to make the title show up.

Thanks,
Josh
 
wnels2 responded:  2008-02-01 13:28
Hi Josh,
Thanks, that worked. I'm using spring.
Bill