You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Jens Halm <ml...@oregano-server.org> on 2006/09/01 14:17:59 UTC

Re: h:dataTable on an object containing a Set generated by Hibernate

> I'm ok with a patch that logs an error or throws an exception if the
> backing collection isn't ordered.   The issue has come up a number of
> times, and I think it'd be good if we made it easier for the end-user
> to understand what's happening.

But the problem is, that a Set is (formally) a valid value for UIData,
although in most cases it does not make sense. From the dataTable
docs:

value: An EL expression that specifies the data model that backs this
table. The value can be of any type. A value of type DataModel is used
directly. Array-like parameters of type java.util.List, array of
Object, java.sql.ResultSet, or javax.servlet.jsp.jstl.sql.Result are
wrapped in a DataModel. Other values are wrapped in a DataModel as
a single row.

The last sentence is the critical one: A Set is treated as "other
values" and displayed as a single row. Of course that does not make
sense it most cases, but throwing an exception would be against the
spec, I guess.

Jens




Re: h:dataTable on an object containing a Set generated by Hibernate

Posted by Mike Kienenberger <mk...@gmail.com>.
Good point.   Let's log a warning if it's a Set.   If I had more time,
I'd consider opening a spec issue on this for JSF 2.0.

On 9/1/06, Jens Halm <ml...@oregano-server.org> wrote:
>
> > I'm ok with a patch that logs an error or throws an exception if the
> > backing collection isn't ordered.   The issue has come up a number of
> > times, and I think it'd be good if we made it easier for the end-user
> > to understand what's happening.
>
> But the problem is, that a Set is (formally) a valid value for UIData,
> although in most cases it does not make sense. From the dataTable
> docs:
>
> value: An EL expression that specifies the data model that backs this
> table. The value can be of any type. A value of type DataModel is used
> directly. Array-like parameters of type java.util.List, array of
> Object, java.sql.ResultSet, or javax.servlet.jsp.jstl.sql.Result are
> wrapped in a DataModel. Other values are wrapped in a DataModel as
> a single row.
>
> The last sentence is the critical one: A Set is treated as "other
> values" and displayed as a single row. Of course that does not make
> sense it most cases, but throwing an exception would be against the
> spec, I guess.
>
> Jens
>
>
>
>