Hi,

In Apache Isis 1.11.x we replaced the collection contents component so we could use another kind of repeating view [1] depending on the entity type contained in a collection.

In 1.12.x it looks like the EntityCollectionPanel isn't created by a (overrideable) factory anymore but is created by a direct call for the constructor of the EntityCollectionPanel in the Col-class. To get the same results as we had before, we now have to do something like this in the buildGui()-method of Col (after copying the class to our webapp):

for(CollectionLayoutData collection : collections) {

    finalString id = collectionRv.newChildId();
    finalEntityModel entityModelWithHints = 
getModel().cloneWithLayoutMetadata(collection);


    if(entityModelWithHints.getObject().getObject()instanceofSearchResultsPage) 
{
        finalSearchResultsCollectionContentsPanel collectionPanel 
=newSearchResultsCollectionContentsPanel(id, entityModelWithHints);
        collectionRv.add(collectionPanel);
    }
    else
    {
        finalEntityCollectionPanel collectionPanel 
=newEntityCollectionPanel(id, entityModelWithHints);
        collectionRv.add(collectionPanel);
    }
}

Is this the only way to do this (right now) or is there some more dynamic way?

Thanks,
Erik

[1] https://imgur.com/KcQ2Qlo

Reply via email to