【问题标题】:p:commandLink action only working for first link [duplicate]p:commandLink 操作仅适用于第一个链接 [重复]
【发布时间】:2015-04-25 07:37:05
【问题描述】:

这是我的 XHTML 代码:

<ui:repeat var="clinic" value="#{searchController.clinicsViewList}">
    <h:form rendered="#{clinic.timingSlot.size() gt 0 ?true:false}" id="lessSlotForm">
        <p:scrollPanel style="height:55px;overflow:hidden;overflow-x: scroll;white-space: nowrap;">
            <ui:repeat var="slot" value="#{clinic.timingSlot}">
                <p:commandLink value="#{slot.slotTime}"
                               action="#{appController.bookAppointmentSlot(slot , clinic)}"
                               disabled="#{slot.active eq 'true'?false:true}"
                               style="margin:5px;" >
                </p:commandLink>
            </ui:repeat>
        </p:scrollPanel>
    </h:form>
</ui:repeat>

这里是&lt;ui:repeat&gt;显示不同的诊所,里面&lt;ui:repeat&gt;是显示每个诊所的时间段。

这里是&lt;ui:repeat&gt;&lt;p:commandLink&gt; 有动作显示诊所的所有时间段。

但是这里显示了所有诊所的时间段列表。但是当我点击第一个诊所时间段时(&lt;p:commandLink&gt;)工作正常。 但是第二个诊所时间段(&lt;p:commandLink&gt;)不起作用。 谁能告诉我是什么原因。

【问题讨论】:

  • @tt_dev:如果是重复的,你可以在flagging中这样标记
  • @Kukeltje:我已经做到了,谢谢。
  • @tt_dev 了不起。我做到了,但它没有出现在任何地方。不是重复的,也不是“可能重复的”。有人不认为它是重复的吗?

标签: jsf primefaces


【解决方案1】:

这很有趣,因为您的 h:form 在 ui 内:repeat 将您的表单保持在 ui 之外:repeat

【讨论】:

  • 谢谢,但这正是上面评论中提到的。请将其标记为重复。不用回答了
猜你喜欢
  • 2014-02-16
  • 1970-01-01
  • 1970-01-01
  • 2017-08-12
  • 2017-01-16
  • 2017-11-21
  • 2015-09-17
  • 2012-07-16
  • 1970-01-01
相关资源
最近更新 更多