incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmatth...@apache.org
Subject svn commit: r1354704 - /incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableView.java
Date Wed, 27 Jun 2012 20:11:44 GMT
Author: rmatthews
Date: Wed Jun 27 20:11:43 2012
New Revision: 1354704

URL: http://svn.apache.org/viewvc?rev=1354704&view=rev
Log:
ISIS-162 - Fixed problem with displaying tables in long-form elements where a non-empty long-element
would fail if tables where needed.

Modified:
    incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableView.java

Modified: incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableView.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableView.java?rev=1354704&r1=1354703&r2=1354704&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableView.java
(original)
+++ incubator/isis/trunk/framework/viewer/scimpi/scimpi-dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableView.java
Wed Jun 27 20:11:43 2012
@@ -255,15 +255,27 @@ public class TableView extends AbstractT
 
     public static void write(final Request request, final String summary, final ObjectAdapter
object, final ObjectAssociation field, final ObjectAdapter collection, final int noColumns,
final List<ObjectAssociation> fields, final boolean linkAllFields, final boolean showIconByDefault,
             final String tableClass, final String[] rowClasses) {
-        final boolean[] linkFields = new boolean[noColumns];
+        final LinkedObject[] linkedFields = new LinkedObject[fields.size()];
         if (linkAllFields) {
-            for (int i = 0; i < linkFields.length; i++) {
-                linkFields[i] = fields.get(i).isOneToOneAssociation();
+            for (int i = 0; i < linkedFields.length; i++) {
+                if (fields.get(i).isOneToOneAssociation()) {
+                    linkedFields[i] = new LinkedObject("_generic.shtml");
+                }
             }
         }
+        
+        final String headers[] = new String[fields.size()];
+        int h = 0;
+        for (int i = 0; i < fields.size(); i++) {
+            if (fields.get(i).isOneToManyAssociation()) {
+                continue;
+            }
+            headers[h++] = fields.get(i).getName();
+        }
+        
         final RequestContext context = request.getContext();
         final TableContentWriter rowBuilder = rowBuilder(request, context, null, context.mapObject(object,
Scope.REQUEST), field.getId(), fields, showIconByDefault);
-        write(request, collection, summary, rowBuilder, tableClass, rowClasses);
+        write(request, collection, summary, rowBuilder, null, null);
     }
 
     @Override



Mime
View raw message