And in general sets are not ordered, which doesn't make sense when displaying data in a table. Read-only tables would be odd, but implementing editable tables would be really nasty if the server-side data structure that the table corresponds to could return its data in any order.

The JSF spec explicitly lists what collections are supported for UIData, and Set is not one of them.

Cagatay Civici wrote:
Hi,

It's not supported by UIData, because sets are not indexed.

The workaround would be the wrapper you mentioned or a custom property resolver;

http://www.jroller.com/page/mert?entry=settolistpropresolver_for_jsf_el

Cagatay

On 1/14/07, *lightbulb432* < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:


    Can the value attribute of a h:dataTable be set to any Collection? I
    tried
    setting it to a Set (specifically, HashSet), but that gave trouble.
    To solve
    this, I added another property to the backing bean which simply
    wrapped that
    bean's Set in a List and used that as the value attribute, and then it
    worked fine!

    What is the reason that Sets/HashSets aren't allowed to be used? I
    sure hope
    there's a way to get it work, as many of my Collections are Sets and I
    wouldn't like to clutter my code with List wrappers just to make
    this work.
    --
    View this message in context:
    
http://www.nabble.com/Can-dataTable%27s-value-be-a-HashSet--tf2982099.html#a8329377

    Sent from the MyFaces - Users mailing list archive at Nabble.com
    <http://Nabble.com>.



Reply via email to