0

こんにちは、a4j タグと一緒に使用しています。

ここでは、ボタンのクリック後にデータベースからデータを取得しています。データはサーバーで利用できますが、オーバー ビューには表示されません。Web ページを手動で更新すると、データが表示されます。

ここにコードスニペットがあります....ここにいくつかのコード

  <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>
4

2 に答える 2

1

RichFaces3.3を使用しているようです。したがって、すでにこれを行っているものを使用できるため、 <h:commandButtonwithは必要ありません。コードを次のようにリファクタリングできます。<a4j:support><a4j:commandButton>

<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';" />

reCallgrid1コンポーネントがと同じ<h:form>で使用可能であることを確認してください<a4j:commandButton>

また、ボタンがクリックされたときのデータの動作を検索するときに待機を追加する必要があるため、デモに示されているように<a4j:status>と一緒に使用できます。基本的な例は次のとおりです。<a4j:commandButton><a4j:status>

<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>

最後になりましたが、<a4j:keepAlive>JSF 2をシミュレートするには、マネージドBeanを切り替えてスコープを要求し、RichFacesを強力に使用する必要があります@ViewScoped。管理対象Beanのアノテーションの形式で使用することもできます(追加の構成は不要)。

@KeepAlive
public class McifRecallTransBean {
    //managed bean code here...
}
于 2013-03-13T14:58:30.617 に答える
0

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>
于 2013-03-13T10:41:24.087 に答える