Setting property in backing bean while navigating from one page to another

Splash Forums PrettyFaces Users Setting property in backing bean while navigating from one page to another

This topic contains 3 replies, has 2 voices, and was last updated by  mika 10 years, 2 months ago.

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

    mika
    Participant

    hi the case is as follows:

    i have a backing bean Authority which it’s scope is view

    and i have two pages to viewRoles and another page to editRole, mapped to this backing bean

    in the viewRoles page there’s a link to go to editRole page

    `<h:form>

    <h:commandLink value=”#{au.displayName}” action=”pretty:editRole”>

    <f:setPropertyActionListener target=”#{authority.authorityId}” value=”#{au.id}”/>

    </h:commandLink>

    </h:form>`

    but the issue is that it navigates to the other page and the property is not getting set

    although the scope is view and both pages are mapped to same backing bean.

    above case only works fine if i changed the view to session.

    NOTES: my beans are managed by spring, also this view scope is not defautlt in spring it’s custom one i found http://cagataycivici.wordpress.com/2010/02/17/port-jsf-2-0s-viewscope-to-spring-3-0/

    also i am using prettyFaces to manage my navigation.

    so question is, is above scenario supposed to work in JSF 2 managed bean with scope view, and problem is related to spring, or it won’t work either, and it’s another problem ?

    please advise.

    #21606

    If you click such a link you will send the user to a completely new page. So it is expected that you lose the view scope because the view scope is only valid for ONE view.

    #21608

    You should really include the parameter you want to transfer to the target bean as a path or query parameter in the URL. That’s the idea of PrettyFaces! :)

    #21609

    mika
    Participant

    got it, thanks.

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

The forum ‘PrettyFaces Users’ is closed to new topics and replies.

Comments are closed.