2
在我的申請,我有如下一段代碼:渲染的Ajax調用不起作用
<h:form>
<h:outputLabel for="type" style="font-weight: bold" value="*Type: " />
<h:selectOneMenu label="type" id="type" binding="#{type}">
<f:ajax execute="type" render="text article video" />
<f:selectItem itemValue="article" itemLabel="Article" />
<f:selectItem itemValue="video" itemLabel="Video" />
</h:selectOneMenu>
<p:message for="type" />
<h:outputText id="text" value="#{type.value}" />
<h:panelGrid id="article" rendered="#{type.value == 'article'}" >
...
</h:panelGrid>
<h:panelGrid id="video" rendered="#{type.value == 'video'}" >
...
</h:panelGrid>
</h:form>
當我從菜單中選擇一個選項,我相信Ajax調用是因爲<h:outputText>
解僱正確地用type.value
呈現。但是,沒有渲染任何<h:panelGrid>
。
我會很感激,如果你能告訴我,我應該怎麼解決這個問題。
最好的問候,
詹姆斯陳
非常感謝!這正是我的問題:)。 –
不客氣。 – BalusC