myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Kienenberger" <mkien...@gmail.com>
Subject Re: Binding to elements in DataTable
Date Wed, 02 Aug 2006 18:41:34 GMT
On 8/2/06, David Van Stone <dvs@head.cfa.harvard.edu> wrote:
> I'm struggling to create a binding to a UIInput element in a DataTable row.
> (Context: I'm trying to do validation across multiple fields in the same
> row.)
>
> I have a backing bean for the main page (PlayBB; managed-bean-scope:
> "session") which contains a List of backing beans for each row (NameBB;
> managed-bean-scope: "none"). I've observed (through logging) that the
> binding occurs exactly once per page and not once per row as I had expected.
>
> Can one not bind to elements in a row? Do I need to bind the entire table
> instead and  traverse the elements to do validation?

No, this is expected behavior.   Your UIInput only exists once, but it
has as many states as rows in the table.   This is where you need to
call UIData.setRowIndex(row) in order to put the UIInput into the
correct state.   Normally this state is already correct if you're in
the middle of something that's iterating through rows (like an action
being executed or a UIInput component being
converted/validated/rendered).

-Mike

Mime
View raw message