[jsr-314-open] <h:dataTable> binding vs. ui:repeat

Lincoln Baxter, III lincolnbaxter at gmail.com
Mon Aug 3 15:54:49 EDT 2009


So here's one of those, "why is this different than that?" questions:

Unless I'm mistaken, ui:repeat is not a component and therefore cannot
be bound to a backing bean, but -- would it make sense to support
something *like* <h:dataTable> in order to support determining the
selected row on action events and value change events? A component that
would privide a bindable DataModel / List<Object> row access like
<h:dataTable>?

My use case is this:

        * Managed Bean contains a List of objects
        * Each object rendered to screen with input field
        * User submits the input field (with a command link or button,
        etc)
        * ManagedBean needs to take action on the appropriate row values


I have a list of objects - I need to render them onto the screen (not
necessarily in an HTML table, maybe a <ul> would be nicer) but I can't
use <ui:repeat> because each row has a commandLink, and I need to be
able to determine which row the user clicked on in order to take the
appropriate action.

EL2 helps with this, but... now what if I have a ValueChangeEvent for an
input field on each <li> row? Now I can no longer use EL2 to pass the
row into the ValueChangeListener, and I would have to use something like
<f:setPropertyActionListener> which is not only getting increasingly
complicated, but I'd also have to set an attribute insidethe VCL itself,
or in a bean VCL knows about - then referencing it - which is terribly
ugly. Now try to fit all that into a composite component and it gets
really ugly to try attaching tons of VCLs or ALs or SPALs to values
inside the component.

Am I attacking this problem in the wrong way? Is this one of those
things that has an easy solution I'm not seeing? Or is this a genuine
gap?

--Lincoln


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jsr-314-open-mirror/attachments/20090803/23b14de3/attachment.html 


More information about the jsr-314-open-mirror mailing list