<%@ include file="imports.jsp"%> <%@page import="org.openxava.controller.meta.MetaAction"%> <%@page import="org.openxava.web.Ids"%> <%@page import="org.openxava.controller.meta.MetaControllers"%> <%@page import="org.openxava.util.Is"%> <%@page import="org.openxava.web.Actions"%> <%@page import="org.openxava.util.XavaPreferences"%> <% String tabObject = request.getParameter("tabObject"); tabObject = (tabObject == null || tabObject.equals(""))?"xava_tab":tabObject; String onSelectCollectionElementAction = subview.getOnSelectCollectionElementAction(); String selectedRowStyle = style.getSelectedRowStyle(); String rowStyle = "border-bottom: 1px solid;"; MetaAction onSelectCollectionElementMetaAction = Is.empty(onSelectCollectionElementAction) ? null : MetaControllers.getMetaAction(onSelectCollectionElementAction); boolean resizeColumns = style.allowsResizeColumns() && XavaPreferences.getInstance().isResizeColumns(); String browser = request.getHeader("user-agent"); boolean scrollSupported = !(browser != null && (browser.indexOf("MSIE 6") >= 0 || browser.indexOf("MSIE 7") >= 0)); String styleOverflow = org.openxava.web.Lists.getOverflow(browser, subview.getMetaPropertiesList()); boolean sortable = subview.isCollectionSortable(); %> <% if (resizeColumns && scrollSupported) { %>
<% } %> style="<%=style.getListStyle()%>"> <% if (sortable) { %><% } %> <% if (lineAction != null) { %> <% } %> <% // Heading Iterator it = subview.getMetaPropertiesList().iterator(); for (int columnIndex=0; it.hasNext(); columnIndex++) { MetaProperty p = (MetaProperty) it.next(); String label = p.getQualifiedLabel(request); int columnWidth = subview.getCollectionColumnWidth(columnIndex); String width = columnWidth<0 || !resizeColumns?"":"width: " + columnWidth + "px"; %> <% } %> <% // Values Collection aggregates = subview.getCollectionValues(); if (aggregates == null) aggregates = java.util.Collections.EMPTY_LIST; Iterator itAggregates = aggregates.iterator(); for (int f=0; itAggregates.hasNext(); f++) { Map row = (Map) itAggregates.next(); String cssClass=f%2==0?style.getListPair():style.getListOdd(); String cssCellClass=f%2==0?style.getListPairCell():style.getListOddCell(); String selectedClass = ""; if (f == subview.getCollectionEditingRow()) { selectedClass = f%2==0?style.getListPairSelected():style.getListOddSelected(); cssClass = cssClass + " " + selectedClass; if (style.isApplySelectedStyleToCellInList()) cssCellClass = cssCellClass + " " + selectedClass; } String idRow = Ids.decorate(request, propertyPrefix) + f; String events=f%2==0?style.getListPairEvents():style.getListOddEvents(); %> style="border-bottom: 1px solid;"> <% if (lineAction != null) { %> <% } String actionOnClick = Actions.getActionOnClick( request.getParameter("application"), request.getParameter("module"), onSelectCollectionElementAction, f, viewName, idRow, selectedRowStyle, rowStyle, onSelectCollectionElementMetaAction, tabObject); %> <% it = subview.getMetaPropertiesList().iterator(); for (int columnIndex = 0; it.hasNext(); columnIndex++) { MetaProperty p = (MetaProperty) it.next(); String align =p.isNumber() && !p.hasValidValues()?"vertical-align: middle;text-align: right; ":"vertical-align: middle; "; String cellStyle = align + style.getListCellStyle(); int columnWidth = subview.getCollectionColumnWidth(columnIndex); String width = columnWidth<0 || !resizeColumns?"":"width: " + columnWidth + "px"; String fvalue = null; Object value = null; String propertyName = p.getName(); value = Maps.getValueFromQualifiedName(row, propertyName); fvalue = WebEditors.format(request, p, value, errors, view.getViewName(), true); Object title = WebEditors.formatTitle(request, p, value, errors, view.getViewName(), true); %> <% } } %> <% if (sortable) { %><% } %>
> width="5"> <% String actionOnClickAll = Actions.getActionOnClickAll( request.getParameter("application"), request.getParameter("module"), onSelectCollectionElementAction, idCollection, propertyPrefix, selectedRowStyle, rowStyle, tabObject); %> /> style="padding-right: 0px">
" style="overflow: hidden; <%=width%>" > <%if (resizeColumns) {%><%}%> <%=label%>  <%if (resizeColumns) {%><%}%>
<%if (sortable) { %> <%}%> <% if (style.isSeveralActionsPerRow()) for (java.util.Iterator itRowActions = subview.getRowActionsNames().iterator(); itRowActions.hasNext(); ) { String rowAction = (String) itRowActions.next(); %> <% } %> /> <% if (style.isRowLinkable()) { %>
<%if (resizeColumns) {%><%}%> <%=fvalue%>  <%if (resizeColumns) {%><%}%>
<% } else { %>
<%if (resizeColumns) {%><%}%> <%=fvalue%>  <%if (resizeColumns) {%><%}%>
<% } %>
<% if (resizeColumns && scrollSupported) { %>
<% } %>