0

I am trying to make an accordion panel mix dymanic and static tabs, to no success so far.

Using Java 7.x, Primefaces 6.1, JSF 2.2 running on tomcat 7.x

My sample code is:

<p:accordionPanel value="#{bean.listStuff} var="foo">
    <p:tab title="#{foo.title}>
    (...)
    </p:tab>

    <p:tab title="static tab">
    (...)
    </p:tab>
</p:accordionPanel>

Tried with ui:repeat also with no success.

<p:accordionPanel>
    <ui:repeat value="#{bean.listStuff} var="foo">
        <p:tab title="#{foo.title}>
        (...)
        </p:tab>
    </ui:repeat>

    <p:tab title="static tab">
    (...)
    </p:tab>
</p:accordionPanel>

There is this related question: https://stackoverflow.com/a/8901945/1532705 - but it uses PF 3.0 (and is from 2010) and is for tabview (maybe it only differs from accordionPanel on the renderer part).

Also this other: https://stackoverflow.com/a/28960242/1532705 recommends using a <c:forEach> but then I can't change the tabs via AJAX.

This issue is marked closed on the project: https://github.com/primefaces/primefaces/issues/32 without being resolved, so it might not even be supported by PF.

Is there a way to mix static and dynamic tabs on an accordionPanel?

Mindwin Remember Monica
  • 1,469
  • 2
  • 20
  • 35
  • The issue you reference is open for me... – Kukeltje Jun 13 '17 at 22:01
  • Are you bound on using only one `accordionPanel` for both dynamic and static `tabs`? If not, you can use two `accordionPanel`(one for dynamic/one for static). – Tonkichi Jun 14 '17 at 07:56
  • @Kukeltje *"cagataycivici referenced this issue Sep 22, 2015 Closed "* - there is a red "closed" icon next to this entry. Maybe it references issue #671 but the fact is it is sitting there for 2 years. with no updates. – Mindwin Remember Monica Jun 14 '17 at 13:00
  • @Tonkichi how would you synch the behaviour of both panels? – Mindwin Remember Monica Jun 14 '17 at 13:03
  • No, the **other** issue is closed, and did you read why the **other** issue is closed? – Kukeltje Jun 14 '17 at 13:05
  • @Kukeltje yeah, that is why I said *maybe it references issue #671* - fact stands that the issue has not been assigned/updated/worked on, so probably it is not supported. – Mindwin Remember Monica Jun 14 '17 at 13:17
  • Issue #671 references #32 (or in other words, the ones used in github, #32 is referenced in #671). And yes, #671 is closed on, there is no work done on #32. It requires a fair amount of changes that might cause breaking backwards compatibility. If you are a decent programmer, you can implement it yourself for your version – Kukeltje Jun 14 '17 at 13:24

0 Answers0