Re: How can I encapsulate similar behavior yet varying markup?

2011-07-07 Thread Igor Vaynberg
a) class mypanel extends panel { mypanel () { add(new listview() { onpopulateitem(item) { mypanel.this.onpopulateitem(): }{}); } protected abstract onpopulateitem(item); } b) instead of trying to encapsulate both the listview and the button in the component make a reusable button class

How can I encapsulate similar behavior yet varying markup?

2011-07-07 Thread T P D
I want to add several "collapsable" ListViews: a listview paired with a button to toggle showing either the full list or the fist N elements. But each listview's populateItem and corresponding markup will be different. If I write a Wicket Panel, I'm not only "locked-in" to one set of markup. I