【问题标题】:Ajax request using suggestionbox使用建议框的 Ajax 请求
【发布时间】:2011-02-21 19:52:17
【问题描述】:

我正在尝试 Richfaces,但遇到了根据从第一个建议/组合框中选择的值自动填充第二个建议/组合框的问题。

这是我的 xhmtl 摘录:

<h:outputLabel value="Brand:" for="brand" />
<rich:comboBox id="brand" selectFirstOnUpdate="false" defaultLabel="Enter some value" valueChangeListener="#{wizardBean.changeProduct}">
    <f:selectItems value="#{wizardBean.brandCategory}"/>
    <a4j:support event="onviewactivated" ajaxSingle="true" reRender="product"/>
</rich:comboBox>

<h:outputLabel value="Product:" for="product" />
<rich:comboBox id="product" value="#{wizardBean.product}" >
    <f:selectItems value="#{wizardBean.productList}"/>
</rich:comboBox>

虽然 UI 显示正常,但我无法看到更改第二个组合框的 ajax 请求。

请帮忙

干杯!

【问题讨论】:

    标签: richfaces


    【解决方案1】:

    根据应该是 onselect 的文档,从 sn-p 对我来说唯一明显的是您正在使用 onviewactivated 。

    http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/rich_comboBox.html

    另外,你有围绕这些组件的 h:form 吗?这很容易错过。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-03-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-07-22
      相关资源
      最近更新 更多