My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 172: Adding multiple columns without property defined will render samen content in every cell as last cell
1 person starred this issue and may be notified of changes. Back to list
Status:  New
Owner:  ----


 
Reported by wijngaa...@gmail.com, Dec 30, 2008
What steps will reproduce the problem?
1. Create a table with JMesa using tags (example included)
2. Make some table cells empty (do not define a property) for instance for
static content like action links.

What is the expected output? What do you see instead?
I expect different content in each cell, but the content in the last three
cells is the same (see the sample code)

What version of the product are you using? On what operating system?
2.3.4

Please provide any additional information below.

Sample JSP page:

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="nl.Data" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<%@ taglib prefix="jmesa" uri="/jmesa" %>

<%
    List list = new ArrayList();
    for(int i = 0 ; i < 10 ; i++) {
        Data data = new Data();
        data.setName("name");
        data.setValue1("value");
        data.setValue2("value");
        data.setValue3("value");
        list.add(data);
    }

    pageContext.setAttribute("list", list);
%>

<jmesa:tableFacade id="table" items="${pageScope.list}" var="item">
    <jmesa:htmlTable captionKey="table.caption">
        <jmesa:htmlRow>
            <jmesa:htmlColumn property="name"/>
            <jmesa:htmlColumn property="value1"/>
            <jmesa:htmlColumn property="value2"/>
            <jmesa:htmlColumn property="value3" filterable="false">
                <a href="/link_value3"><span>edit</span></a>
            </jmesa:htmlColumn>
            <jmesa:htmlColumn styleClass="tool edit" filterable="false">
                <a href="/link_3_edit"><span>edit</span></a>
            </jmesa:htmlColumn>
            <jmesa:htmlColumn styleClass="tool add" filterable="false">
                <a href="/link_3_add"><span>add</span></a>
            </jmesa:htmlColumn>
            <jmesa:htmlColumn styleClass="tool delete" filterable="false">
                <a href="/link_3_delete"><span>delete</span></a>
            </jmesa:htmlColumn>
        </jmesa:htmlRow>
    </jmesa:htmlTable>
</jmesa:tableFacade>


Sample data object:

public class Data
{   
    private String name;

    private String value1;
    private String value2;
    private String value3;

    public String getName()
    {
        return name;
    }

    public void setName(String name)
    {
        this.name = name;
    }

    public String getValue1()
    {
        return value1;
    }

    public void setValue1(String value1)
    {
        this.value1 = value1;
    }

    public String getValue2()
    {
        return value2;
    }

    public void setValue2(String value2)
    {
        this.value2 = value2;
    }

    public String getValue3()
    {
        return value3;
    }

    public void setValue3(String value3)
    {
        this.value3 = value3;
    }
}
Jan 6, 2009
Project Member #1 jeff.johnston.mn@gmail.com
Yes. This is a bug.

https://code.google.com/p/jmesa/issues/detail?id=79

What you can do is define a column and give it a made up name. For instance if you
have a column for checkboxes you can call the property chkbx, or whatever you want.
The important thing is the column properties are unique.

Powered by Google Project Hosting