Hi Hector, sorry, I thought I had replied to this, but seemingly not. I suggest you go with option #1, with the view that you can then raise a PR and merge in the change. If you want to go that approach then sketch out the change to the programming model: probably something like <fieldset defaultView="..."> similar to <collection defaultView="...">. I suggest that defaultView attribute takes the values of "properties" or "hide", with "properties" being assumed if the attribute is missing.
You are right that option #3 and option #2 are the same. The issue here - as you have figured out - is that the XxxFactory design only applies to metamodel elements - objects, properties, collections and actions - and there isn't any first class object in the metamodel to represent a FieldSet etc HTH Dan On Sat, 15 Apr 2017 at 04:23 Hector Fabio Meza <[email protected]> wrote: > Hi, > > I cloned the Isis git repository and took a look at the source code. I now > have a general idea of how the "hide" option works for tables, but I'm > having a hard time deciding what would be the best approach for adding this > behavior to fieldsets. > > I'm thinking of three possibilities: > > #1. Creating my own modified Isis version for internal use, with direct > modifications to FieldSet, PropertyGroup, etc. This sounds like the easier > option, but would give me trouble when the time comes to upgrade to new > versions of Isis. > > #2. Replacing components as described in [1]. This sounds like the cleaner > option, which would imply replacing the default implementations with my own > modified versions. Problem is PropertyGroup doesn't seem to have a Factory, > unlike for example EntityCollectionPanel which has one, so I'm not sure how > to proceed here. > > #3. Writing an add-on, similar to the collection views described in [2]. I > *think* this might be actually the same as #2 but packaged in a different > way, but I'm not sure about that. > > Am I on the right track with these ideas? Which one of these would you > recommend (if any?) > > Thank you. > > [1] > https://isis.apache.org/guides/ugvw/ugvw.html#_ugvw_extending_replacing-page-elements > > [2] > https://isis.apache.org/guides/ugvw/ugvw.html#7.2.3.-additional-views-of-collections > > > El 2017-04-14 05:52, Dan Haywood escribió: > > Hi Hector, > > Thanks for uploading that image ... a picture tells a thousand words. > > To implement your requirements, I could imagine the <fieldset> element > having an additional attribute, say "defaultView" (similar to the > <collection> element / @CollectionLayout annotation), which might default > to "open" but also support "hide". This corresponds to > the org.apache.isis.applib.layout.component.FieldSet class. > > In the UI, this corresponds to > the org.apache.isis.viewer.wicket.ui.components.entity.fieldset.PropertyGroup > class, which is passed the FieldSet into its constructor (by way of its > Wicket model). So it looks like this PropertyGroup component could quite > easily be made a little more sophisticated to have a drop-down. > > Do you fancy delving in to see if you can get a spike working (with a view > to incorporating this functionality into a future version of the > framework)? Martin Grigorov is our Wicket expert, and he is usually very > prompt at answering any Wicket-specific questions. > > HTH > Dan > > > -- > > *Hector Fabio Meza* > *R&D Lead smartools* > (57) 300 2254455 <%2857%29%20300%206815404> > Skype: hectorf.meza > www.smartools.com.co > >
