I considered this solution, but I'm afraid my data-structure is a bit to
complicated, to do something like this (it's not as simple as I discribed -
there are some vectors involved and so on ;-) and in addition I shouldn't
solve the problem this way.

I had related problem with an datatable and checkboxes (instead of a
selectOneMenu) and I could solve this problem with a binding to UIData and
UISelectBoolean.
(You have this binding of your DataTable and you can iterate through its
rows and you can check with the UISelectBoolean in each row, if the checkbox
is checked or not)
I thougth I could solve my actual problem in a similiar way (binding to
UIData and UISelectOne or something like that) - but it doesn't work, like I
thought.

I would be glad, if anyone could explain, how to do this binding or how to
approach the problem in another way (the datatables model or something).

But if not, I'll try an approach as you proposed.

Thank you anyway!
----- Original Message ----- 
From: "Greg" <[EMAIL PROTECTED]>
To: "MyFaces Discussion" <[email protected]>
Sent: Monday, March 27, 2006 6:45 PM
Subject: Re: DataTable with SelectOneMenu


Thats the point isnt it ? i.e. at the moment you have a many to one
mapping, i.e. multiple instances of a select menu all mapping back to
one bean property.

I have a similiar problem too, in that the User objects are (ideally)
just provided to me, but as they stand they do not have a 'roleId'
property (or more succinctly a 'isSelected' property).

For quickness I actually added this property to each User object.

Since the alternative, as far as I'm aware at the moment, seems to be
to have an intermediate or decorative class object, where you iterate
over the given Users objects and create a new decorative class
instance for each User which will contain this roleId property and use
this new List of objects as the dataTable value binding, which isnt
very elegant but it would seem anything else would be even less
elegant.

Someone else might know of alternatives.

Reply via email to