Jsf 后台管理Bean获得页面值的几种方式(一)

1 使用a4j:commandLink:

<a4j:commandLink id="clearBannerPictureLink"
onclick
="#{rich:component('clearPanel')}.show()"
disabled
="#{item.isDisplay}">
<h:graphicImage value="/images/banners/btn_Clear.jpg"
style
="border:0" />
<f:setPropertyActionListener value="#{item}"
target
="#{EsBBBannerBean.selectedItem}" />
<f:setPropertyActionListener value="#{row}"
target
="#{EsBBBannerBean.jsfRow}" />
</a4j:commandLink>
<!-- the clear Panel -->
<rich:modalPanel id="clearPanel" autosized="true" width="200">
<f:facet name="header">
<h:outputText value="Are you sure to clear the uploaded picure ?"
style
="padding-right:15px;" />
</f:facet>
<h:form>
<table width="100%">
<tbody>
<tr>
<td align="center" width="50%"><a4j:commandButton value="Yes"
action
="#{EsBBBannerBean.clearUploadData}"
image
="/images/banners/blue_Yes.jpg"
oncomplete
="#{rich:component('clearPanel')}.hide();"
reRender
="temp,bannerPath,table,info" /></td>
<td align="center" width="50%"><a4j:commandButton
value="Cancel" image="/images/banners/blue_Cancel.jpg"
onclick
="#{rich:component('clearPanel')}.hide();return false;" />
</td>
</tr>
</tbody>
</table>
</h:form>
</rich:modalPanel>

重点在于使用<f:setPropertyActionListener将当前值关联到后台管理Bean的某个属性上-->弹出新面板之后(已经将值绑定到指定属性)-->action调用后台method处理


 

你可能感兴趣的:(bean)