2011-10-27 40 views
1

我正在使用primefaces 3.0.0.M2庫。在此庫中,存在<p:selectOneMenu>元素。我的問題是,當我使用<p:ajax>標記與listener,updateprocess屬性,偵聽器方法不會被調用,但updateprocess工作正常。這裏是我的代碼:primefaces ajax與偵聽器,更新和進程屬性,偵聽器方法不會執行

<h:form prependId="false" id="frmNewRecord"> 
    <h:panelGrid columns="4" style="font-size: 10px;width:840px"> 
     Öğrenci No <p:inputText value={newRecord.azerKimKayit.ogrenciNo}" maxlength="11"> 
      <p:ajax event="blur" update="frmNewRecord" listener="#{newRecord.getStudent}" process="frmNewRecord" /> 
</h:form> 

而且我支持bean是(necassary法):

public void getStudent() { 
    azerKimKayit = azerKimKayitBo.findByOgrNo(azerKimKayit.getOgrenciNo()); 
} 
+0

您的代碼片段似乎不正確或過於簡化。我沒有看到一個關閉'p:input'和'h:panelGrid'。 –

+0

我只複製了必要的代碼片段。 – olyanren

回答

0

嘗試傳遞一個AjaxBehavior事件在你的方法:

public void getStudent(AjaxBehaviorEvent event) { 
    azerKimKayit = azerKimKayitBo.findByOgrNo(azerKimKayit.getOgrenciNo()); 
}