0

I use primefaces version 5.3 and jsf version 2.2.6.

I implemented a tabClose ajax event for a tabview, but the problem is that for the first tab, the tabClose event isn't triggered and the method remove isn't called, for all the other tabs, it is and it works and I can't understand why. Additionally, if I try to close the first tab, all the tabs are closed.

The code looks like this:

<p:tabView id="tabs" activeIndex="#{mainPage.index}">
        <p:ajax event="tabClose" listener="#{mainPage.remove}" update="formTabs" />
        <p:ajax event="tabChange" listener="#{mainPage.changeTab}" update="formTabs" />

        <c:forEach items="#{mainPage.tabs}" var="tab" varStatus="loop">
            <p:tab title="#{tab.title}" closable="true">
                <f:subview id="tab#{loop.index}">
                <ui:debug />
                    <ui:include src="#{tab.url}">
                        <ui:param name="focusedTab" value="#{tab.id}" />
                    </ui:include>
                </f:subview>
            </p:tab>
        </c:forEach>
    </p:tabView>

Does anybody know what the cause could be?

uzzi
  • 551
  • 2
  • 9
  • 29
  • I implemented that at first, but the problem was as described in the following [link](http://stackoverflow.com/questions/20111010/jsf-dynamically-include-src-in-uiinclude-src-bean-pagepath) and then I used what you said in there. – uzzi Mar 30 '16 at 13:52
  • Primefaces version 5.3 – uzzi Mar 30 '16 at 13:54
  • 1
    http://forum.primefaces.org/viewtopic.php?f=3&t=44985&p=140737#p140737 – Kukeltje Mar 30 '16 at 20:59
  • http://forum.primefaces.org/viewtopic.php?f=3&t=44985&p=140762#p140762 – uzzi Mar 31 '16 at 13:22

1 Answers1

0

The above explained problem was solved by adding dynamic="true" in the tabView. But after that it appeared another obstacle, when the switch between tabs was made, all the tabs disappeared. That was solved by adding cache="false"

uzzi
  • 551
  • 2
  • 9
  • 29