0
我有一個primafaces selectOneMenu。當我點擊渲染菜單時,下拉列表不會出現,瀏覽器出現此錯誤。我正在使用IE 8和primefaces 5.但是,當我更改爲h:selectOneMenu下拉菜單正常工作。請幫助,我卡住了。這裏是我的代碼:
<p:selectOneMenu id="app" value="#{refbean.selapp}" rendered="#{refbean.selItem =='SMS NOTIFICATION'}">
<f:selectItem itemValue="Select" itemLabel="Select Application"></f:selectItem>
<f:selectItems value="#{refbean.appList}"></f:selectItems>
<f:ajax event="change"
execute="@this"
render="shownotif"
listener="#{refbean.setNotificationValues}">
</f:ajax>
</p:selectOneMenu>
I also tried using <script src="http://code.jquery.com/jquery-migrate-1.1.1.js"></script> but the issue still remains.
I am not able to test the ajax call because the drop down menu is not populated at all in the first place. When I click on the drop down menu i see the javascript error in the browser : `$browser.msie is null or not an object.` Here is my full code :
<p:panelGrid id="showOption">
<p:row id="showsms" rendered="#{refbean.selItem =='SMS NOTIFICATION'}">
<p:column>
<p:outputLabel value="#{msg['createcr.app']}" rendered="#{refbean.selItem =='SMS NOTIFICATION'}" styleClass="LabelDescription"></p:outputLabel>
</p:column>
<p:column>
<p:selectOneMenu id="app" value="#{refbean.selapp}" rendered="#{refbean.selItem =='SMS NOTIFICATION'}">
<f:selectItem itemValue="Select" itemLabel="Select Application"></f:selectItem>
<f:selectItems value="#{refbean.appList}"></f:selectItems>
<f:ajax event="change"
execute="@this"
render="shownotif"
listener="#{refbean.setNotificationValues}">
</f:ajax>
</p:selectOneMenu>
</p:column>
</p:row>
<p:row id="shownotif" rendered="#{refbean.selItem == 'SMS NOTIFICATION'}">
<p:column>
<p:outputLabel value="#{msg['createcr.notif']}" styleClass="LabelDescription"></p:outputLabel>
</p:column>
<p:column>
<p:selectOneMenu id="notif" value="#{refbean.selnot}" rendered="#{refbean.selItem == 'SMS NOTIFICATION'}">
<f:selectItem itemValue="Select" itemLabel="Select Notification List"></f:selectItem>
<f:selectItems value="#{refbean.noList}"></f:selectItems>
<f:ajax event="change"
execute="@this"
render="showtext"
listener="#{refbean.setSelNotification}"></f:ajax>
</p:selectOneMenu>
</p:column>
</p:row>
</p:panelGrid>
嘗試使用但問題仍然存在 – user2523454 2014-10-11 14:59:24
不要自己包含jquery,PF會做。其他PF組件是否工作?你有h:頭嗎?你有另一種形式的表格嗎?我相信你應該在PF組件上使用p:ajax而不是f:ajax – 2014-10-11 16:03:52
下拉列表本身並不是首先出現的。瀏覽器拋出錯誤$ browser.msie爲空或不是對象。請幫助,我堅持了兩天。 – user2523454 2014-10-12 05:33:20