I typically do this by using t:updateActionListener instead of setting
a request parameter with f:param.  This assumes that there is some
backing bean upon which you want the value stored, perhaps searchBean
in your current case.

Possibly the only issue with your example below is that it should be

<f:param name="currentPage" value="#{index}"/>

and not page.index, but it's hard to say from the snippet you've posted.



On 2/8/07, Todd Nine <[EMAIL PROTECTED]> wrote:
I'm trying to iterate over a list and create command links for each element.
 I have the following code

<h:form>
                            <t:dataList var="page"
                                               value="#{
searchBean.searchPages}"
                                               layout="Constant"
                                               rowCountVar="row"
                                               rowIndexVar="index">
                                               <h:commandLink
action="#{searchBean.changePage}" >
                                                   <f:param
name="currentPage" value="#{ page.index}"/>
                                                   <h:outputText
value="#{page.displayNumber}"></h:outputText>
                                               </h:commandLink>
                                </t:dataList>
                        </h:form>

I would like the bean value "currentPage" to be set before the action
"changePage" is called.  However when changePage is invoked, the currentPage
variable is not set. What do I need to do so set this value?

Thanks in advance,
Todd

Reply via email to