On 13 June 2013 15:12, GESCONSULTOR - Óscar Bou <[email protected]>wrote:

>
> Following the current implementation of the "dependencies" collection on
> the ToDoItem class, the following code template would be of interest for
> "ordered collections".
>
> I've defined it with name "iscss" and description "Collection
> (set-sorted)", just as an example.
> [snip]


Thanks, Oscar.



> Also, is there any annotation that could allow the "addTo[CollectionName]"
> and "removeFrom[CollectionName]" to be available on the user interface?
>
> In most collections, those names are "just valid" for the Ubiquitous
> Language.
>

Um, no, there isn't.  Those methods are actually explicitly removed from
the metamodel when their parent collection is detected.

That said, the Wicket viewer is slightly deficient here.  Isis itself
supports the notion of mutable collections (with an implicit
addTo/removeFrom), but the Wicket viewer's collections are always
immutable.  The attaching of add and remove actions "adjacent" to the
collections started off as a simple rendering trick, and has since evolved
into a defacto mutable collection.


What I really need to do is fix this deficiency; Wicket will automatically
synthesize the 'add' and 'remove' actions if the collection is not
immutable.

I've raised a ticket for this [1].  Not sure when I'll get around to doing
it though; not a top priority for me, and will be a bit fiddly.



>
> If not available, or if is not recommended breaking the rule of not
> publishing to the UI the programming model methods , I could add a new
> template based on the "iscmod" like this one. which I've called "iscmoda" -
> "Collection modify (with actions)":
>

> [snip]



> Just for all those reasons, I've defined a new template, "iscssa" -
> "Collection (set-sorted-with actions)" that riquires 4 inputs for a
> collection with "add/insert" and "delete/remove" actions:
>
> [snip]


OK, I've added all three templates to the isis-templates.xml file, and
uploaded to the site.  Many thanks for these contributions.

I've also taken the opportunity to add in two new templates: "ispauto" and
"isaauto" for the new autoCompleteXxx(String) support [2], [3]

Cheers
Dan

[1] https://issues.apache.org/jira/browse/ISIS-439
[2]
http://isis.apache.org/applib-guide/how-tos/how-to-03-015-How-to-specify-an-autocomplete-for-a-property.html
[3]
http://isis.apache.org/applib-guide/how-tos/how-to-03-025-How-to-specify-an-autocomplete-for-an-action-parameter.html

Reply via email to