【问题标题】:PanelGrid and OutputLabelPanelGrid 和 OutputLabel
【发布时间】:2013-05-16 09:09:52
【问题描述】:

我的代码有问题。我想要一个 SelectOneMenu 来选择一个客户(这个对我来说很好用)。但是在我选择了一个元素之后,我应该会在 OutputText 中看到这个客户的 ID。这不起作用:

<h:form id="form">
  <h:panelGrid columns="2">
    <h:outputLabel for="customer" value="Customer: " />
    <h:selectOneMenu id="customerList"
    value="#{customerController.selected}" required="true">
      <f:selectItems value="#{customerController.items}"
      var="customer"
      itemLabel="#{customer.id} #{customer.firstname} #{customer.lastname} #{customer.email}"
      itemValue="customer" />
      <p:ajax update=":form:myId" />
    </h:selectOneMenu>
    <h:outputLabel value="Customer ID: " for="myId" />
    <h:outputText id="myId"
    value="#{customerController.selected.id}" />
  </h:panelGrid>
</h:form>

有什么想法吗?

【问题讨论】:

  • 您是否收到任何日志错误?
  • 总是发布你的后台代码。
  • 请阅读服务器日志和ajax响应正文并反馈。

标签: java html xml jsf primefaces


【解决方案1】:

尝试使用:

<p:ajax update="myId" />

【讨论】:

  • 今天问题解决了,小伙子们。我不得不使用另一个支持 Bean。反正;谢谢。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-01-28
  • 2015-05-04
  • 1970-01-01
  • 2018-07-15
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多