In our application we have several places where we are construction an
html table but the content of the rows varies by ProductType. For
example:
column 1. always an image
column 2. the pricing: for hotels by room, for shows by ticket, for
limo by hours
column 3. item summary: for hotels the rooms/nights, for shows the
seats and show time, etc
column 4. the total
There is a natural class hierarchy here where we have
AbstractItem
HotelItem
ShowItem
LimoItem
I'd like to have a comparable hierarchy of perhaps "RepeaterRow"
objects that could have methods such as:
AbstractItemRow
protected abstract Panel getPricingPanel();
protected abstract Panel getSummaryPanel();
I've gotten this working with a ListView, but I'm doing things like:
populateItem(ListItem listItem) {
final AbstractItem cartItem = (AbstractItem)listItem.getModelObject();
add(CartPanelFactory.getPricingPanel(cartItem));
add(CartPanelFactory.getSummaryPanel(cartItem));
}
Is there a cleaner way than delegating this decision about which Panel
I need to a factory?
Thank you,
Scott
--
Scott Swank
reformed mathematician
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user