That's a novel approach that I wouldn't have thought of.
I also think that it wouldn't be too bad to wrap the bean in a decorator class, as
Jazir suggested, except for the small overhead of creating a wrapper for each instance in
your collection.
For myself, I went low-budget and just added a "selected" attribute to the
domain object. While this in an old anti-pattern (failing to decouple your business logic
from your UI logic), I've begun to have more tolerance for that in recent years,
probably due to the easy refactoring capabilities of Eclipse. That is, most patterns like
that exist for a couple of reasons: (1) avoid having to change too much code when the UI
changes, and (2) allowing you to reuse your business objects in multiple UI
implementations. We all got excited at the prospect of #2 several years ago, but after
about 10 years of Java development, I have actually never had more than one UI for an
application. I guess I've led a sheltered life.
Anyway, now I don't worry too much about that sort of thing, and Seam certainly makes
it easy to violate a few (hopefully outdated) patterns like this.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3979666#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...