use of com.liferay.faces.alloy.component.tab.internal.DataEncoderTabImpl in project liferay-faces-alloy by liferay.
the class TabViewRenderer method encodeChildren.
@Override
public void encodeChildren(FacesContext facesContext, UIComponent uiComponent) throws IOException {
// Get the "value" and "var" attributes of the TabView component and determine if iteration should take place
// using a prototype child tab.
TabView tabView = (TabView) uiComponent;
Integer selectedIndex = tabView.getSelectedIndex();
boolean iterateOverDataModel = DataEncoderBase.isIterateOverDataModel(tabView);
// Encode the starting <ul> unordered list element that represents the list of clickable tabs.
ResponseWriter responseWriter = facesContext.getResponseWriter();
responseWriter.startElement("ul", tabView);
responseWriter.writeAttribute("class", "nav nav-tabs", null);
DataEncoderBase dataEncoder = new DataEncoderTabHeaderImpl(selectedIndex);
dataEncoder.encodeColumns(facesContext, tabView, iterateOverDataModel);
responseWriter.endElement("ul");
// Encode the starting <div> element that represents the content for the selected tab.
responseWriter.startElement("div", uiComponent);
responseWriter.writeAttribute("class", "tab-content", null);
// Encode the content for each tab.
dataEncoder = new DataEncoderTabImpl();
dataEncoder.encodeColumns(facesContext, tabView, iterateOverDataModel);
tabView.setRowIndex(-1);
// Encode the closing </div> element for the content.
responseWriter.endElement("div");
}
Aggregations