On 19 October 2015 at 15:26, Cesar Lugo <cesar.l...@sisorg.com.mx> wrote:
> 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. sure > 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). ok > 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? yes.... create your subclass, register via META-INF/services. > 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. > > yes, the ComponentFactory API is used for every aspect of the generated UI, from a single property or action parameter all the way up to a complete rendering of an object. The ComponentType enum lists the different sorts of components that are created. Have a play, perhaps put some code on a github repo, if you get stuck then yell and we can try to assist. Cheers Dan > Cesar. > > -----Original Message----- > From: Dan Haywood [mailto:d...@haywood-associates.co.uk] > Sent: Saturday, October 17, 2015 5:06 AM > To: users > Subject: Re: Image lists > > On 16 October 2015 at 15:51, Cesar Lugo <cesar.l...@sisorg.com.mx> 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 > >