Jsf 如何在p:commandButton中存储值?

Jsf 如何在p:commandButton中存储值?,jsf,variables,primefaces,javabeans,commandbutton,Jsf,Variables,Primefaces,Javabeans,Commandbutton,我想将p:commandButton上显示的值存储在支持bean中的变量中。这是我的命令按钮 <p:commandButton value="#{rec.UTILITY_BILL_UPLOAD}" actionListener="#{pavReqAssign.DownloadFile}" onclick="PrimeFaces.monitorDownload(start, stop);" icon="ui-icon-arrowthick-1-s" > <p:fileDownlo

我想将p:commandButton上显示的值存储在支持bean中的变量中。这是我的命令按钮

<p:commandButton value="#{rec.UTILITY_BILL_UPLOAD}" actionListener="#{pavReqAssign.DownloadFile}" onclick="PrimeFaces.monitorDownload(start, stop);" icon="ui-icon-arrowthick-1-s" >
<p:fileDownload value="#{pavReqAssign.file}" />
</p:commandButton>

尝试此操作,假设属性
fileNameDL
在托管bean
pavReqAssign
中声明:

<p:commandButton value="#{rec.UTILITY_BILL_UPLOAD}" actionListener="#{pavReqAssign.DownloadFile}" onclick="PrimeFaces.monitorDownload(start, stop);" icon="ui-icon-arrowthick-1-s" >
    <f:setPropertyActionListener target="#{pavReqAssign.fileNameDL}" value="#{rec.UTILITY_BILL_UPLOAD}" />
    <p:fileDownload value="#{pavReqAssign.file}" />
</p:commandButton>


@kocko是的,正是这样,还有bean中“DownloadFile”函数的执行。谢谢你,奥马尔。没问题。
<p:commandButton value="#{rec.UTILITY_BILL_UPLOAD}" actionListener="#{pavReqAssign.DownloadFile}" onclick="PrimeFaces.monitorDownload(start, stop);" icon="ui-icon-arrowthick-1-s" >
    <f:setPropertyActionListener target="#{pavReqAssign.fileNameDL}" value="#{rec.UTILITY_BILL_UPLOAD}" />
    <p:fileDownload value="#{pavReqAssign.file}" />
</p:commandButton>