p:commandLink不会触发操作

时间:2013-02-08 15:22:59

标签: jsf primefaces

带有ids p:commandLinkcl1

cl2不会触发操作。 Tomcat控制台上没有任何内容,Firebug控制台上没有任何内容。

在这两种情况下,我应该在哪里寻找问题,我认为我完全绝望,没有任何错误或例外。

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:c="http://java.sun.com/jsp/jstl/core"
        xmlns:o="http://openfaces.org/"
        xmlns:p="http://primefaces.org/ui">
    <h:form>
        <ui:repeat var="sharing" value="#{sharingController.myList}">
            <ui:repeat var="sharingComment" value="#{sharing.subCommentList}">
                <p:commandLink id="cl1" value="" process="@this"  action="#{reportController.reportSharingComment(sharingComment)}" style="float:right;" id="sharingComment_alert" styleClass="icon_alert" title="#{msg['label.report']}" update=":messages" >
                </p:commandLink>
                 <p:commandLink value="" id="cl2" process="@this" action="#{sharingController.deleteComment(sharingComment)}" style="float:right;" id="sharingComment_delete" styleClass="icon_delete" title="#{msg['label.delete']}" update="@form :messages">
                </p:commandLink>
            </ui:repeat>
        </ui:repeat>
    </h:form>
</ui:composition>

我尝试在post构造中的嵌套ui:repeat中使用具体列表然后触发了commandlinks,但是我必须遍历字段列表,例如myList中每个共享的子评论列表。我正在加载myList并且每次共享时我都会在for post构造中加载subCommentlist,但我仍然无法使commandLink点火。

1 个答案:

答案 0 :(得分:1)

h:commandLink / h:commandButton is not being invoked

4.点解决了: 将bean放在视图范围中和/或确保在bean的(post)构造函数中加载数据模型(因此不在getter方法中!)应该修复它。

相关问题