Thank you Dan. I understand that those components you are giving me as a sample are generic ones, such as gmap3 and fullcalendar2 Apache Isis components, which apply in general to all classes automatically. It's great that the viewer is extensible in such a generic way too, and I will take a look at the guide you are pointing me to, thank you for that. Right now, I think that a more specific alternative is what I could use, if possible, to be able to define an object form layout that would be specific to certain class, like an Item object form displaying the Item's images, or a Vendor for showing a collection of items with the associated images, or a shopping cart object showing the list of items with the associated Item's main image, form for example (so each could have different needs regarding how to display an image). So, would it be possible to extend the EntityCombinedPanelFactory class within my Item, Vendor or ShoppingCart classes (or the corresponding classes the viewer might use for those), and extend some methods to override or add the functionality I need? I am also thinking that this approach could be useful not only to accommodate my Image needs, but could be used to customize the forms in some few cases where specific custom functionality is needed, extending or overriding only what you need to, and still re-using the generic form created by EntityCombinedPanelFactory, by using inheritance and extensibility / override java features.
Cesar. -----Original Message----- From: Dan Haywood [mailto:[email protected]] Sent: Saturday, October 17, 2015 5:06 AM To: users Subject: Re: Image lists On 16 October 2015 at 15:51, Cesar Lugo <[email protected]> wrote: > Hello. > > > > Is there a way to display a list or collection of images (with or > without associated fields) on the Wicket Viewer? the short answer is no, this isn't built in. But the Wicket UI viewer is flexible enough to allow this functionality, in the same way that the gmap3 and fullcalendar2 plugins work. In fact, this feature did exist, in crude form, in an earlier version of the Wicket UI, and I see that the code hasn't actually been removed (there's a TODO from martin-g noting that the class is unused). It ought to be possible to resurrect this, and bring in the wicket component that we already have for displaying images. If you want to have a go at implementing this, here's some pointers: the theory: * http://isis.apache.org/guides/ug.html#_ug_extending_wicket-viewer_replacing-page-elements how this is done by the gmap3 component: * https://github.com/isisaddons/isis-wicket-gmap3/blob/master/cpt/src/main/java/META-INF/services/org.apache.isis.viewer.wicket.ui.ComponentFactory * https://github.com/isisaddons/isis-wicket-gmap3/blob/master/cpt/src/main/java/org/isisaddons/wicket/gmap3/cpt/ui/CollectionOfEntitiesAsLocatablesFactory.java#L52 * https://github.com/isisaddons/isis-wicket-gmap3/blob/master/cpt/src/main/java/org/isisaddons/wicket/gmap3/cpt/ui/CollectionOfEntitiesAsLocatablesFactory.java#L98 // the unused code * https://github.com/apache/isis/blob/master/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/collectioncontents/icons/CollectionContentsAsIconsPanelFactory.java // the Blob component that renders Blob as an image * https://github.com/apache/isis/blob/master/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/isisapplib/IsisBlobPanel.java > And / or display an image in other > places than the corresponding object form? . > > No, but you could, if you want, define a custom component for entity page for a particular type of object and render whatever you want in there. The EntityCombinedPanelFactory is the factory that is used by default for all entities, so register another implementation for the ComponentType.ENTITY for your particular object. HTH Dan https://github.com/apache/isis/blob/master/core/viewer-wicket-ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/entity/combined/EntityCombinedPanelFactory.java > > > Cesar. > > > > > > --- > This email has been checked for viruses by Avast antivirus software. > https://www.avast.com/antivirus > --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
