I've been meaning to file this issue for a while. I always seem to remember when I am on stage giving a presentation, but not when at my computer :(<br><br>The <view-param> element that was introduced as a child of the <redirect><br>
element was supposed to be called <redirect-param>. Unfortunately, something got<br>lost in translation and the terminology for "view parameters" got mixed up with<br>redirect parameters. (I take the blame for not following up with a review of this<br>
topic in the spec document prior to final release).<br><br>I'll explain the difference. A view parameter is a mapping between a request<br>parameter and a bean property and is associated with a particular view ID. If<br>
you are linking or redirecting to that view ID, you can have those mappings run<br>in reverse to build a query string. This is activated with the "include view<br>parameters" switch on the link (UIOutcomeTarget) component or <redirect> element.<br>
<br>A redirect parameter in the navigation is equivalent to an <f:param> on a button<br>or link. It is a manual setting, which may (or may not) override the value of a<br>view parameter. A perfect example is when you want to create a link to the<br>
previous page of a paginated list. You manually override "page" so that it is<br>one less than the current page. <f:param name="page" value="#{nav.page - 1}"/><br><br><view-param> has no business being a child of <redirect> and should be renamed<br>
to <redirect-param>.<br><br><navigation-case><br> <from-action>#{editor.save}</from-action><br> <from-outcome>success</from-outcome><br> <to-view-id>/entry.xhtml</to-view-id><br>
<redirect><br> <redirect-param><br> <name>id</name><br> <value>#{<a href="http://entry.id">entry.id</a>}</value><br> </redirect-param><br> </redirect><br>
</navigation-case><br><br>If you wanted to let view parameters manage the value of the "id" request parameter, it would be:<br><br><navigation-case><br>
<from-action>#{editor.save}</from-action><br>
<from-outcome>success</from-outcome><br>
<to-view-id>/entry.xhtml</to-view-id><br>
<redirect include-view-params="true"/><br>
</navigation-case><br><br>/entry.xhtml<br><f:view><br> <f:metadata><br> <f:viewParam name="id" value="#{<a href="http://entry.id">entry.id</a>}"/><br> </f:metadata><br>
...<br></f:view><br><br>See the difference?<br><br>-Dan<br clear="all"><br>-- <br>Dan Allen<br>Senior Software Engineer, Red Hat | Author of Seam in Action<br>Registered Linux User #231597<br><br><a href="http://mojavelinux.com">http://mojavelinux.com</a><br>
<a href="http://mojavelinux.com/seaminaction">http://mojavelinux.com/seaminaction</a><br><a href="http://www.google.com/profiles/dan.j.allen">http://www.google.com/profiles/dan.j.allen</a><br>