我想将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>
和我想要存储值的变量(即“#{rec.UTILITY_BILL_UPLOAD}”),是:
string fileNameDL;
答案 0 :(得分:0)
尝试此操作,假设在托管bean fileNameDL
中声明了属性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>