-
1. Re: s:link includePageParams problem
alniks Oct 9, 2010 11:09 AM (in response to alniks)The simple search form:
<ice:inputText value="#{advancedSearch.searchCriteria.keyword}" styleClass="searchInput" size="70"/> <ice:commandButton id="search" value="#{messages['label.search']}" action="simpleSearch"> </ice:commandButton>
Page navigation rules:
<page view-id="*"> <navigation> <rule if-outcome="home"> <redirect view-id="/home.xhtml"/> </rule> <rule if-outcome="search"> <end-conversation /> <redirect view-id="/searchresult.xhtml" /> </rule> <rule if-outcome="simpleSearch"> <end-conversation /> <redirect view-id="/simplesearchresult.xhtml"/> </rule> </navigation> </page>
Page parameters from /searchresult.xhtml:
<begin-conversation join="true" flush-mode="MANUAL"/> <action execute="#{advancedSearch.makeSearch}"/> <param name="title" value="#{advancedSearch.searchCriteria.title}"/> <param name="country" value="#{advancedSearch.searchCriteria.country}" /> <param name="q" value="#{advancedSearch.searchCriteria.keyword}" />
Page parameters from /simplesearchresult.xhtml:
<begin-conversation join="true" flush-mode="MANUAL"/> <action execute="#{advancedSearch.makeSimpleSearch}" /> <param name="q" value="#{advancedSearch.searchCriteria.keyword}" />
When I first make an advanced search using country field I land on /searchresult.xhtml with
country
parameter equal to provided in the form. Then from this page I make a simple search and land on the /simplesearchresult.xhtml with nocountry
parameter as expected. However, both pages include the following facet search link, which should narrow the search:<ui:repeat value="#{advancedSearch.getpTopicFacets()}" var="_facet"> <s:link view="/searchresult.xhtml" includePageParams="false"> <ice:outputText value="#{_facet.value} (#{_facet.hitCount})"/> <f:param name="refine" value="true" /> <f:param name="addTopic" value="#{_facet.value}" /> <f:param name="country" value="#{advancedSearch.searchCriteria.country}" /> </s:link> #{" "} </ui:repeat>
In either case the link include the
country
parameter set to the value provided from the advanced search form. Though I expect that after simple search thecountry
should resolve to null. I have tried to explicitly make the country null in the simple search action, but it didn't help. The tracing for the setter method for country also shows that the value is null:setting country, old value: null, new value: null
But the parameter in the s:link remains set to initially provided value. Can somebody help me with this issue. Thank you.
-
2. Re: s:link includePageParams problem
alniks Oct 10, 2010 9:51 AM (in response to alniks)The problem was solved by adding
before-redirect="true"
to
end-conversation
in page navigation rules