The following comment has been added to this issue: Author: Keith Garry Boyce Created: Tue, 16 Nov 2004 5:48 PM Body: Before my code used to be
id="row" tableId="<%= tableRow %>" and in the iteration I used to have <display:column title="" media="html"> <a href="" onclick="openPopup('updateOptionPre?<%= DataConstants.ENTRY_ID %>=<%=((ProductTypeOptionXref) row).getId().getProductOption().getId()%>');return false;" ><img src="<%=request.getContextPath()%>/en_US/images/UpdateButton8.gif" border="0"/></a> </display:column> When I just changed tableId to uid I got an NullPointer error. If I removed id I got that "row" was not defined. So I changed row to pageContext.getAttribute("tableRow") then everything worked as expected. Need clarification as to why I got null pointer in the first place? Also in an iteration I had code like below. Without id how would I represent row_rowNum.intValue() <% String column1 = LinkCovPkgCodeForm.COVERAGE_PKG_CODE + "(" + (row_rowNum.intValue() - 1) + ")"; String column2 = LinkCovPkgCodeForm.EFFECTIVE_DATE + "(" + (row_rowNum.intValue() - 1) + ")"; String column3 = LinkCovPkgCodeForm.END_DATE + "(" + (row_rowNum.intValue() - 1) + ")"; %> <display:column title="Coverage Package Code"><bean:write name="LinkCovPkgCodeForm" property="<%= column1 %>"/></display:column> <display:column title="CPC Effective Date"><bean:write name="LinkCovPkgCodeForm" property="<%= column2 %>"/></display:column> <display:column title="CPC End Date"><bean:write name="LinkCovPkgCodeForm" property="<%= column3 %>"/></display:column> --------------------------------------------------------------------- View this comment: http://jira.codehaus.org/browse/DISPL-56?page=comments#action_26496 --------------------------------------------------------------------- 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: Tue, 16 Nov 2004 5:48 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: InterSystems CACHE FREE OODBMS DOWNLOAD - A multidimensional database that combines robust object and relational technologies, making it a perfect match for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 _______________________________________________ displaytag-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/displaytag-devel