On 8/2/06, David Van Stone <[EMAIL PROTECTED]> 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