我想使用 Primefaces 5.2 创建一个移动表单,其中一个selectOneMenu
结果通过 Ajax 更新第二个selectOneMenu
,就像这里的展示示例一样:http: //www.primefaces.org/showcase/ui/ajax/dropdown.xhtml然后是移动版本.
我的问题与这个问题非常相似:Primefaces Mobile 的 Ajax 没有更新 <p:selectOneMenu>但没有答案。
我已经创建了一个 JSF 页面和 backingbean ,就像展示示例一样,它可以工作。
<f:view renderKitId="PRIMEFACES_MOBILE" />
但是,当我使用第二个添加移动方面时selectOneMenu
,更新后会呈现平淡无奇的状态,并显示一个永久微调器。
...
<f:view renderKitId="PRIMEFACES_MOBILE" />
...
<h:body>
<h:form>
<p:growl id="msgs" showDetail="true" />
<p:panel header="Select a Location" style="margin-bottom:10px;">
<h:panelGrid columns="2" cellpadding="5">
<p:outputLabel for="country" value="Country: " />
<p:selectOneMenu id="country" value="#{dropdownView.country}" style="width:150px">
<p:ajax listener="#{dropdownView.onCountryChange}" update="city" />
<f:selectItem itemLabel="Select Country" itemValue="" noSelectionOption="true" />
<f:selectItems value="#{dropdownView.countries}" />
</p:selectOneMenu>
<p:outputLabel for="city" value="City: " />
<p:selectOneMenu id="city" value="#{dropdownView.city}" style="width:150px">
<f:selectItem itemLabel="Select City" itemValue="" noSelectionOption="true" />
<f:selectItems value="#{dropdownView.cities}" />
</p:selectOneMenu>
<p:outputLabel for="debug" value="Debug: " />
<p:inputText id="debug" value="#{dropdownView.debug}"/>
</h:panelGrid>
...
debug
当我的更新目标是我inputText
的更新时,Ajax 调用有效,但当我的更新目标city
不是selectOneMenu
时。
这是一个错误吗?我是否滥用了移动方面?这方面的文档似乎很少。
编辑
未inputText
包含在源中,已更正。