Uploaded image for project: 'PUBLIC - Liferay Faces'
  1. PUBLIC - Liferay Faces
  2. FACES-2516

when alloy:accordion/alloy:tabView iterate over a data model, alloy:tab children with rendered="false" still render headers

    Details

      Description

      {markdown}
      Steps to reproduce:

      1. Navigate to a page with the following code:{markdown}

      xhtml:

      <alloy:accordion value="#{bean.tabs}" var="tab"> <!-- or alloy:tabView -->
      	<alloy:tab headerText="#{tab.title}" rendered="#{tab.index != 1}">
      		content
      	</alloy:tab>
      </alloy:accordion>
      

      java:

      List<Tab> tabs;
      
      public Bean() {
      
      	tabs = new ArrayList<Tab>();
      	tabs.add(new Tab("ASDF", 0));
      	tabs.add(new Tab("QWER", 1));
      	tabs.add(new Tab("ZXCV", 2));
      }
      
      public List<Tab> getTabs() {
      	return tabs;
      }
      
      public class Tab {
      	String title;
      	int index;
      
      	public Tab(String title, int index) {
      		this.title = title;
      		this.index = index;
      	}
      
      	public String getTitle() {
      		return title;
      	}
      
      	public int getIndex() {
      		return index;
      	}
      }
      
      {markdown}
      If the bug still exists, the header for the second tab (`tab.index == 1`) will still be shown. If you click it, its content will not appear.

      Expected Result:
      The tab's header and content should not appear. It should work the same way that [the non-iterative use case](http://liferayfaces.org/web/guest/showcase/-/component/alloy/tabview/dynamic-tabs) does.

      Known Workarounds:

      - [Remove the tab's data from the data model in the backing bean instead of using the rendered attribute.](https://www.liferay.com/community/forums/-/message_boards/view_message/63642473)
      - Avoid `value`/`var` (i.e. [avoid using a data model and statically declare tabs](http://liferayfaces.org/web/guest/showcase/-/component/alloy/accordion/general)) and use the `rendered` attribute.{markdown}

        Attachments

          Activity

            People

            Assignee:
            kyle.stiemann Kyle Stiemann (Inactive)
            Reporter:
            kyle.stiemann Kyle Stiemann (Inactive)
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Packages

                Version Package
                alloy-2.0.0
                alloy-3.0.0