JSF2 - ui:repeat,第一个命令链接不起作用,但其他链接起作用

发布于 2024-12-11 15:32:17 字数 2126 浏览 0 评论 0原文

我有一个 ui:repeat 循环来执行一些分页:

<h:panelGroup layout="block" style="height: 25px;text-align: right" id="Prod-printed-paging">
  <ui:repeat value="#{upBean.pagesProdPrinted}"
     id="Prod-printed-page-loop"
     var="cppage" varStatus="cpstatus" >
     <h:panelGroup rendered="#{cpstatus.first and not (upBean.pageProdPrinted == '1')}">
        <h:commandLink id="previous" style="color: #390">#{appMsg.previous}
           <f:ajax listener="#{upBean.previousPageProdPrinted}"
              event="click"
              render=":form-myProd:get-printed-Prod :form-myProd:Prod-printed-paging"/>
        </h:commandLink> |
     </h:panelGroup>
     <h:panelGroup rendered="#{upBean.pageProdPrinted eq cppage}">
        <h:panelGroup style="font-weight: bold">#{cppage}</h:panelGroup>
     </h:panelGroup>
     <h:panelGroup rendered="#{not (upBean.pageProdPrinted eq cppage)}">
        <h:commandLink>
           <h:panelGroup>#{cppage}</h:panelGroup>
           <f:ajax listener="#{upBean.goToPagePrinted(cppage)}"
              event="click"
              render=":form-myProd:get-printed-Prod :form-myProd:Prod-printed-paging"/>
        </h:commandLink>
     </h:panelGroup>
     <h:panelGroup rendered="#{cpstatus.last and not (upBean.pageProdPrinted == upBean.nbPageProdPrinted)}">
      | <h:commandLink id="next" style="color: #390">#{appMsg.next}
           <f:ajax listener="#{upBean.nextPageProdPrinted}"
              event="click"
              render=":form-myProd:get-printed-Prod :form-myProd:Prod-printed-paging"/>
         </h:commandLink>
     </h:panelGroup>
   </ui:repeat>
</h:panelGroup>

这显示得很好,如下所示(如果我们位于页面 > 第 n.1 页):

上一页 | 下一页1 2 3 4 | 1 2 3 4 next

所有链接都运行良好(触发 ManagedBean 操作),但“上一个:”链接。单击“上一个”似乎会执行某些操作: - 我看到它发送了一个部分请求(来自 firebug Console 选项卡),但“previousPageProdPrinted”处的断点没有被捕获。

我有 ah:form,没有嵌套在另一个表单中。我可以做些什么来跟踪这个问题吗?

环境: - 玻璃鱼 3.1 - Mojarra 2.1.3 (FCS b02)

感谢您的阅读, 股份公司

I have a ui:repeat loop to perfom some paging:

<h:panelGroup layout="block" style="height: 25px;text-align: right" id="Prod-printed-paging">
  <ui:repeat value="#{upBean.pagesProdPrinted}"
     id="Prod-printed-page-loop"
     var="cppage" varStatus="cpstatus" >
     <h:panelGroup rendered="#{cpstatus.first and not (upBean.pageProdPrinted == '1')}">
        <h:commandLink id="previous" style="color: #390">#{appMsg.previous}
           <f:ajax listener="#{upBean.previousPageProdPrinted}"
              event="click"
              render=":form-myProd:get-printed-Prod :form-myProd:Prod-printed-paging"/>
        </h:commandLink> |
     </h:panelGroup>
     <h:panelGroup rendered="#{upBean.pageProdPrinted eq cppage}">
        <h:panelGroup style="font-weight: bold">#{cppage}</h:panelGroup>
     </h:panelGroup>
     <h:panelGroup rendered="#{not (upBean.pageProdPrinted eq cppage)}">
        <h:commandLink>
           <h:panelGroup>#{cppage}</h:panelGroup>
           <f:ajax listener="#{upBean.goToPagePrinted(cppage)}"
              event="click"
              render=":form-myProd:get-printed-Prod :form-myProd:Prod-printed-paging"/>
        </h:commandLink>
     </h:panelGroup>
     <h:panelGroup rendered="#{cpstatus.last and not (upBean.pageProdPrinted == upBean.nbPageProdPrinted)}">
      | <h:commandLink id="next" style="color: #390">#{appMsg.next}
           <f:ajax listener="#{upBean.nextPageProdPrinted}"
              event="click"
              render=":form-myProd:get-printed-Prod :form-myProd:Prod-printed-paging"/>
         </h:commandLink>
     </h:panelGroup>
   </ui:repeat>
</h:panelGroup>

This displays fine like this (in the case we are on a page > page n. 1):

Previous | 1 2 3 4 | next

All links are working well (firing the ManagedBean action) but the "Previous: link. Clicking "Previous" seems to do something:
- I see it sends a partial-request (from firebug Console tab) but breakpoint at the "previousPageProdPrinted" doesn't get caught.

I have a h:form, not nested in another one. Is there anything I can do to track this issue?

Environment:
- Glassfish 3.1
- Mojarra 2.1.3 (FCS b02)

Thank you for reading,
JSC

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文