Navigation Issue – 2

Splash Forums PrettyFaces Users Navigation Issue – 2

This topic contains 2 replies, has 2 voices, and was last updated by  hithendra 6 years, 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #17961

    hithendra
    Participant

    This is other navigation issue i faced.

    In Home page user enters an id to edit and clicks the edit button. after validating the page(whether id is empty) application will navigate to edit page. My issue is that the page is navigated to edit page but the URL still remains the same. am i missing something ?

    Home page URL – `http://localhost:9999/PrettyFacesTest/Home’

    I have the below navigation rule in my faces-config.xml

    <navigation-rule>

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

    <navigation-case>

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

    </navigation-case>

    </navigation-rule>

    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>

    Also, is there any way that i can mention the url that needs to be navigated to is

    http://localhost:9999/PrettyFacesTest/editCD/3485 3485 being the id read from home screen.

    #21054

    It seems like your don’t use PrettyFaces navigation in your action method at all.

    If you want the URL to change after your action method has been executed, you should return pretty:myMappingId from the action method. In this case you can even remove the navigation rule from your faces-config.xml. This will make things much easier.

    See this section of the documentation for details:

    http://ocpsoft.com/docs/prettyfaces/3.2.0/en-US/html/navigation.html#navigation.actions

    #21055

    hithendra
    Participant

    Thank you Chris…

    It worked like a charm. Good thing is i don’t have to define navigation rules in faces-config.xml.

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

You must be logged in to reply to this topic.

Comments are closed.