Navigation Issue

Splash Forums PrettyFaces Users Navigation Issue

This topic contains 5 replies, has 3 voices, and was last updated by  Lincoln Baxter III 3 years, 2 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #17960

    hithendra
    Participant

    I am encountering a navigation issue after using pretty faces. There is an edit page where i have a link for Home with below code

    <a href="Home">Home</a>

    The edit page url is

    http://localhost:9999/PrettyFacesTest/Case_Definition_Edit/786547

    When i click the Home link on this page, the url changes to

    http://localhost:9999/PrettyFacesTest/Case_Definition_Edit/Home

    but the page never navigates to home page.

    I am using Glassfish with JSF 2.0

    pretty-config.xml

    <url-mapping id=”Home”>

    <pattern value=”/Home” />

    <view-id>/Home.xhtml</view-id>

    </url-mapping>

    <url-mapping id=”Edit_Case_Definition”>

    <pattern value=”/Case_Definition_Edit/#{caseDefinition.caseDefID }” />

    <view-id>/EditCD.xhtml</view-id>

    </url-mapping>

    Let me know if you have any ideas.

    #21049

    You are using a standard HTML link with an relative URL. You should either make your URL absolute using something like this:

    <a href="#{request.contextPath}/Home">Home</a>

    Or you could use the pretty:link component for this:

    <pretty:link mappingId="Home">Home</pretty:link>

    I hope this helps.. :)

    #21050

    hithendra
    Participant

    Thanks Chris.

    Does Pretty faces have a pretty button or something like pretty:link ?

    #21051

    No, there is no button component in PrettyFaces. But if you want a button you could do something like this:

    <h:commandButton action="pretty:home" .... />

    But clicking this button will create a postback to the old view followed by a redirect to the new page. So this will lead to two requests instead of only one.

    #21052

    The issue with buttons is that it takes manuscript to make them work unless you render a special form. Prettyfaces gives you a way to do hissing <pretty:urlbuffer var="url" mappingId="pretty:home">, which then stores the url into the #{requestScope.url}

    http://ocpsoft.com/docs/prettyfaces/3.2.1/en-US/html/components.html#components.urlbuffer

    ~Lincoln

    #21053

    Javascript

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

You must be logged in to reply to this topic.

Comments are closed.