Re: does not execute action listener

Splash Forums PrettyFaces Users does not execute action listener Re: does not execute action listener

#23252

jllado
Participant

It makes sense!

I have this command link that should assign forumBacking.forumName property with needed forum’s name

<h:commandLink action="pretty: forumInnerLink" styleClass="forumNameLink" value="#{forum.name}">
<f:setPropertyActionListener target="#{forumBacking.forumName}" value="#{forum.name}" />
</h:commandLink>

When I click this link I have correct forum name assigned to forumBacking.forumName . But I want to move to next page clicking this link without passing any parameters. I have mapping in pretty-config

<url-mapping parentId="forums" id="forumInnerLink">
<pattern value="/" />
<view-id value="/forum.xhtml" />
</url-mapping>

This mapping is bad because it matches parent_mapping(forums) + “/”. It means that user types in browser bar what matches and receives nothing because forumBacking.forumName is null .

I dont’ want to pass forum.name as a parameter because moderator on javaranch told me:

<qoute>Passing parameters on the View is something that should be avoided. So is using an object locator.

In JSF, the preferred way to pass objects around is to keep them in Managed Beans and inject them as Managed Properties into the beans that use them. It makes for less network traffic (objects don’t have to be serialized out and back), more security (nothing exposed to the client side where it can be hacked), and simpler coding. </qoute>