-
1. Re: How to use panelMenu
traysa Jan 2, 2009 10:08 AM (in response to zjda)hiya,
I'm in the same situation. The problem with the include is that I sometimes have several contents in my working area when I switch between the menu items. Can someone explain to me why this happen?
thx,
traysa -
2. Re: How to use panelMenu
nbelaevski Jan 3, 2009 9:50 AM (in response to zjda)ZJ,
In principle, you can put panel menu inside the same a4j:include and use JSF navigation.
Traysa,
Can you add some more information? -
3. Re: How to use panelMenu
zjda Jan 5, 2009 12:38 AM (in response to zjda)Hi Traysa,
Thank you for your suggestion. I understand that all my pages can include the header, footer, and panel menu using a4j:include and use JSF navigation rules. However, in this way, the whole page has to be updated when navigating to a different page. What I want is that only the working area will be updated (not the header, footer and panel menu). Is there any way to use JSF navigation rules to partially update a page? I saw that someone tried to use the target attribute of the menu item to update a area, but it did not work.
Regards,
-ZJ -
4. Re: How to use panelMenu
traysa Jan 5, 2009 3:48 AM (in response to zjda)hiya,
I've got the same requirements as zjda. So I build a fixed header, menu and working area. The working area contains the <a4j:include>.
Then I build a NavigationController (scope: application):public class NavigationController { //Url of the page to show private static String url; //Constructor public NavigationController(){ NavigationController.url = ""; } //Changes the url-adress for the include public static void navigateTo(String url) { NavigationController.url = url; } //Setter public void setUrl(String url) { NavigationController.url = url; } //Getter public String getUrl() { if ((url.equals(""))||(url == null))return ERROR_PAGE; else return url; } }
on the mainpage:<a4j:include viewId="#{navigationController.url}" layout="block" rendered="true"/>
So when I click a button in the menu, it changes the url in the NavigationController via function 'navigateTo' and rerenders the <a4j:include>.
It works almost fine. Just the ugly thing that I suddenly have several url-contents in the include.
I also look for a nicer solution...
regards,
traysa -
5. Re: How to use panelMenu
janson12 Jan 5, 2009 8:17 AM (in response to zjda)I'm facing a similar scenario. From what i've found the only reliable way for proper navigation is thru jsf navigation.
-
6. Re: How to use panelMenu
traysa Jan 6, 2009 3:10 AM (in response to zjda)do you have a solution with jsf navigation and a fixed header/footer/menu?
-
7. Re: How to use panelMenu
janson12 Jan 7, 2009 4:30 AM (in response to zjda)Not really. The only thing i can think of is to make/simulate a click from a hidden button situated in your working area. However you'd then have to put a button on every workin area which might be quite cumbersome.
i'd be grateful myself if someone could shed some light on this. -
8. Re: How to use panelMenu
danielk Jan 7, 2009 5:48 AM (in response to zjda)Why not using Facelets for templating? You can define a header, footer etc. than define a layout.xhtml where you insert header, footer ... and define the "main" frame. Make use of <ui:insert>. The only thing you have to do, is referencing this template in each site you create.
You can find more informations about Facelets here:
http://www.ibm.com/developerworks/java/library/j-facelets/ -
9. Re: How to use panelMenu
traysa Jan 9, 2009 9:28 AM (in response to zjda)hello DanielK, thanks for your reply.
I'm trying to use Facelets, but somehow I can't get the right configuration, so that I always get runtime errors, like: 'A4J' is not defined. The site is shown, but I can't use any rich components.
can somebody help me out?
thx,
traysa -
10. Re: How to use panelMenu
ilya_shaikovsky Jan 9, 2009 9:41 AM (in response to zjda)traysa, you could create sample for us.. and we will check it ;) as for me this will be faster solution.
-
11. Re: How to use panelMenu
traysa Jan 12, 2009 10:43 AM (in response to zjda)hello ilya_shaikovsky,
i tried to create a smaller sample. now i have the problem that i, when i navigate, always get the http status 404.
i don't know where to put up the sample...
thx,
traysa -
12. Re: How to use panelMenu
ilya_shaikovsky Jan 13, 2009 8:22 AM (in response to zjda)send me directly after complete. (email in profile)
-