Navigation path question

UI Components for JSF
Post Reply
fiktion
Posts: 100
Joined: 25 Aug 2010, 17:47

25 Aug 2010, 17:54

I am using Primefaces with JSF 2.0. I am using the layout component and have three layoutUnits, left, center, and right. On the left layoutUnit are a bunch of tools within a primefaces menu component that call a method on the actionListener which will update a private variable in my backing bean depending on which tool you click. It also has an update tag on each of the menuitem's which will update an id.

In my center layoutUnit I have a main <h:panelGroup> with many nested <h:panelGroup> beneath. Each sub panelGroup is essentially a tool view. I am using the rendered attribute on each sub panelGroup and when the value = that of the clicked tool it will be visible.

This is the only way I could think of doing something like this? Is this the correct approach? It is not working 100% the first view is rendered when the page loads but whenever I click a tool it will not update the main <h:panelGroup> and dislpay the new sub panelGroup.

fiktion
Posts: 100
Joined: 25 Aug 2010, 17:47

25 Aug 2010, 19:13

Let me refine my question because I know that is hard to make sense of. I have a panelLayout component with three positions, left, center, and right. I want to have the left panel to be a navigation which will change the view of the centerpanel. I feel as though I have everything working but there is an issue with the "update" attribute.

All of my menu items in my left layoutUnit panel look something like this

<p:menuitem value="search" id="menuSearch" actionListener="#{myBean.requestionMenuOptionListener}" update="centerContent"/>

then in my center layoutUnit it looks like this

<p:layoutUnit id=centerContent" position="center">
<h:panelGroup rendered="#{myBean.requestMenuOption eq 'menuSearch'}">
....
</h:panelGroup>
</p:layoutUnit>

What the backing bean does is set a global variable in myBean to whatever the menuItem ID is, in this case it would be menuSearch. It will then call update on the center layoutUnit and the idea is to show the panelGroup which ID matches.

This however is not working and I feel it might be because the "update" attribute within the left layoutUnit is outside of the layoutUnit that is it is trying to update so the path is not correct. Any help on this would be greatly appreciated. Thanks

fiktion
Posts: 100
Joined: 25 Aug 2010, 17:47

25 Aug 2010, 19:53

If this makes absolute no sense can someone show me a proper way to create a menu panel using the layout primeface component that will dislpay different content in the center layoutUnit panel when a menuItem is clicked in the left layoutUnit panel? That is all I am trying to do and I can not find any examples anywhere. Thanks.

callahan
Posts: 768
Joined: 27 May 2010, 22:52

25 Aug 2010, 20:10

Hi,

The component id specified in the update attribute may be incorrect. Does update=":centerContent" work? The correct id to specify will depend on your <h:form> tags.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

25 Aug 2010, 23:57

You can also use iframes for center layout and embed other pages, just an alternative.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 36 guests