0

Hi people :) I have created a tree table using primefaces. In one of the table columns I have included 3 buttons. The problem is that the buttons work only for the first level and not for the second level. Can someone help me please. This is my treeTable code :

<h:form>
        <p:treeTable value="#{processBean.treeNode}" var="node" ajax="true"
            selectionMode="single" rowKey="#{node.id}">

            <p:ajax event="select" listener="#{processBean.onSelect(node)}" />
            <f:facet name="header">Processes View</f:facet>

            <p:column headerText="Id">
                <p:outputLabel value="#{node.id}" />
            </p:column>
            <p:column headerText="Name">
                <p:outputLabel value="#{node.name}" />
            </p:column>
            <p:column headerText="Description">
                <p:outputLabel value="#{node.description}" />
            </p:column>
            <p:column headerText="Created date">
                <p:outputLabel value="#{node.createdDate}" />
            </p:column>
            <p:column headerText="Status">
                <p:outputLabel value="#{node.status}" />
            </p:column>
            <p:column headerText="Actions" styleClass="centered-text">
                <p:commandButton title="Start" ajax="true"
                    icon="fa fa-play Fs16 white"
                    action="#{processBean.startProcess(node)}">
                </p:commandButton>
                <p:spacer width="4%" />
                <p:commandButton title="Skip" ajax="true"
                    icon="fa fa-step-forward Fs16 White"
                    actionListener="#{processBean.skipProcess(node)}">
                </p:commandButton>
                <p:spacer width="4%" />
                <p:commandButton title="Complete" ajax="true"
                    icon="fa fa-stop Fs16 white"
                    actionListener="#{processBean.completeProcess(node)}">
                </p:commandButton>
            </p:column>

        </p:treeTable>
    </h:form>
Kukeltje
  • 12,223
  • 4
  • 24
  • 47
Nana
  • 55
  • 8
  • Do you get any error either in client or server side? – Aritz Sep 11 '18 at 15:03
  • No error is shown. Just the method that must be called is not called. It is strange. It works for the highest level but for low levels not. – Nana Sep 11 '18 at 15:04
  • Check the browser tools (F12). Any Js error? Does any request get fired when you click? – Aritz Sep 11 '18 at 15:06
  • I have checked it. No error there. – Nana Sep 11 '18 at 15:08
  • Tried PrimeFaces 6.2 or 6.3-SNAPSHOT instead of the unmentioned version you use. And what about your JSF version? And do you have a simple bean to accompany this xhtml? – Kukeltje Sep 11 '18 at 15:09
  • No I have not tried to change it. I Will try now. I use primefaces 6.2 and jsf 2.2.13 – Nana Sep 11 '18 at 15:10
  • There is no primefaces 6.3-SNAPSHOT in maven repository – Nana Sep 11 '18 at 15:16
  • Correct, you need to build that yourself from source, but 6.2 is already fairly recent and if you cannot find an issue related to something like this in github, there has most likely not been any change. Tried removing selection (and the related ajax call) and see if that makes a difference? And can you check if clicking on the commandButtons does fire an ajax call? And what the response is. Try adding `process="@this"` to the commandButtons – Kukeltje Sep 11 '18 at 15:22
  • And tried using an `h:commandButton` with an `f:ajax` in it? – Kukeltje Sep 11 '18 at 15:30
  • Did all but still nothing. No i didnt tried that. I tried using p:commandButton with a p:ajax but still nothing – Nana Sep 11 '18 at 15:35
  • 2
    https://stackoverflow.com/q/2118656/1341535 – Vsevolod Golovanov Sep 11 '18 at 18:59
  • I read it. Unfortunately none of these issues is my case :( – Nana Sep 11 '18 at 22:14
  • are you sure the method was not called? have you tried print something at the first line of method? – Blablabla Sep 12 '18 at 02:35
  • Yes, I use loggers – Nana Sep 12 '18 at 06:46
  • Hm, I had recently such behavior. I tried many hours, but my bean method wasn't called. But unfortunately I don't remember the position in my code. I had built a workaround.... – Holger Sep 12 '18 at 08:59
  • I have solved it using javascript to perform http requests. – Nana Sep 12 '18 at 10:58

0 Answers0