The following comment has been added to this issue:

     Author: Keith Garry Boyce
    Created: Wed, 3 Nov 2004 6:16 PM
       Body:
As stated I think you have to change your test case to use the 11 tld.

Yes everything works except for multi table sorting in Dynamo.


And with my tableId hack that works too. So why don't you just add tableId as I did 
for app servers where id cannot be dynamic?
---------------------------------------------------------------------
View this comment:
  http://jira.codehaus.org/browse/DISPL-56?page=comments#action_26048

---------------------------------------------------------------------
View the issue:
  http://jira.codehaus.org/browse/DISPL-56

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: DISPL-56
    Summary: unable to dinamically generate multiple tables on the same page with 
indipendent sorting (different id)
       Type: Bug

     Status: Resolved
   Priority: Major
 Resolution: FIXED

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: DisplayTag
 Components: 
             Container Compability
   Fix Fors:
             1.0 RC2
   Versions:
             1.0 RC1

   Assignee: fabrizio giustina
   Reporter: Keith Garry Boyce

    Created: Sun, 10 Oct 2004 7:48 AM
    Updated: Wed, 3 Nov 2004 6:16 PM

Description:
If I pass id in as <%= string %> value I get classcast exception
The code below with varying name also doesn't work. I sent this also to you guys 
because my mail in the past hasn't got onto forum.

Thanks,
Garry
Here is an example of the problem (below is a workaround but you probably have better 
one):

<%@ taglib uri="http://displaytag.sf.net"; prefix="display" %>
<%@ page import="java.util.List" %>
<%@ page import="java.util.ArrayList" %>
<html>
<body>
test
<%!
  public class ValueBean {
        public ValueBean(String value) {
                this.value=value;
        }
        private String value;
        public String getValue() {
                return this.value;
        }
  }
%>
<%
  List theList = new ArrayList();
  theList.add(new ValueBean("1"));
  theList.add(new ValueBean("2"));
  theList.add(new ValueBean("3"));

  for (int i=0;i<3;i++) {

        request.setAttribute("row" + String.valueOf(i),new ArrayList(theList));
%>

                <display:table class="disp"

                               id="row"
                               name="<%= "row" + String.valueOf(i) %>"
                               sort="list" >
                      <display:column property="value" sortable="true"/>
            </display:table>
<% } %>
</body>
</html>


Workaround:
have anonther attribute called tableId. I'm using reflection code for visibility 
issues.
/*
 * TableTag2.java
 * 
 * Copyright 2004 by Electronic Data Systems
 * Corporation. All rights reserved.
 *
 * An unpublished work created Aug 5, 2004, 2004. This work is a
 * trade secret of EDS and unauthorized use or copying
 * is prohibited.
 * 
 */
package org.displaytag.tags;

import java.lang.reflect.Field;

import org.displaytag.util.ParamEncoder;

/**
 * @author jztb88
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class TableTag2 extends TableTag {
        
        private String tableId;
        
        /**
         * @return Returns the tableId.
         */
        public String getTableId() {
                return tableId;
        }
        
        /**
         * @param tableId The tableId to set.
         */
        public void setTableId(String tableId) {

                try {
                        Field fld = TableTag.class.getDeclaredField("paramEncoder");
                        fld.setAccessible(true);
                        if (fld.get(this) == null) {
                                fld.set(this,new ParamEncoder(this.id + this.tableId));
                        }
                } catch (SecurityException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                } catch (NoSuchFieldException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                } catch (IllegalArgumentException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                } catch (IllegalAccessException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
                this.tableId = tableId;
                

        }
        

        
}



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
displaytag-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to