Actually, I just figured setRowIndex is abstract so I don't think I can
force synchronization, so I'm screwed... I need your imagination there guys.


~ Simon

On Sun, Oct 19, 2008 at 10:33 AM, Simon Lessard
<[EMAIL PROTECTED]>wrote:

> Hi all,
>
> JSF 2.0 make DataModel implements Iterable. It's great, but implies adding
> an iterator() method to DataModel and achieving that isn't all that great. I
> see 3 ways:
>
> 1. Loops through all the row data and place it in an internal collection
> for the iterator to use. I don't think that solution is viable as it prevent
> lazy loading that could be used in some implementations.
> 2. Link the iterator to the model so that it use getRowCount, setRowIndex
> and getRowData method. This method look good, but since looping alter the
> row index, I see some potential thread safety issues. So that solution imply
> making setRowIndex synchronized and have Iterator.next synchronize on the
> model before extract the next value.
> 3. Ask the EG to add DataModel.getRowData(int index) to DataModel class.
>
> I like 3, but will implement 2 until I can corrupt the EG into adding the
> method. But first, does anyone see something I'm not?
>
>
> Regards,
>
> ~ Simon
>

Reply via email to