Jsf <;h:命令按钮>;操作后未刷新页面

Jsf <;h:命令按钮>;操作后未刷新页面,jsf,richfaces,Jsf,Richfaces,嗨,我们使用的是a4j标签 在这里,单击按钮后,我们将从数据库中检索数据。即使数据在服务器中可用,它也不会显示在视图上。手动刷新网页后会导致数据显示 下面是代码片段 .... 这里有一些代码 <rich:tab id="menu5" label="Recall"> <ui:include src="/pages/mctrans/reCallMcifTrans.xhtml" /> </rich:tab> reCallMcifTrans.xh

嗨,我们使用的是a4j标签

在这里,单击按钮后,我们将从数据库中检索数据。即使数据在服务器中可用,它也不会显示在视图上。手动刷新网页后会导致数据显示

下面是代码片段 .... 这里有一些代码

  <rich:tab id="menu5" label="Recall">
  <ui:include src="/pages/mctrans/reCallMcifTrans.xhtml" />  
  </rich:tab>

reCallMcifTrans.xhtml包含以下代码

<h:commandButton type="button" id="reCallbutton1" value="   Search   "
    styleClass="commandExButton">
    <a4j:support event="onclick" id="ajsf12"
        oncomplete="javascript:alert('Search   Completed');javascript:document.body.style.cursor='default';"
        action="#{mcifRecallTransBean.reCallSearch}" reRender="reCallgrid1" />
</h:commandButton>

当您在bean中使用请求参数时,您需要通过操作再次传递它们:

<h:commandButton type="button" id="reCallbutton1" value="Search" styleClass="commandExButton">
    <a4j:support event="onclick" id="ajsf12" oncomplete="javascript:alert('Search  Completed');javascript:document.body.style.cursor='default';" action="#{mcifRecallTransBean.reCallSearch}" reRender="reCallgrid1" />
    <f:param name="param1" value="#{param['param1']}" />
    <f:param name="param2" value="#{param['param2']}" />
</h:commandButton>


看起来您正在使用RichFaces 3.3。因此,您不需要
bean的作用域是什么?url中是否有get参数?Bean范围是会话级别。传递搜索参数
<a4j:commandButton type="button" id="reCallbutton1" value="Search"
    styleClass="commandExButton"
    action="#{mcifRecallTransBean.reCallSearch}"
    reRender="reCallgrid1"
    oncomplete="javascript:alert('Search   Completed');javascript:document.body.style.cursor='default';" />
<a4j:commandButton type="button" id="reCallbutton1" value="Search"
    styleClass="commandExButton"
    action="#{mcifRecallTransBean.reCallSearch}"
    reRender="reCallgrid1" />
<!-- Note that there's no oncomplete in this case -->
<a4j:status for="reCallbutton1">
    <f:facet name="start">
        <h:graphicImage  value="/res/images/wait.gif"/>
    </f:facet>
</a4j:status>
@KeepAlive
public class McifRecallTransBean {
    //managed bean code here...
}