Primefaces Breadcrumb and pretty:

Splash Forums PrettyFaces Users Primefaces Breadcrumb and pretty:

This topic contains 3 replies, has 3 voices, and was last updated by  Rurcebreessar 4 years, 9 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #18697

    Hey guys,

    Primefaces offers a breadcrumb menu, i’d like to use (http://www.primefaces.org/showcase/ui/breadCrumb.jsf):

    <p:breadCrumb>
    <p:menuitem value="Home" url="pretty:dashboard" />
    <p:menuitem value="UserManagement" url="pretty:userManagement" />
    <p:menuitem value="UserRoleManagement" url="#"></p:menuitem>
    </p:breadCrumb>

    but, the pretty: thingy is not working here. I assume, this is because “url” doesn’t generate a navigation outcome. But changing this to “action” wont work, because then menuitem expects to have a form surrounding it. and if i add a form, i cant add them do <p:breadCrumb>, because form cannot be casted to menuitem :)

    Any Chance, somebody uses p:breadcrumb with prettyFaces and has a solution for this?

    #22941

    You could use <pretty:urlbuffer> for this. It will create the pretty URL and make it accessible via an EL expression. Something like this:

    <p:breadCrumb>

    <pretty:urlbuffer var="url" mappingId="dashboard">
    <p:menuitem value="Home" url="#{url}" />

    <pretty:urlbuffer var="url" mappingId="userManagement">
    <p:menuitem value="UserManagement" url="#{url}" />

    ....

    </p:breadCrumb>

    Could you try this? It doesn’t look very nice, but I think it will work.

    #22942

    Isn’t there a different attribute that you can use on <p:menuItem> ? If “url” accepted a navigation outcome, then the pretty:id strings would work fine. Have you tried with normal navigation cases? I’m betting there is a different attribute like “target” or “outcome”.

    ~Lincoln

    #22943

    ah, you are so right – theres the attribute outcome, and it works like a charm.

    Musst have overseen that, when scrolling through the list yesterday.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Comments are closed.