1

私はJSF 1.2andを使用しRichFaces 3.3.3ていますが、非常に奇妙な問題があります。コードが行うことは、検索するメディア アイテムの名前を取得し、それをバッキング Bean 属性の searchTitle に入れることです。ユーザーが検索ボタンをクリックすると、onSearchアクション リスナーが入力されます。結果リスト。

そして、ここにコードがあります

<rich:panelBar>
   <rich:panelBarItem>
       <rich:tabPanel>
           <rich:tab label="Media">
              <h:panelGrid columns="1">
                 <h:panelGrid columns="2">
                   <h:inputText value="#{media.searchTitle}"/>
                   <a4j:commandButton value="Search" actionListener="#{media.onSearch}"/>
                 </h:panelGrid>
                 <a4j:outputPanel id="mediaSearchResults" ajaxRendered="true">
                    <rich:dataTable value="#{media.results}" var="item">
                       <h:column>
                          <h:outputText value="#{item.title}"/>
                       </h:column>
                    </rich:dataTable>
                 </a4j:outputPanel>
              </h:panelGrid>
           </rich:tab>
       </rich:tabPanel>
   </rich:panelBarItem>
</rich:panelBar>

そして、バッキング Bean コード

private String searchTitle="";
private List<MediaItem> results;

public void setSearchTitle(String title){
    getLogger().log(Level.INFO,"At the setter of the search title string"); 
    this.searchTitle = title;
}

public String getSearchTitle(){
    return searchTitle;
}
//Setter and getter for the results list;

//Action Listener
public void onSearch(ActionEvent evt){
   getLogger().log(Level.INFO,"At the actionListener"); 
   //Some function that searches and populates the results list
   populateResults();
}

問題は、検索ボタンをクリックするたびにアクションリスナーが呼び出されないことですが、ページを火災バグで検査している間、クリックするたびにリクエストがサーバーに送信されますが、アクションリスナー自体はトリガーされません。

なぜ私がこの問題を抱えているのか、誰にも手がかりがありますか? 初心者なので簡潔にお願いします。

前もって感謝します。

これは、firebug の Reposne/ Request ヘッダーです。

応答ヘッダー

Ajax-Response   true
Cache-Control   no-cache, must-revalidate, max_age=0, no-store
Content-Type    text/xml;charset=UTF-8
Date    Sat, 02 Jun 2012 16:03:13 GMT
Expires 0
Pragma  no-cache
Server  Sun GlassFish Enterprise Server v2.1.1
Transfer-Encoding   chunked
X-Powered-By    Servlet/2.5, JSF/1.2

リクエスト ヘッダー

Accept  text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding gzip, deflate
Accept-Language en,ar;q=0.7,en-us;q=0.3
Connection  keep-alive
Content-Length  17986
Content-Type    application/x-www-form-urlencoded; charset=UTF-8
Cookie  JSESSIONID=de975352b3adc4f59d57006755ea; JSESSIONID=de682f835c0fa928413ba7e5f59d; form:tree-hi=form:tree:applications:enterpriseApplications
Host    localhost:8080
User-Agent  Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0

そして、応答http://justpaste.it/10uhの xml ペイロードへのリンク

4

1 に答える 1

2

f:formまたはのa4j:form周りを試す必要がありますa4j:commandButton

于 2012-06-02T15:54:57.737 に答える