You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Mike Kienenberger <mk...@gmail.com> on 2006/03/16 18:18:14 UTC

Re: t:dataTable and rowId

[Cross-posting to myfaces-dev to insure the problem with generic
attributes and non-jsp viewhandlers receives visibility]

On 3/15/06, Bjoern Mehner <Bj...@icw.de> wrote:
> I want to set the id attribute on every row of a table. If I read the docu
> right the rowId attribute of t:dataTable should do exactly that. But there
> is no id rendered no matter what I put in rowId="" (tried several
> different things). I thought the following syntax should be right:
>
> The logs show:
>
> Property 'rowId' is not on type:
> org.apache.myfaces.component.html.ext.HtmlDataTable
>
> Waht am I doing wrong?
>
> I am using myfaces-all-1.1.1, facelets-1.0.12, tomcat-5.5.9.

Well, unfortunately, rowId is one of three attributes that were not
implemented with best practices for supporting alternate view
handlers, and were implemented as generic attributes rather than
properties on the component itself.

    // dataTable (extended) attributes
    String ROW_ID                      = "org.apache.myfaces.dataTable.ROW_ID";
    String ROW_STYLECLASS_ATTR         =
"org.apache.myfaces.dataTable.ROW_STYLECLASS";
    String ROW_STYLE_ATTR              =
"org.apache.myfaces.dataTable.ROW_STYLE";

There's an old myfaces-dev thread dealing with this issue.

tree2 and JFSAttr org.apache.myfaces.tree2.* attributes (MYFACES-760)
http://mail-archives.apache.org/mod_mbox/myfaces-dev/200511.mbox/%3C8f985b960511231424g322e05c3k9c77933841808536@mail.gmail.com%3E


As a workaround, I think you can use
org.apache.myfaces.dataTable.ROW_ID="#{index}" to assign the value.

Another workaround is to implement a Facelets component handler that
aliases  rowId to org.apache.myfaces.dataTable.ROW_ID.  See this url: 
https://facelets.dev.java.net/nonav/docs/dev/docbook.html#dev-meta-component

You should probably open an JIRA issue on this so we remember to fix
this directly on t:dataTable.

There's a similar issue open for Tree2 which you could use as a
guideline for creating a patch if you were so inclined.

http://issues.apache.org/jira/browse/TOMAHAWK-47