%@ include file="../imports.jsp"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.Collection"%>
<%@page import="java.util.Map"%>
<%@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.util.Maps"%>
<%@page import="org.openxava.web.Actions"%>
<%@page import="org.openxava.util.XavaPreferences"%>
<%@page import="org.openxava.view.View"%>
<%@page import="org.openxava.model.meta.MetaProperty"%>
<%@page import="org.openxava.model.meta.MetaReference"%>
<%@page import="org.openxava.web.DescriptionsLists"%>
<%@page import="org.openxava.web.WebEditors"%>
| width="5"/> <% } %> <% // 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"; MetaReference ref = null; if (p.getName().contains(".")) { String refName = org.openxava.util.Strings.noLastTokenWithoutLastDelim(p.getName(), "."); ref = subview.getMetaReference(refName); } String headerId = ""; String dataDefaultValue = ""; if (p.hasNotDependentDefaultValueCalculator() || ref != null && ref.hasNotDependentDefaultValueCalculator()) { Object defaultValue = null; String propertyId = null; if (ref != null && subview.displayAsDescriptionsList(ref) && ref.getMetaModelReferenced().getAllKeyPropertiesNames().size() > 1) { java.util.Map refValues = subview.getSubview(ref.getName()).getValues(); defaultValue = p.getMetaModel().toString(refValues); propertyId = ref.getName() + DescriptionsLists.COMPOSITE_KEY_SUFFIX; } else { if (ref != null && subview.displayAsDescriptionsList(ref) && !p.isKey()) { MetaProperty key = (MetaProperty) p.getMetaModel().getMetaPropertiesKey().iterator().next(); p = key.cloneMetaProperty(); p.setName(ref.getName() + "." + key.getName()); } if (org.openxava.web.WebEditors.mustToFormat(p, subview.getViewName())) { Object value = subview.getDefaultValueInElementCollection(p.getName()); defaultValue = value==null?null:org.openxava.web.WebEditors.formatToStringOrArray(request, p, value, errors, subview.getViewName(), false); propertyId = p.getName(); } } if (defaultValue instanceof String) { // We don't support arrays by now dataDefaultValue = "data-default-value='" + defaultValue + "'"; String id = Ids.decorate(request, collectionName + ".H." + propertyId); headerId = "id='" + id + "'"; } } %> | <%=dataDefaultValue%> class=<%=style.getListHeaderCell()%> style="padding-right: 0px">
" style="overflow: hidden; <%=width%>" >
<%if (resizeColumns) {%>
|
<% if (ref != null && subview.isSearchForReference(ref) && subview.isLastSearchKey(p.getName())) { %>
<% } %> <% } %> |
|---|---|---|
<%} else { %>
<% String onclick="elementCollectionEditor.removeRow('" + app + "', '" + module + "', this, " + f + ", " + hasTotals + ")"; %>
<% if (style.isUseIconsInsteadOfImages()) { %>
<% } else { %>
<% } %>
<%} %>
|
<% } %>
<%
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 = style.getListCellStyle() + align;
int columnWidth = subview.getCollectionColumnWidth(columnIndex);
String width = columnWidth<0 || !resizeColumns?"":"width: " + columnWidth + "px";
String referenceName = null;
String searchAction = null;
if (p.getName().contains(".")) {
String refName = org.openxava.util.Strings.noLastTokenWithoutLastDelim(p.getName(), ".");
if (subview.displayAsDescriptionsList(subview.getMetaReference(refName))) {
referenceName = collectionName + "." + f + "." + refName;
}
else {
View refView = subview.getSubview(refName);
if (refView.isSearch()) searchAction = refView.getSearchAction();
}
}
String propertyName = collectionName + "." + f + "." + p.getName();
boolean throwPropertyChanged = subview.throwsPropertyChanged(p.getName());
Object fvalue = null;
if (!subview.isCollectionMembersEditables()) {
Object value = view.getValue(propertyName);
fvalue = org.openxava.web.WebEditors.formatToStringOrArray(request, p, value, errors, view.getViewName(), false);
}
%>
<% if (labelOnEachCell) { %> <%=p.getQualifiedLabel(request)%> <% } %> | <% if (searchAction != null && subview.isLastSearchKey(p.getName())) { %>
|
<% } %>
<%
}
}
%>