richfaces中ajax的局部刷新问题
averting
2009-04-10
按钮mainBtn被点击时,mainList.resultList,sub1List.resultList,sub2List.resultList都会被执行。
我仅仅想mainList.resultList被执行。 <rich:tabPanel switchType="client" > <rich:tab label="Main"> <h:form> <a:region renderRegionOnly="true"> <a:commandButton id ="mainBtn" ajaxSingle="true" value="Open" eventsQueue="EditQueue" ignoreDupResponses="true" reRender="mainPanel" oncomplete="#{rich:component('mainPanel')}.show();" /> <rich:modalPanel id="mainPanel" autosized="true" > <rich:dataTable value="#{mainList.resultList}" > </rich:dataTable> </rich:modalPanel> </a:region> </h:form> <a:commandButton ajaxSingle="true" value="Open" eventsQueue="EditQueue" ignoreDupResponses="true" reRender="sub1Panel" oncomplete="#{rich:component('sub1Panel')}.show();" /> <rich:modalPanel id="sub1Panel" autosized="true" > <rich:dataTable value="#{sub1List.resultList}" > </rich:dataTable> </rich:modalPanel> </rich:tab > <rich:tab label="Sub2"> <rich:modalPanel id="sub2Panel" autosized="true" > <rich:dataTable value="#{sub2List.resultList}" > </rich:dataTable> </rich:modalPanel> </rich:tab > </rich:tabPanel |
|
打倒小日本
2009-04-12
这个应该是JSF1.2的问题了 每次请求(即使是ajax)都需要在后台重新构建组件树
所以所有的getter方法都会被调用 JSF2.0已经修正了这个问题 另: <a:region renderRegionOnly="true" /> 我记得被这个包住的控件也可以解决这个问题,但楼主既然使用了为什么还不行呢? 难啊是我记错了 有时间再试试... |
|
wetouns
2009-04-17
不要用region,在你的mainBtn的reRender里打上你想要单独更新的那个table的ID就可以了,我一直是这样用的,没出过什么问题。
|
|
averting
2009-04-20
<a:region renderRegionOnly="true" />
是可以达到局部刷新的 上次测试的时候,页面过于复杂,所以得出了错误的结论 |