[
https://issues.apache.org/jira/browse/ISIS-2253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17349341#comment-17349341
]
Daniel Keir Haywood commented on ISIS-2253:
-------------------------------------------
I've just added a screenshot of my IDE that shows where the hack is:
LinkAndLabelFactoryAbstract sets up a listener in the UI that reaches over to
see if there's a ToggledMementosProvider ... basically the
EntityCollectionModel of the associated collection for the action, if any. And
if there is, then this UI code directly sets up the defaults.
Instead, I think that there should be no special logic here, but instead there
should be an implementation of ActionParameterDefaultsFacet that does this,,
with that implementation being contributed (via MetaModelRefiner) by the Wicket
viewer, which would of course be looking at the EntityCollectionsModel.
That way the UI would just down to the metamodel (application layer) rather
than across to some other part of the UI.
> Derive ChoicesFacet from ChoicesFromFacet, remove special-case logic.
> ---------------------------------------------------------------------
>
> Key: ISIS-2253
> URL: https://issues.apache.org/jira/browse/ISIS-2253
> Project: Isis
> Issue Type: Bug
> Components: Isis Viewer Wicket
> Reporter: Andi Huber
> Assignee: Andi Huber
> Priority: Minor
> Fix For: 2.0.0-M6
>
> Attachments: screenshot-1.png
>
>
> In fact, this is a case of two wrongs not quite making a right. There's a
> nasty hack in that it is the Wicket viewer that knows how to populate the
> choices for the parameter, and it does this without looking for an
> autoComplete or choices facet ; it just picks up the checked items of the
> associated collection.
> The short term solution to fix DemoApp is just to update that metamodel
> validator to also take into account any AssociatedWithFacet.
> The long term "correct" solution is a new facet factory that will derive a
> ChoicesFacet from the AssociatedWithFacet, and then to remove the special
> case logic from the Wicket viewer.
> That would then make the validator correct as it is now written.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)