Dynamic po:menu

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
itelecom
Posts: 10
Joined: 14 Nov 2016, 19:23

18 Nov 2016, 22:16

Hello,
how can i load po:menu dynamically with several levels, from a list in a bean?

In my current project i use a p:tree, now i want to improve the layout with Omega but i don't know how to update this code:

Code: Select all

<p:tree id="placesTree" value="#{measurementBean.placesRoot}"
					var="node" selectionMode="single"
					selection="#{measurementBean.selectedNode}" dynamic="true"
					animate="true" cache="true" widgetVar="placesTree"
					style="margin-top: 42px; width: 200px; height: 515px;">

					<p:ajax event="select"
						listener="#{measurementBean.onPlaceTreeNodeSelect}"
						onstart="PF('bui').block()" oncomplete="PF('bui').unblock()" 
						update=":measurementsForm:infoTabs:initMeasurementsCharts, 
						:measurementsForm:infoTabs:lastMeasurementsPhaseContainer, 
						:measurementsForm:infoTabs:dailyPhaseContainer, 
						:measurementsForm:infoTabs:weeklyPhaseContainer, 
						:measurementsForm:infoTabs:monthlyPhaseContainer"/>
					<p:ajax event="expand"
						listener="#{measurementBean.onPlaceTreeNodeExpand}" />

					<p:treeNode type="#{MeasurementBean.PLACE_NODE}"
						icon="ui-icon-home">
						<h:outputText value="#{node.name}" />
					</p:treeNode>

					<p:treeNode type="#{MeasurementBean.METER_DEVICE_NODE}"
						icon="ui-icon-meter">
						<h:outputText value="#{node.name}" />
					</p:treeNode>
				</p:tree>
thank you

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

21 Nov 2016, 09:07

I think this link can help to you for dynamic po:menu; http://www.primefaces.org/showcase/ui/menu/menu.xhtml (Please see Programmatic Menu section)

itelecom
Posts: 10
Joined: 14 Nov 2016, 19:23

22 Nov 2016, 16:36

Thank you i will try it

mert.sincan
Posts: 5281
Joined: 29 Jun 2013, 12:38

23 Nov 2016, 08:09

You're welcome!

Post Reply

Return to “Omega - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests