Skip to main content

Ajax menu navigation like GlassFish admin?

1 reply [Last post]
hezjing
Offline
Joined: 2007-05-25
Points: 0

Hi
I was looking at GlassFish 3.1 admin page, and wondering how GlassFish implements the Ajax menu navigation. It looks like each menu item has a JSF page associated, e.g. Domain -> serverInstDomainAttrs.jsf, Applications -> applications.jsf. Clicking the menu item will only refresh the content area without changing the header and etc.
Can you provide some guidelines and example of how to do this?
Thank you!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
alexoulew
Offline
Joined: 2010-12-29
Points: 0

You can use dynamic include with tag ui:include.
If you have a backing bean as #{bean.includedPage}, you can change this when you click on menuItem maybe just a link with an f:ajax child an jajax just refresh include
<h:commandLink action="#{actionWichChangeIncludedPageValue}">
<f:ajax execute="@this" render="include" />
</hcommanalink>
<h:panelGroup id="include">
<ui:include src="#{bean.includedPage}" />
</h:panelGroup/>

I'm not sure this code is great but idea is there.