I have DropDownChoice objects where I want the choices model to be sorted. The choices come from a database (using a HibernateListModel from databinder) but I am unable to perform the sort on the database side, it must be done on the server after the results are returned (due to the nature of the sort function). Previously, I had extended the HibernateListModel to make a SortableHibernateListModel, which worked very well. However, That style of adding features gets cumbersome as you try to add new features in. For instance, next was a FilterableHibernateListModel (that also wanted to sort).
So, I tried another approach whereby I would chain the operations together. So, I created a SortingModel that implements the IChainingModel interface and then stuck the HibernateListModel inside of it. And that still worked. But, in another place, the model that I put into the SortingModel (IChainingModel) is an impl of IComponentAssignedModel. The problem is that when assigning choices to a DropDownChoice, it calls Component.wrap which specifically looks for IComponentAssignedModel models, and if found, calls wrapOnAssignment(). However, in my case, wrap will see the SortingModel not the IComponentAssignedModel and therefore not operate as it did previosuly. I'm looking for some feedback here... Should wrap() be updated to traverse the IChainingModel chain until it finds an IComponentAssignedModel or exhausts the chain? Should I find a different method of adding sort capabilities on top of a Model? What other options do I have? Thanks, Chuck -- View this message in context: http://www.nabble.com/Component.wrap-and-IChainingModel-tf4759201.html#a13610128 Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]