如何传递相同页面<选择>值到同一页<f: param>

how to pass Same page <select> value to Same page <f:param>?

本文关键字:lt gt 一页 param 选择 何传递      更新时间:2023-09-26

我有以下代码:

<p:datatable>
    <p:rowExpansion>
        <table id="paymentProcess">
            <tr>
                <td>
                    <label> <h:outputText value="Type: *" /> </label>
                    <p:column headerText="Process Payment" style="width:10%">
                        <select id="type" onchange="change(this.value)"
                            name="type" style="width: 70px;height: 20px;font-size: small">   *********
                            <option id="check">Check</option>*****
                            <option id="cash">Cash</option>*****
                        </select>****
                    </p:column>
                </td>
                <td>
                    <label> <h:outputText value="Check/DD Number: *" /> </label>
                        <input id="chkNo" maxlength="7"
                            style="font-size: small; width: 100px;height: 20px"/>
                </td>
            <tr>
                <td>
                    <label> <h:outputText value="Total: *" /> </label>
                    <input id="total" style="font-size: small; width: 100px;height: 20px"/>
                </td>
                <td></td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <h:commandLink value="Pay Now"
                        actionListener="#{adminActionController.processPayment}">
                        <f:param name="productId" value="#{due.productId}" />
                        <f:param name="intimationid" value="#{due.id}" />
                        <f:param name="regiNo" value="#{due.regiNo}" />
                        <f:param name="uuid"
                            value="#{adminActionController.userBean.id}" />
                        <f:param name="checkNo" value=""/> *******
                    </h:commandLink>
                </td>
            </tr>
        </table>
    </p:rowExpansion>
</p:dataTable>

我想把选择id="type"传递给f:param name="checkNo" value="?"我该怎么做?当我点击commandLink时,它会转到一个backingbean中的actionListener方法。当我点击命令链接时,有没有其他方法可以将它传递给backingbean?

由于您使用的是JSF,因此可以使用h:selectOneMenu而不是基本的HTML <select>标记。作为替代方案,您可以使用PrimeFaces的p:selectOneMenu,它也具有蒙皮功能。

有关此菜单的示例,请参见PrimeFaces的展示。

有关如何将附加参数传递给backingbean的四个示例,请单击此处。