Update selected menu from bean ?

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
bar2
Posts: 4
Joined: 25 Jan 2021, 11:24

23 Feb 2021, 20:41

Hi,

Is it possible to update the selected menu of the pu:menu in ultima theme directly from a bean method ?

Regards,
Julien

User avatar
jfgomez
Posts: 24
Joined: 14 Jun 2016, 06:15

23 Feb 2021, 22:31

Hello @bar2

Yes, you can. You could change your menumodel. Show us your code to help you
Juan Fernando Gomez M.
jfgomez@conasinf.com

bar2
Posts: 4
Joined: 25 Jan 2021, 11:24

24 Feb 2021, 10:42

Hi,

Thank you.
I use the integrated menu of the ultima template version 2.1.1.
So I didn't create any menuModel manually. As written on the doc https://www.primefaces.org/ultima/docs.xhtml, I copy the jar and I simply use the existing menu in the xhtml

Exemple :

Code: Select all

<pu:menu widgetVar="me">
                        <p:menuitem id="um_dashboard" value="Dashboard" icon="&#xE871;" outcome="/dashboard"/>
                        <p:submenu id="um_components" label="Components" icon="&#xE896;">
                            <p:menuitem id="um_sample" value="Sample Page" icon="&#xE30B;" outcome="/sample" />
                            <p:menuitem id="um_forms" value="Forms" icon="&#xE890;" outcome="/forms" />
                            <p:menuitem id="um_data" value="Data" icon="&#xE3EC;" outcome="/data" />
                            <p:menuitem id="um_panels" value="Panels" icon="&#xE14F;" outcome="/panel" />
                            <p:menuitem id="um_overlays" value="Overlays" icon="&#xE14D;" outcome="/overlay" />
                            <p:menuitem id="um_menus" value="Menus" icon="&#xE5D2;" outcome="/menu" />
                            <p:menuitem id="um_messages" value="Messages" icon="&#xE0C9;" outcome="/messages" />
                            <p:menuitem id="um_charts" value="Charts" icon="&#xE24B;" outcome="/charts" />
                            <p:menuitem id="um_file" value="File" icon="&#xE226;" outcome="/file" />
                            <p:menuitem id="um_misc" value="Misc" icon="&#xE332;" outcome="/misc" />
                        </p:submenu>
</pu:menu>
Let's say I have a MenuBean, is it possible to add a changeMenu function that can be called by any action on any page using the id of the menuitem (um_forms for example) as a parameter to make this menuitem selected ? Based on your previous answer, I suppose I have to check how MenuModel works first.

siris
Posts: 322
Joined: 29 Jul 2019, 13:57

04 May 2021, 15:52

Hi,

Sorry for the delay, we thought the matter was closed. Could you give more detailed information? What do you want to do? If we find a feasible idea, even if it's not the way you mentioned, we can add it to the ultima.

Best Regards,

Post Reply

Return to “Ultima - PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests