1

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.

Kalle Richter
  • 8,008
  • 26
  • 77
  • 177
merveotesi
  • 2,145
  • 15
  • 53
  • 84
  • Can you please only post the relevant code? There are hundreds of lines of markup within `` tags that are completely unnecessary. – maple_shaft Feb 08 '13 at 15:44
  • Sometimes, SO members tell to share everything to find out the problem, i am going to delete `ui:remove` s – merveotesi Feb 08 '13 at 16:21
  • 2
    Are you sure that this component isn't inside another `` right? Because that would be `form` nesting, so your `UIInput`s 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](http://stackoverflow.com/q/2118656/1065197) – Luiggi Mendoza Feb 08 '13 at 16:42
  • This `` is included in another xhtml page but, there is no other covering `` – merveotesi Feb 08 '13 at 17:10
  • Thanks for the link, i am going to try the advises. – merveotesi Feb 08 '13 at 17:21
  • 3
    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 Feb 08 '13 at 19:02
  • @LuiggiMendoza can you look at my question update, thanks in advance – merveotesi Feb 10 '13 at 17:50
  • @BalusC can you look at my question update, thanks in advance – merveotesi Feb 10 '13 at 17:51
  • For anyone else facing the same, Check out this https://stackoverflow.com/questions/2118656/commandbutton-commandlink-ajax-action-listener-method-not-invoked-or-input-value – Hillary Bett May 20 '19 at 07:00

1 Answers1

1

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.

Community
  • 1
  • 1
merveotesi
  • 2,145
  • 15
  • 53
  • 84