0

単純なことはわかっていますが、機能していないようです。部分トリガーの使用方法は知っていますが、何らかの理由で機能していないようです。さて、私の質問は<af:table>、jsf フラグメント内にあり (このフラグメントを作成するためにタスク フローを使用しました)、テキスト フィールドで valuechangelistener を使用して単純な検索メソッドを作成することです。テキストフィールドでは、問題は機能してい<af:table partialTrigger=":id of my textfield">ないようで、テーブルに古い値が保持されているため、更新されていないか、この種の問題の回避策はありますか。明確にするために、コードの一部を投稿します。

JSF フラグメント ページ:

<?xml version='1.0' encoding='UTF-8'?>
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
                xmlns:f="http://java.sun.com/jsf/core">
  <af:panelStretchLayout id="psl1" inlineStyle="width: 900px;">
    <f:facet name="center">
      <af:panelGroupLayout layout="scroll" id="pgl3">
        <af:panelGridLayout id="pgl1">
          <af:gridRow marginTop="5px" marginBottom="5px" height="auto" id="gr1">
            <af:gridCell marginStart="10px" width="100px" id="gc1" halign="end" valign="middle">
              <af:outputLabel value="Search: " id="ol1" inlineStyle="color:Black; font-size:12px; font-weight:bold;"/>
            </af:gridCell>
            <af:gridCell marginStart="10px" width="250px" id="gc2" halign="start" valign="middle">
              <af:inputText label=" " valueChangeListener="#{personnelFragment.SearchRecords}" autoSubmit="true" columns="40" id="searchTxt"/>
            </af:gridCell>
            <af:gridCell marginStart="10px" width="100px" id="gc3" halign="end" valign="middle">
              <af:outputLabel value="Sort By: " id="ol2" inlineStyle="color:Black; font-size:12px; font-weight:bold;"/>
            </af:gridCell>
            <af:gridCell marginStart="10px" marginEnd="5px" width="25%" id="gc4">
              <af:selectOneChoice label=" " id="soc1">
                <af:selectItem label="Firstname" id="si1"/>
                <af:selectItem label="Middlename" id="si2"/>
                <af:selectItem label="Lastname" id="si3"/>
              </af:selectOneChoice>
            </af:gridCell>
          </af:gridRow>
        </af:panelGridLayout>


        <af:table width="700px" partialTriggers=":searchTxt" id="t1" value="#{personnelFragment.personnelInfoData}" var="PersonnelData"
        horizontalGridVisible="true" verticalGridVisible="true" inlineStyle="margin: 10px 0 10px 0;"
        rowSelection="single">
            <af:column headerText="Prefix" align="center" id="c4">
                <af:outputLabel value="#{PersonnelData.prefix}" id="ol6"
                                inlineStyle="color:Black; font-size:10px;"/>
            </af:column>

            <af:column headerText="Firstname" align="center" id="c1">
                <af:outputLabel value="#{PersonnelData.firstName}" id="ol3"
                                inlineStyle="color:Black; font-size:10px;"/>
            </af:column>

            <af:column headerText="Middlename" align="center" id="c2">
                <af:outputLabel value="#{PersonnelData.middleName}" id="ol4"
                                inlineStyle="color:Black; font-size:10px;"/>
            </af:column>

            <af:column headerText="Lastname" align="center" id="c3">
                <af:outputLabel value="#{PersonnelData.lastName}" id="ol5"
                                inlineStyle="color:Black; font-size:10px;"/>
            </af:column>

            <af:column headerText="Suffix" align="center" id="c5">
                <af:outputLabel value="#{PersonnelData.suffix}" id="ol7"
                                inlineStyle="color:Black; font-size:10px;"/>
            </af:column>

            <af:column headerText=" " align="center" id="c6">
                <af:commandImageLink id="cil1" icon="#{resource['images:check.png']}" actionListener="#{personnelFragment.SearchPersonnelInfo}" />
            </af:column>
        </af:table>

  </af:panelGroupLayout>
</f:facet>
<f:facet name="top"/>

私のBean(値変更リスナー)ですが、重要な部分だけを貼り付けます:

        calState = (OracleCallableStatement)con.prepareCall("{ call SEARCH_PERSONNELINFO(?, ?) }");
    calState.setObject(1, e.getNewValue());
    calState.registerOutParameter(2, OracleTypes.CURSOR);
    calState.execute();
    rs = (ResultSet)calState.getObject(2);
    while(rs.next()){
        PersonnelInfoData.add(new GetPersonnelData(rs.getInt(1), rs.getString(2), rs.getString(3),
                                rs.getString(4), rs.getString(5), rs.getString(6)));
        System.out.println(rs.getInt(1) +" "+ rs.getString(2));

    }
    calState.close();

ストア プロシージャを使用しました。このコードは問題なく動作しています。サンプルの結果をログに出力し、問題なく動作していることがわかります。私の問題は、ページを更新するだけです。

1)。partialTrigger は<af:form>タグがある場合にのみ発生しますか?(jsf フラグメントがサポートしていないため<af:form>) 2) ほんの少し前に検索したところ、いくつかのフォーラムで、このようにプログラムでトリガーを作成していAdfFacesContext.getCurrentInstance().addPartialTarget(Component);ましたが、このコードが何であるかを説明してもらえますか?為に?3) jsf フラグメント内のテーブルを更新するにはどうすればよいですか?

ヘルプとガイダンスは本当に感謝しています。

4

2 に答える 2

0

1)af:formタグは、フラグメント/タスクフローをドロップしたjsp / jspxページにあります(確認できます)。2)partialTrigger属性と同じですが、IDの代わりに、Beanで定義されたバインディングを使用します。
3)あなたが言ったように、partialTrigger="コンポーネントのid"を使用します。

データの表示にBeanを使用しているため、イテレータのキャッシュを確認することをお勧めします(バインディングを確認し、イテレータを選択し、プロパティを確認します)。

于 2013-01-11T08:45:35.770 に答える
0

AdfFacesContext.getCurrentInstance().addPartialTarget(t1); のような行を使用して、バッキング Bean のテーブルを手動で更新してみてください。

于 2013-01-10T18:56:51.607 に答える