META-INF.resources.xava.sections.jsp Maven / Gradle / Ivy
<%@ include file="imports.jsp"%>
<%@page import="org.openxava.view.meta.MetaView"%>
<%@page import="org.openxava.view.View"%>
<%@ page import="org.openxava.web.Ids"%>
<%
String viewObject = request.getParameter("viewObject");
viewObject = (viewObject == null || viewObject.equals(""))?"xava_view":viewObject;
View view = (View) context.get(request, viewObject);
java.util.Collection sections = view.getSections();
int activeSection = view.getActiveSection();
%>
>
<%=style.getSectionBarStartDecoration()%>
<%
java.util.Iterator itSections = sections.iterator();
int i=0;
while (itSections.hasNext()) {
MetaView section = (MetaView) itSections.next();
View sectionView = view.getSectionView(i);
String sectionName = sectionView.getTitle().equals("") ? section.getLabel(request) : sectionView.getTitle();
String collectionCountLabel = sectionView.getLabelDecoration();
String labelId = Ids.decorate(request, "label_" + sectionView.getViewObject() + "_sectionName");
if (activeSection == i) {
%>
<%=style.getActiveSectionTabStartDecoration(i == 0, !itSections.hasNext())%>
<%=sectionName%>
'/>"><%=collectionCountLabel%>
<%=style.getActiveSectionTabEndDecoration()%>
<%
}
else {
%>
<%=style.getSectionTabStartDecoration(i == 0, !itSections.hasNext())%>
<%
String viewObjectArgv = "xava_view".equals(viewObject)?"":",viewObject=" + viewObject;
%>
<%=sectionName%>
'/>"><%=collectionCountLabel%>
<%=style.getSectionTabEndDecoration()%>
<%
}
i++;
}
%>
<%=style.getSectionBarEndDecoration()%>
">
<%
View sectionView = view.getSectionView(activeSection);
context.put(request, sectionView.getViewObject(), sectionView);
%>
<%
// END IF Not painter is in use
%>