1
votes

p:commandLinks with ids cl1 and cl2 do not fire actions. There is nothing on Tomcat console, nothing on Firebug console.

Where should i look for the problem in such situations, i think i am totally desperate without any error or exception, in both consoles.

<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>

I tried with a concrete list in the nested ui:repeat in post construct then commandlinks was fired, but I must iterate over field lists like sub commentlists of every sharing in myList. I'm loading both myList and for every sharing I load the subCommentlist in a for in post construct, but I still cannot make the commandLinks fire.

1
Can you please only post the relevant code? There are hundreds of lines of markup within <ui:remove> tags that are completely unnecessary. - maple_shaft
Sometimes, SO members tell to share everything to find out the problem, i am going to delete ui:remove s - merveotesi
Are you sure that this component isn't inside another <h:form> right? Because that would be form nesting, so your UIInputs won't work. Also, next time just post the relevant code to reproduce the problem, not your whole code. More info: h:commandLink / h:commandButton is not being invoked - Luiggi Mendoza
This <ui:composition> is included in another xhtml page but, there is no other covering <h:form> - merveotesi
There's too much code noise. I can't imagine that for example the style="border: 1px solid #AAAAAA;" is relevant to the problem. Does the problem disappear when you remove it? No? Keep it out then. Edit your question to post a real SSCCE, please. That is, the smallest possible code snippet which we (and you!) should be able to copy'n'paste'n'run unmodified in a completely blank playground project with everything set to default (unless otherwise specified) in order to see the concrete problem ourselves. - BalusC

1 Answers

1
votes

h:commandLink / h:commandButton is not being invoked

The 4. point solved: Putting the bean in the view scope and/or making sure that you load the data model in (post)constructor of the bean (and thus not in the getter method!) should fix it.