This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch CAUSEWAY-2485
in repository https://gitbox.apache.org/repos/asf/causeway.git

commit 31610fb4c9ab2441c1ddfd5a49198fdd5209f4e0
Author: danhaywood <[email protected]>
AuthorDate: Mon May 15 07:34:00 2023 +0100

    CAUSEWAY-2485: wip on action defaults
---
 .../dom/domain/actions/progmodel/TvCharacter.java  |  10 ++
 .../actions/progmodel/TvCharacterPopulator.java    |  30 +++---
 .../progmodel/defaults/ActionDefaultsMenu.java     |  55 ++++++++++
 .../defaults/ActionDefaultsPage-description.adoc   |  97 +++++++++++++++++
 ...onDefaultsPage-multipleDefaultsDescription.adoc |   4 +
 ...nDefaultsPage-parameterMatchingDescription.adoc |   4 +
 ...ctionDefaultsPage-singleDefaultDescription.adoc |   4 +
 .../progmodel/defaults/ActionDefaultsPage.java     | 110 +++++++++++++++++++
 .../defaults/ActionDefaultsPage.layout.xml         |  81 ++++++++++++++
 ...ActionDefaultsPage_selectTvCharacterByShow.java |  69 ++++++++++++
 .../ActionDefaultsPage_selectTvCharacters.java     |  63 +++++++++++
 ...efaultsPage_selectTvCharactersByShowAndSex.java |  88 ++++++++++++++++
 .../ActionDependentArgsPage_useAutoComplete.java   | 102 ------------------
 ...tionDependentArgsPage_useAutoCompleteMulti.java | 102 ------------------
 .../ActionDependentArgsPage_useChoices.java        |  96 -----------------
 .../ActionDependentArgsPage_useChoicesMulti.java   |  91 ----------------
 .../dom/domain/actions/progmodel/disable/notes.txt |   1 +
 .../dom/domain/actions/progmodel/hide/notes.txt    |   1 +
 .../domain/actions/progmodel/paramstyles/notes.txt | 117 ---------------------
 .../src/main/java/demoapp/dom/menubars.layout.xml  |   1 +
 20 files changed, 603 insertions(+), 523 deletions(-)

diff --git 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/TvCharacter.java
 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/TvCharacter.java
index 785ce74285..3a4f8a19cd 100644
--- 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/TvCharacter.java
+++ 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/TvCharacter.java
@@ -25,6 +25,8 @@ import org.apache.causeway.applib.annotation.Editing;
 import org.apache.causeway.applib.annotation.Nature;
 import org.apache.causeway.applib.annotation.ObjectSupport;
 import org.apache.causeway.applib.annotation.Property;
+import org.apache.causeway.applib.annotation.PropertyLayout;
+import org.apache.causeway.applib.annotation.Where;
 
 import lombok.AllArgsConstructor;
 import lombok.EqualsAndHashCode;
@@ -49,9 +51,17 @@ public class TvCharacter {
     @Property(editing = Editing.DISABLED)
     @Getter @Setter private TvShow tvShow;
 
+    @Property
+    @PropertyLayout(hidden = Where.EVERYWHERE)
+    @Getter @Setter private Sex sex;
+
     @Override
     public String toString() {
         return title();
     }
 
+    public enum Sex {
+        MALE,
+        FEMALE
+    }
 }
diff --git 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/TvCharacterPopulator.java
 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/TvCharacterPopulator.java
index fa1cf02d85..456f09b9f3 100644
--- 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/TvCharacterPopulator.java
+++ 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/TvCharacterPopulator.java
@@ -25,21 +25,21 @@ import org.springframework.stereotype.Service;
 @Service
 public class TvCharacterPopulator {
 
-    public void populate(Set<TvCharacter> items) {
-        items.clear();
-        items.add(TvCharacter.of("Tom", TvShow.THE_GOOD_LIFE));
-        items.add(TvCharacter.of("Barbara", TvShow.THE_GOOD_LIFE));
-        items.add(TvCharacter.of("Jerry", TvShow.THE_GOOD_LIFE));
-        items.add(TvCharacter.of("Margo", TvShow.THE_GOOD_LIFE));
-        items.add(TvCharacter.of("Joey", TvShow.FRIENDS));
-        items.add(TvCharacter.of("Monica", TvShow.FRIENDS));
-        items.add(TvCharacter.of("Rachel", TvShow.FRIENDS));
-        items.add(TvCharacter.of("Phoebe", TvShow.FRIENDS));
-        items.add(TvCharacter.of("Chandler", TvShow.FRIENDS));
-        items.add(TvCharacter.of("Ross", TvShow.FRIENDS));
-        items.add(TvCharacter.of("Mary", TvShow.MMM));
-        items.add(TvCharacter.of("Mungo", TvShow.MMM));
-        items.add(TvCharacter.of("Midge", TvShow.MMM));
+    public void populate(Set<TvCharacter> tvCharacters) {
+        tvCharacters.clear();
+        tvCharacters.add(TvCharacter.of("Tom", TvShow.THE_GOOD_LIFE, 
TvCharacter.Sex.MALE));
+        tvCharacters.add(TvCharacter.of("Barbara", TvShow.THE_GOOD_LIFE, 
TvCharacter.Sex.FEMALE));
+        tvCharacters.add(TvCharacter.of("Jerry", TvShow.THE_GOOD_LIFE, 
TvCharacter.Sex.MALE));
+        tvCharacters.add(TvCharacter.of("Margo", TvShow.THE_GOOD_LIFE, 
TvCharacter.Sex.FEMALE));
+        tvCharacters.add(TvCharacter.of("Joey", TvShow.FRIENDS, 
TvCharacter.Sex.MALE));
+        tvCharacters.add(TvCharacter.of("Monica", TvShow.FRIENDS, 
TvCharacter.Sex.FEMALE));
+        tvCharacters.add(TvCharacter.of("Rachel", TvShow.FRIENDS, 
TvCharacter.Sex.FEMALE));
+        tvCharacters.add(TvCharacter.of("Phoebe", TvShow.FRIENDS, 
TvCharacter.Sex.FEMALE));
+        tvCharacters.add(TvCharacter.of("Chandler", TvShow.FRIENDS, 
TvCharacter.Sex.MALE));
+        tvCharacters.add(TvCharacter.of("Ross", TvShow.FRIENDS, 
TvCharacter.Sex.MALE));
+        tvCharacters.add(TvCharacter.of("Mary", TvShow.MMM, 
TvCharacter.Sex.FEMALE));
+        tvCharacters.add(TvCharacter.of("Mungo", TvShow.MMM, 
TvCharacter.Sex.MALE));
+        tvCharacters.add(TvCharacter.of("Midge", TvShow.MMM, 
TvCharacter.Sex.MALE));
     }
 }
 
diff --git 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsMenu.java
 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsMenu.java
new file mode 100644
index 0000000000..77d84ac622
--- /dev/null
+++ 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsMenu.java
@@ -0,0 +1,55 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package demoapp.dom.domain.actions.progmodel.defaults;
+
+import javax.annotation.Priority;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.apache.causeway.applib.annotation.Action;
+import org.apache.causeway.applib.annotation.ActionLayout;
+import org.apache.causeway.applib.annotation.DomainService;
+import org.apache.causeway.applib.annotation.NatureOfService;
+import org.apache.causeway.applib.annotation.PriorityPrecedence;
+import org.apache.causeway.applib.services.factory.FactoryService;
+
+import lombok.RequiredArgsConstructor;
+import lombok.val;
+
+import demoapp.dom.domain.actions.progmodel.TvCharacterPopulator;
+
+@Named("demo.ActionDefaultsMenu")
+@DomainService(nature=NatureOfService.VIEW)
+@Priority(PriorityPrecedence.EARLY)
+@RequiredArgsConstructor(onConstructor_ = { @Inject })
+public class ActionDefaultsMenu {
+
+    final FactoryService factoryService;
+    final TvCharacterPopulator tvCharacterPopulator;
+
+    @Action
+    @ActionLayout(cssClassFa="fa-bolt")
+    public ActionDefaultsPage defaults(){
+        val page = factoryService.viewModel(new ActionDefaultsPage());
+        tvCharacterPopulator.populate(page.getTvCharacters());
+        return page;
+    }
+
+}
+
diff --git 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage-description.adoc
 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage-description.adoc
new file mode 100644
index 0000000000..ddc6e89457
--- /dev/null
+++ 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage-description.adoc
@@ -0,0 +1,97 @@
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license agreements. See the NOTICE file distributed with this work 
for additional information regarding copyright ownership. The ASF licenses this 
file to you under the Apache License, Version 2.0 (the "License"); you may not 
use this file except in compliance with the License. You may obtain a copy of 
the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by 
applicable law or ag [...]
+
+WARNING: TODO - update these works
+
+Before an action can be invoked, the end-user has to provide an argument for 
each of its parameters.
+If the parameter is a value (String, number, date etc.) then they can just 
enter the value in a field.
+But if the parameter is a reference type, then some other mechanism is 
required.
+
+A "choices" supporting method provides a set of candidate arguments for the 
parameter type, rendered in the UI as a drop-down list.
+The list of candidates is expected to be small; if there is a larger list then 
instead use an "autoComplete" supporting method instead.
+
+The method should also (if possible) only proffer candidates that would also 
pass any validation rules, to avoid an otherwise frustrating user experience.
+
+There are several variations:
+
+* the parameter for which candidates are being supplied can be either a scalar 
or a collection
+* the supporting "choices" method can be associated with the parameter by 
number, or by name
+* the list of candidates for a parameter can depend upon the value already 
selected for an earlier parameter.
+** The preceding N-1 parameters are supplied to the Nth "choices" supporting 
method.
+** Or a single record-like structure can be defined and this can be passed 
through to all supporting methods instead.
+
+As noted above, a supporting method to return a list of candidate arguments is 
_always_ required for reference types.
+It is also possible to specify choices for value types, though this is much 
less commonly done.
+
+== How this demo works
+
+On the left hand side is a list of objects representing TV characters, also 
indicating the TV show that they appeared in.
+Below is a list of selected characters, initially empty.
+
+In the middle are a set of actions, each of which can be used to select a TV 
character or characters.
+These demonstrate the variations listed in the introduction above.
+
+In terms of code:
+
+* this action allows a single TV character to be selected.
+It matches the supporting "choices" method with the parameter by number.
++
+[source,java]
+.ActionChoicesPage_selectTvCharacter.java
+----
+include::ActionChoicesPage_selectTvCharacter.java[tags=class]
+----
+<.> defines the 0th-param
+<.> provides the candidate arguments for the 0-th parameter.
+The collection's element type must match that of the parameter.
+
+* this action is similar, but allows multiple TV characters to be selected.
+This time, it matches the supporting "choices" method with the parameter by 
name.
++
+[source,java]
+.ActionChoicesPage_selectTvCharacters.java
+----
+include::ActionChoicesPage_selectTvCharacters.java[tags=class]
+----
+<.> provides the candidate arguments for the "tvCharacters" parameter
+
+* the next example demonstrates dependent arguments, so that the TV characters 
are first filtered by the show that they appeared in.
++
+[source,java]
+.ActionChoicesPage_selectTvCharacterByShow.java
+----
+include::ActionChoicesPage_selectTvCharacterByShow.java[tags=class]
+----
+<.> this parameter is used to filter the TV characters
+<.> the "choices" method is matched by number ...
+<.> \... and has a subset of the parameters of the action itself ("N-1" of 
them).
+
+* the next example is similar; dependent arguments but with a multiple 
selection, and using names to match the "choices" method:
++
+[source,java]
+.ActionChoicesPage_selectTvCharactersByShows.java
+----
+include::ActionChoicesPage_selectTvCharactersByShows.java[tags=class]
+----
+<.> the "choices" method matches a parameter of the action by name ...
+<.> \... and accepts all the parameters defined in the action _up to_ (but not 
including) the matched parameter.
+
+* the final example also demonstrates dependent arguments, but using a 
"Parameters" record.
++
+[source,java]
+.ActionChoicesPage_selectTvCharactersByShow.java
+----
+include::ActionChoicesPage_selectTvCharactersByShow.java[tags=class]
+----
+<.> the set of parameters of the action ...
+<.> \... are also defined as fields of a `Parameters` type
+<.>
+<.> the framework will set the fields of `Parameters` object as appropriate
+
++
+In a small action like this, there is little to be gained by introducing a 
"Parameters" record class.
+But if there were many parameters to the action and many supporting methods, 
then introducing such a record class can significantly reduce the boilerplate.
++
+[TIP]
+====
+In this example the `Parameters` class uses lombok 'fluent" accessor, but 
record classes can also be used for Java 14+.
+====
diff --git 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage-multipleDefaultsDescription.adoc
 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage-multipleDefaultsDescription.adoc
new file mode 100644
index 0000000000..f8eb13d005
--- /dev/null
+++ 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage-multipleDefaultsDescription.adoc
@@ -0,0 +1,4 @@
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license agreements. See the NOTICE file distributed with this work 
for additional information regarding copyright ownership. The ASF licenses this 
file to you under the Apache License, Version 2.0 (the "License"); you may not 
use this file except in compliance with the License. You may obtain a copy of 
the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by 
applicable law or ag [...]
+
+WARNING: TODO - update these works
+
diff --git 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage-parameterMatchingDescription.adoc
 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage-parameterMatchingDescription.adoc
new file mode 100644
index 0000000000..f8eb13d005
--- /dev/null
+++ 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage-parameterMatchingDescription.adoc
@@ -0,0 +1,4 @@
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license agreements. See the NOTICE file distributed with this work 
for additional information regarding copyright ownership. The ASF licenses this 
file to you under the Apache License, Version 2.0 (the "License"); you may not 
use this file except in compliance with the License. You may obtain a copy of 
the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by 
applicable law or ag [...]
+
+WARNING: TODO - update these works
+
diff --git 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage-singleDefaultDescription.adoc
 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage-singleDefaultDescription.adoc
new file mode 100644
index 0000000000..f8eb13d005
--- /dev/null
+++ 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage-singleDefaultDescription.adoc
@@ -0,0 +1,4 @@
+:Notice: Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license agreements. See the NOTICE file distributed with this work 
for additional information regarding copyright ownership. The ASF licenses this 
file to you under the Apache License, Version 2.0 (the "License"); you may not 
use this file except in compliance with the License. You may obtain a copy of 
the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by 
applicable law or ag [...]
+
+WARNING: TODO - update these works
+
diff --git 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage.java
 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage.java
new file mode 100644
index 0000000000..3dd7ea0385
--- /dev/null
+++ 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage.java
@@ -0,0 +1,110 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package demoapp.dom.domain.actions.progmodel.defaults;
+
+import java.util.LinkedHashSet;
+import java.util.Set;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+import org.apache.causeway.applib.annotation.Collection;
+import org.apache.causeway.applib.annotation.CollectionLayout;
+import org.apache.causeway.applib.annotation.DomainObject;
+import org.apache.causeway.applib.annotation.Editing;
+import org.apache.causeway.applib.annotation.LabelPosition;
+import org.apache.causeway.applib.annotation.Nature;
+import org.apache.causeway.applib.annotation.ObjectSupport;
+import org.apache.causeway.applib.annotation.Optionality;
+import org.apache.causeway.applib.annotation.Property;
+import org.apache.causeway.applib.annotation.PropertyLayout;
+import org.apache.causeway.valuetypes.asciidoc.applib.value.AsciiDoc;
+
+import demoapp.dom.domain.actions.progmodel.TvShow;
+
+import lombok.Getter;
+
+import demoapp.dom._infra.asciidocdesc.HasAsciiDocDescription;
+import demoapp.dom._infra.resources.AsciiDocReaderService;
+import demoapp.dom.domain.actions.progmodel.TvCharacter;
+
+import lombok.Setter;
+
+@XmlRootElement(name = "Demo")
+@XmlType
+@XmlAccessorType(XmlAccessType.FIELD)
+@Named("demo.ActionDefaults")
+@DomainObject(nature=Nature.VIEW_MODEL, editing=Editing.ENABLED)
+public class ActionDefaultsPage implements HasAsciiDocDescription {
+
+    @ObjectSupport public String title() {
+        return "Action Defaults";
+    }
+
+
+    @Property
+    @PropertyLayout(labelPosition=LabelPosition.NONE)
+    public AsciiDoc getSingleDefaultDescription() {
+        return asciiDocReaderService.readFor(this, "singleDefaultDescription");
+    }
+    @Property(editing = Editing.ENABLED, optionality = Optionality.OPTIONAL)
+    @Getter @Setter
+    private TvShow preselectTvShow;
+
+    @Property
+    @PropertyLayout(labelPosition=LabelPosition.NONE)
+    public AsciiDoc getMultipleDefaultsDescription() {
+        return asciiDocReaderService.readFor(this, 
"multipleDefaultsDescription");
+    }
+    @Property(editing = Editing.ENABLED, optionality = Optionality.OPTIONAL)
+    @Getter @Setter
+    private TvCharacter.Sex preselectCharacterSex;
+
+    @Property
+    @PropertyLayout(labelPosition=LabelPosition.NONE)
+    public AsciiDoc getParameterMatchingDescription() {
+        return asciiDocReaderService.readFor(this, 
"parameterMatchingDescription");
+    }
+    @Property(editing = Editing.ENABLED, optionality = Optionality.OPTIONAL)
+    @Getter @Setter
+    private TvShow preselectTvShow2;
+    @Property(editing = Editing.ENABLED, optionality = Optionality.OPTIONAL)
+    @Getter @Setter
+    private TvCharacter.Sex preselectCharacterSex2;
+
+
+    @Collection
+    @CollectionLayout
+    @Getter
+    private final Set<TvCharacter> tvCharacters = new LinkedHashSet<>();
+
+    @Collection
+    @CollectionLayout
+    @Getter
+    private final Set<TvCharacter> selectedTvCharacters = new 
LinkedHashSet<>();
+
+    @Inject @XmlTransient AsciiDocReaderService asciiDocReaderService;
+
+}
+
diff --git 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage.layout.xml
 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage.layout.xml
new file mode 100644
index 0000000000..a1981e9ad1
--- /dev/null
+++ 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage.layout.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more 
contributor
+       license agreements. See the NOTICE file distributed with this work for 
additional
+       information regarding copyright ownership. The ASF licenses this file to
+       you under the Apache License, Version 2.0 (the "License"); you may not 
use
+       this file except in compliance with the License. You may obtain a copy 
of
+       the License at http://www.apache.org/licenses/LICENSE-2.0 Unless 
required
+       by applicable law or agreed to in writing, software distributed under 
the
+       License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 
CONDITIONS
+       OF ANY KIND, either express or implied. See the License for the specific
+       language governing permissions and limitations under the License. -->
+<bs3:grid
+               
xsi:schemaLocation="https://causeway.apache.org/applib/layout/component 
https://causeway.apache.org/applib/layout/component/component.xsd   
https://causeway.apache.org/applib/layout/grid/bootstrap3 
https://causeway.apache.org/applib/layout/grid/bootstrap3/bootstrap3.xsd";
+               
xmlns:bs3="https://causeway.apache.org/applib/layout/grid/bootstrap3";
+               xmlns:cpt="https://causeway.apache.org/applib/layout/component";
+               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
+    <bs3:row>
+        <bs3:col span="10" unreferencedActions="true">
+            <cpt:domainObject />
+        </bs3:col>
+        <bs3:col span="2">
+            <cpt:fieldSet name="" id="sources" />
+        </bs3:col>
+    </bs3:row>
+       <bs3:row>
+
+               <bs3:col span="6">
+            <bs3:row>
+                <bs3:col span="12">
+                    <bs3:row>
+                        <bs3:col span="6">
+                            <cpt:collection id="tvCharacters"/>
+                            <cpt:collection id="selectedTvCharacters"/>
+                        </bs3:col>
+                        <bs3:col span="6">
+                            <cpt:fieldSet name="Single Default" 
id="single-choices">
+                                <cpt:action id="selectTvCharacterByShow"/>
+                                <cpt:property id="singleDefaultDescription"/>
+                                <cpt:property id="preselectTvShow"/>
+                            </cpt:fieldSet>
+                            <cpt:fieldSet name="Multiple Defaults" 
id="multi-choices">
+                                <cpt:action id="selectTvCharacters"/>
+                                <cpt:property 
id="multipleDefaultsDescription"/>
+                                <cpt:property id="preselectCharacterSex"/>
+                            </cpt:fieldSet>
+                            <cpt:fieldSet name="Parameter Matching" 
id="parameter-matching">
+                                <cpt:action 
id="selectTvCharactersByShowAndSex"/>
+                                <cpt:property 
id="parameterMatchingDescription"/>
+                                <cpt:property id="preselectTvShow2"/>
+                                <cpt:property id="preselectCharacterSex2"/>
+                            </cpt:fieldSet>
+                        </bs3:col>
+                    </bs3:row>
+                </bs3:col>
+            </bs3:row>
+                       <cpt:fieldSet name="Other" id="other" 
unreferencedProperties="true"/>
+               </bs3:col>
+
+               <bs3:col span="6">
+                       <cpt:fieldSet name="Description" id="description" >
+                               <cpt:action id="clearHints" position="PANEL" />
+                               <cpt:action id="rebuildMetamodel" 
position="PANEL"/>
+                               <cpt:action id="downloadLayout"  
position="PANEL_DROPDOWN"/>
+                               <cpt:action id="inspectMetamodel"  
position="PANEL_DROPDOWN"/>
+                               <cpt:action id="downloadMetamodelXml"  
position="PANEL_DROPDOWN"/>
+                               <cpt:action id="downloadJdoMetamodel"  
position="PANEL_DROPDOWN"/>
+                               <cpt:action id="recentCommands"  
position="PANEL_DROPDOWN"/>
+                               <cpt:action id="recentExecutions"  
position="PANEL_DROPDOWN"/>
+                               <cpt:action id="recentAuditTrailEntries"  
position="PANEL_DROPDOWN"/>
+                               <cpt:action id="impersonateWithRoles"  
position="PANEL_DROPDOWN"/>
+                               <cpt:action id="openRestApi" 
position="PANEL_DROPDOWN" />
+                               <cpt:property id="description"/>
+                       </cpt:fieldSet>
+               </bs3:col>
+
+       </bs3:row>
+       <bs3:row>
+               <bs3:col span="12" unreferencedCollections="true"/>
+       </bs3:row>
+
+</bs3:grid>
diff --git 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage_selectTvCharacterByShow.java
 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage_selectTvCharacterByShow.java
new file mode 100644
index 0000000000..c93561456f
--- /dev/null
+++ 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage_selectTvCharacterByShow.java
@@ -0,0 +1,69 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package demoapp.dom.domain.actions.progmodel.defaults;
+
+import demoapp.dom.domain.actions.progmodel.TvCharacter;
+import demoapp.dom.domain.actions.progmodel.TvShow;
+import demoapp.dom.domain.actions.progmodel.choices.ActionChoicesPage;
+
+import lombok.RequiredArgsConstructor;
+
+import java.util.Collection;
+import java.util.stream.Collectors;
+
+import org.apache.causeway.applib.annotation.*;
+
+//tag::class[]
+@Action(semantics = SemanticsOf.IDEMPOTENT)
+@RequiredArgsConstructor
+public class ActionDefaultsPage_selectTvCharacterByShow {
+
+    private final ActionDefaultsPage page;
+
+    @MemberSupport public ActionDefaultsPage act(
+        @Parameter(optionality = Optionality.MANDATORY)
+        final TvShow tvShow,                                    // <.>
+        @Parameter(optionality = Optionality.MANDATORY)
+        final TvCharacter tvCharacter
+    ) {
+        page.getSelectedTvCharacters().clear();
+        page.getSelectedTvCharacters().add(tvCharacter);
+        return page;
+    }
+
+    @MemberSupport public TvShow default0Act() {                // <.>
+        return page.getPreselectTvShow();
+    }
+    @MemberSupport public TvCharacter default1Act(              // <.>
+        final TvShow tvShow
+    ) {
+        return choices1Act(tvShow).stream().findFirst().orElse(null);
+    }
+    @MemberSupport public Collection<TvCharacter> choices1Act(
+            final TvShow tvShow
+    ) {
+        return page.getTvCharacters()
+                .stream()
+                .filter(tvCharacter -> tvShow == null ||
+                                       tvShow == tvCharacter.getTvShow())
+                .collect(Collectors.toList());
+    }
+}
+//end::class[]
+
diff --git 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage_selectTvCharacters.java
 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage_selectTvCharacters.java
new file mode 100644
index 0000000000..b692ea1972
--- /dev/null
+++ 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage_selectTvCharacters.java
@@ -0,0 +1,63 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package demoapp.dom.domain.actions.progmodel.defaults;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import org.apache.causeway.applib.annotation.Action;
+import org.apache.causeway.applib.annotation.MemberSupport;
+import org.apache.causeway.applib.annotation.Optionality;
+import org.apache.causeway.applib.annotation.Parameter;
+import org.apache.causeway.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+
+import demoapp.dom.domain.actions.progmodel.TvCharacter;
+
+//tag::class[]
+@Action(semantics = SemanticsOf.IDEMPOTENT)
+@RequiredArgsConstructor
+public class ActionDefaultsPage_selectTvCharacters {
+
+    private final ActionDefaultsPage page;
+
+    @MemberSupport public ActionDefaultsPage act(
+        @Parameter(optionality = Optionality.MANDATORY)
+        final List<TvCharacter> tvCharacters                                // 
<.>
+    ) {
+        page.getSelectedTvCharacters().clear();
+        page.getSelectedTvCharacters().addAll(tvCharacters);
+        return page;
+    }
+
+    @MemberSupport public Collection<TvCharacter> choicesTvCharacters() {
+        return page.getTvCharacters();
+    }
+    @MemberSupport public List<TvCharacter> defaultTvCharacters() {   // <1>
+        TvCharacter.Sex preselectCharacterSex = 
page.getPreselectCharacterSex();
+        return choicesTvCharacters().stream()
+                .filter(tvCharacter -> preselectCharacterSex == null ||
+                                       tvCharacter.getSex() == 
preselectCharacterSex)
+                .collect(Collectors.toList());
+    }
+}
+//end::class[]
+
diff --git 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage_selectTvCharactersByShowAndSex.java
 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage_selectTvCharactersByShowAndSex.java
new file mode 100644
index 0000000000..9c4ad55931
--- /dev/null
+++ 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/defaults/ActionDefaultsPage_selectTvCharactersByShowAndSex.java
@@ -0,0 +1,88 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package demoapp.dom.domain.actions.progmodel.defaults;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+import org.apache.causeway.applib.annotation.Action;
+import org.apache.causeway.applib.annotation.MemberSupport;
+import org.apache.causeway.applib.annotation.Optionality;
+import org.apache.causeway.applib.annotation.Parameter;
+import org.apache.causeway.applib.annotation.SemanticsOf;
+
+import lombok.RequiredArgsConstructor;
+import lombok.Value;
+import lombok.val;
+import lombok.experimental.Accessors;
+
+import demoapp.dom.domain.actions.progmodel.TvCharacter;
+import demoapp.dom.domain.actions.progmodel.TvShow;
+
+//tag::class[]
+@Action(semantics = SemanticsOf.SAFE)
+@RequiredArgsConstructor
+public class ActionDefaultsPage_selectTvCharactersByShowAndSex {
+
+    private final ActionDefaultsPage page;
+
+    @MemberSupport public ActionDefaultsPage act(
+        @Parameter(optionality = Optionality.MANDATORY)
+        final TvShow tvShow,                                        // <.>
+        @Parameter(optionality = Optionality.MANDATORY)
+        final TvCharacter.Sex sex,                                  // <.>
+        @Parameter(optionality = Optionality.MANDATORY)
+        final List<TvCharacter> tvCharacters
+    ) {
+        page.getSelectedTvCharacters().clear();
+        page.getSelectedTvCharacters().addAll(tvCharacters);
+        return page;
+    }
+
+    @Value @Accessors(fluent = true)
+    static class Parameters {                                       // <.>
+        TvShow tvShow;
+        TvCharacter.Sex sex;
+        List<TvCharacter> tvCharacters;
+    }
+
+    @MemberSupport public TvShow defaultTvShow() {                  // <.>
+        return page.getPreselectTvShow2();
+    }
+    @MemberSupport public TvCharacter.Sex defaultSex() {            // <.>
+        return page.getPreselectCharacterSex2();
+    }
+    @MemberSupport public List<TvCharacter> defaultTvCharacters(
+            final Parameters params                                 // <2>
+    ) {
+        return choicesTvCharacters(params);
+    }
+    @MemberSupport public List<TvCharacter> choicesTvCharacters(
+            final Parameters params                                 // <2>
+    ) {
+        val tvShowSelected = params.tvShow();                       // <.>
+        val sexSelected = params.sex;                               // <.>
+        return page.getTvCharacters()
+                .stream()
+                .filter(tvCharacter -> tvShowSelected == 
tvCharacter.getTvShow())
+                .filter(tvCharacter -> sexSelected == tvCharacter.getSex())
+                .collect(Collectors.toList());
+    }
+}
+//end::class[]
diff --git 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgsPage_useAutoComplete.java
 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgsPage_useAutoComplete.java
deleted file mode 100644
index 4b534263dd..0000000000
--- 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgsPage_useAutoComplete.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package demoapp.dom.domain.actions.progmodel.depargs;
-
-import java.util.Collection;
-import java.util.stream.Collectors;
-
-import javax.inject.Inject;
-
-import org.apache.causeway.applib.annotation.Action;
-import org.apache.causeway.applib.annotation.ActionLayout;
-import org.apache.causeway.applib.annotation.MemberSupport;
-import org.apache.causeway.applib.annotation.MinLength;
-import org.apache.causeway.applib.annotation.Optionality;
-import org.apache.causeway.applib.annotation.Parameter;
-import org.apache.causeway.applib.annotation.PromptStyle;
-import org.apache.causeway.applib.services.message.MessageService;
-import org.apache.causeway.commons.internal.base._Strings;
-
-import demoapp.dom.domain.actions.progmodel.TvCharacter;
-import demoapp.dom.domain.actions.progmodel.TvShow;
-
-import lombok.RequiredArgsConstructor;
-import lombok.Value;
-import lombok.val;
-import lombok.experimental.Accessors;
-
-@ActionLayout(named="Auto Complete", promptStyle = PromptStyle.DIALOG_MODAL)
-@Action
-@RequiredArgsConstructor
-public class ActionDependentArgsPage_useAutoComplete {
-
-    @Inject MessageService messageService;
-
-    private final ActionDependentArgsPage holder;
-
-    @Value @Accessors(fluent = true) // fluent so we can replace this with 
Java(14+) records later
-    static class Parameters {
-        TvShow tvShow;
-        TvCharacter item1;
-    }
-
-    @MemberSupport public ActionDependentArgsPage act(
-        @Parameter(optionality = Optionality.MANDATORY) final TvShow tvShow,
-        @Parameter(optionality = Optionality.MANDATORY) final TvCharacter item
-    ) {
-        messageService.informUser(item.getName());
-        return holder;
-    }
-
-    @MemberSupport public TvShow default0Act() {
-        return holder.getFirstParamDefault();
-    }
-    @MemberSupport public TvCharacter default1Act(final Parameters params) {
-        // fill in first that is possible based on the first param from the UI 
dialog
-        return params.tvShow()==null
-                ? null
-                : autoComplete1Act(params, "")
-                    .stream().findFirst().orElse(null);
-    }
-
-    @MemberSupport public Collection<TvCharacter> autoComplete1Act(
-            final Parameters params,
-            @MinLength(2) final String search) {
-
-        val parity = params.tvShow(); // <-- the refining parameter from the 
dialog above
-
-        if(parity == null) {
-            return holder.getItems()
-                    .stream()
-                    
.filter(item->item.getName().toLowerCase().contains(search.toLowerCase()))
-                    .collect(Collectors.toList());
-        }
-
-        return holder.getItems()
-                .stream()
-                .filter(item->parity == item.getTvShow())
-                .filter(item->_Strings.isNullOrEmpty(search)
-                        ? true
-                        : 
item.getName().toLowerCase().contains(search.toLowerCase()))
-                .collect(Collectors.toList());
-    }
-
-
-}
-
diff --git 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgsPage_useAutoCompleteMulti.java
 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgsPage_useAutoCompleteMulti.java
deleted file mode 100644
index 5303b24cdf..0000000000
--- 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgsPage_useAutoCompleteMulti.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package demoapp.dom.domain.actions.progmodel.depargs;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import javax.inject.Inject;
-
-import org.apache.causeway.applib.annotation.Action;
-import org.apache.causeway.applib.annotation.ActionLayout;
-import org.apache.causeway.applib.annotation.MemberSupport;
-import org.apache.causeway.applib.annotation.MinLength;
-import org.apache.causeway.applib.annotation.Optionality;
-import org.apache.causeway.applib.annotation.Parameter;
-import org.apache.causeway.applib.annotation.PromptStyle;
-import org.apache.causeway.applib.services.message.MessageService;
-import org.apache.causeway.commons.internal.base._NullSafe;
-import org.apache.causeway.commons.internal.base._Strings;
-import org.apache.causeway.commons.internal.collections._Lists;
-
-import demoapp.dom.domain.actions.progmodel.TvCharacter;
-import demoapp.dom.domain.actions.progmodel.TvShow;
-
-import lombok.RequiredArgsConstructor;
-import lombok.Value;
-import lombok.val;
-import lombok.experimental.Accessors;
-
-@ActionLayout(
-        named="Auto Complete (Multi)",
-        promptStyle = PromptStyle.DIALOG_MODAL)
-@Action
-@RequiredArgsConstructor
-public class ActionDependentArgsPage_useAutoCompleteMulti {
-
-    @Inject MessageService messageService;
-
-    private final ActionDependentArgsPage holder;
-
-    @Value @Accessors(fluent = true) // fluent so we can replace this with 
Java(14+) records later
-    static class Parameters {
-        List<TvShow> parities;
-        List<TvCharacter> items;
-    }
-
-    @MemberSupport public ActionDependentArgsPage act(
-            @Parameter(optionality = Optionality.MANDATORY) final List<TvShow> 
tvShows,
-            @Parameter(optionality = Optionality.MANDATORY) final 
List<TvCharacter> items
-    ) {
-        _NullSafe.stream(items)
-            .forEach(item->messageService.informUser(item.getName()));
-        return holder;
-    }
-
-    @MemberSupport public List<TvShow> defaultTvShows(final Parameters params) 
{
-        return _Lists.of(holder.getFirstParamDefault());
-    }
-    @MemberSupport public List<TvCharacter> defaultItems(final Parameters 
params) {
-        val paritiesFromDialog = params.parities(); // <-- the refining 
parameter from the dialog above
-        if(_NullSafe.isEmpty(paritiesFromDialog)) {
-            return Collections.emptyList();
-        }
-        return autoCompleteItems(params, "");
-    }
-    @MemberSupport public List<TvCharacter> autoCompleteItems(
-            final Parameters params,
-            @MinLength(2) final String search
-    ) {
-
-        val paritiesFromDialog = params.parities(); // <-- the refining 
parameter from the dialog above
-
-        if(_NullSafe.isEmpty(paritiesFromDialog)) {
-            return Collections.emptyList();
-        }
-        return holder.getItems()
-                .stream()
-                .filter(item->paritiesFromDialog.contains(item.getTvShow()))
-                .filter(item->_Strings.isNullOrEmpty(search)
-                        ? true
-                        : 
item.getName().toLowerCase().contains(search.toLowerCase()))
-                .collect(Collectors.toList());
-    }
-}
-
diff --git 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgsPage_useChoices.java
 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgsPage_useChoices.java
deleted file mode 100644
index 0259e79bf5..0000000000
--- 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgsPage_useChoices.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package demoapp.dom.domain.actions.progmodel.depargs;
-
-import java.util.Collection;
-import java.util.stream.Collectors;
-
-import javax.inject.Inject;
-
-import org.apache.causeway.applib.annotation.Action;
-import org.apache.causeway.applib.annotation.ActionLayout;
-import org.apache.causeway.applib.annotation.MemberSupport;
-import org.apache.causeway.applib.annotation.Optionality;
-import org.apache.causeway.applib.annotation.Parameter;
-import org.apache.causeway.applib.annotation.PromptStyle;
-import org.apache.causeway.applib.annotation.SemanticsOf;
-import org.apache.causeway.applib.services.message.MessageService;
-
-import demoapp.dom.domain.actions.progmodel.TvCharacter;
-import demoapp.dom.domain.actions.progmodel.TvShow;
-
-import lombok.RequiredArgsConstructor;
-import lombok.Value;
-import lombok.val;
-import lombok.experimental.Accessors;
-
-@ActionLayout(named="Choices", promptStyle = PromptStyle.DIALOG_MODAL)
-@Action(semantics = SemanticsOf.SAFE)
-@RequiredArgsConstructor
-public class ActionDependentArgsPage_useChoices {
-
-    @Inject MessageService messageService;
-
-    private final ActionDependentArgsPage holder;
-
-    @Value @Accessors(fluent = true) // fluent so we can replace this with 
Java(14+) records later
-    static class Parameters {
-        TvShow tvShow;
-        TvCharacter item1;
-    }
-
-    @MemberSupport public ActionDependentArgsPage act(
-        @Parameter(optionality = Optionality.MANDATORY) final TvShow tvShow,
-        @Parameter(optionality = Optionality.MANDATORY) final TvCharacter item
-    ) {
-        messageService.informUser(item.getName());
-        return holder;
-    }
-
-    // -- PARAM 0 (Parity)
-
-    @MemberSupport public TvShow default0Act() {
-        return holder.getFirstParamDefault();
-    }
-
-    // -- PARAM 1 (DemoItem)
-
-    @MemberSupport public TvCharacter default1Act(final Parameters params) {
-        // fill in first that is possible based on the first param from the UI 
dialog
-        return params.tvShow()==null
-                ? null
-                : choices1Act(params).stream().findFirst().orElse(null);
-    }
-
-    @MemberSupport public Collection<TvCharacter> choices1Act(final Parameters 
params) {
-
-        val parity = params.tvShow(); // <-- the refining parameter from the 
dialog above
-
-        if(parity == null) {
-            return holder.getItems();
-        }
-        return holder.getItems()
-                .stream()
-                .filter(item->parity == item.getTvShow())
-                .collect(Collectors.toList());
-    }
-
-
-}
-
diff --git 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgsPage_useChoicesMulti.java
 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgsPage_useChoicesMulti.java
deleted file mode 100644
index f227e0ffe6..0000000000
--- 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/depargs/ActionDependentArgsPage_useChoicesMulti.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- */
-package demoapp.dom.domain.actions.progmodel.depargs;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.stream.Collectors;
-
-import javax.inject.Inject;
-
-import org.apache.causeway.applib.annotation.Action;
-import org.apache.causeway.applib.annotation.ActionLayout;
-import org.apache.causeway.applib.annotation.MemberSupport;
-import org.apache.causeway.applib.annotation.Optionality;
-import org.apache.causeway.applib.annotation.Parameter;
-import org.apache.causeway.applib.annotation.PromptStyle;
-import org.apache.causeway.applib.annotation.SemanticsOf;
-import org.apache.causeway.applib.services.message.MessageService;
-import org.apache.causeway.commons.internal.base._NullSafe;
-import org.apache.causeway.commons.internal.collections._Lists;
-
-import demoapp.dom.domain.actions.progmodel.TvCharacter;
-import demoapp.dom.domain.actions.progmodel.TvShow;
-
-import lombok.RequiredArgsConstructor;
-import lombok.Value;
-import lombok.val;
-import lombok.experimental.Accessors;
-
-@Action(semantics = SemanticsOf.SAFE)
-@ActionLayout(
-        named="MultiChoices",
-        promptStyle = PromptStyle.DIALOG_MODAL)
-@RequiredArgsConstructor
-public class ActionDependentArgsPage_useChoicesMulti {
-
-    @Inject MessageService messageService;
-
-    private final ActionDependentArgsPage holder;
-
-    @Value @Accessors(fluent = true) // fluent so we can replace this with 
Java(14+) records later
-    static class Parameters {
-        List<TvShow> tvShows;
-        List<TvCharacter> tvCharacters;
-    }
-
-    @MemberSupport public ActionDependentArgsPage act(
-        @Parameter(optionality = Optionality.MANDATORY) List<TvShow> tvShows,
-        @Parameter(optionality = Optionality.MANDATORY) List<TvCharacter> 
tvCharacters
-    ) {
-        _NullSafe.stream(tvCharacters)
-            .forEach(item->messageService.informUser(item.getName()));
-        return holder;
-    }
-
-    @MemberSupport public List<TvShow> defaultTvShows(Parameters params) {
-        return _Lists.of(holder.getFirstParamDefault());
-    }
-
-    @MemberSupport public List<TvCharacter> defaultTvCharacters(Parameters 
params) {
-        return choicesTvCharacters(params);         // <.> <.> fill in all 
that are possible based on the first param from the UI dialog
-    }
-
-    @MemberSupport public List<TvCharacter> choicesTvCharacters(Parameters 
params) {
-        val tvShowsSelected = params.tvShows();     // <.> <.> as selected in 
first param
-        if(_NullSafe.isEmpty(tvShowsSelected)) {
-            return Collections.emptyList();
-        }
-        return holder.getItems()
-                .stream()
-                .filter(item->tvShowsSelected.contains(item.getTvShow()))
-                .collect(Collectors.toList());
-    }
-}
-
diff --git 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/disable/notes.txt
 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/disable/notes.txt
new file mode 100644
index 0000000000..e9b99e3953
--- /dev/null
+++ 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/disable/notes.txt
@@ -0,0 +1 @@
+example of disabling, with depargs
\ No newline at end of file
diff --git 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/hide/notes.txt
 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/hide/notes.txt
new file mode 100644
index 0000000000..ebe67b80ff
--- /dev/null
+++ 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/hide/notes.txt
@@ -0,0 +1 @@
+example of hiding, with depargs
\ No newline at end of file
diff --git 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/paramstyles/notes.txt
 
b/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/paramstyles/notes.txt
deleted file mode 100644
index dc43dfd80c..0000000000
--- 
a/examples/demo/domain/src/main/java/demoapp/dom/domain/actions/progmodel/paramstyles/notes.txt
+++ /dev/null
@@ -1,117 +0,0 @@
-Idea is that we could show the 3 different ways in which parameters can be 
specified:
-
-- using a numbers
-- using by name.
-- using a `Parameters` class (see below)
-
-Show them all as both regular actions and as mixins.
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-@Action(choicesFrom = "items")
-@ActionLayout(promptStyle = PromptStyle.DIALOG_MODAL)
-@RequiredArgsConstructor
-public class ActionDependentArgs_bulkAction {
-
-    @Inject MessageService messageService;
-
-    private final ActionDependentArgsPage holder;
-
-    @Value @Accessors(fluent = true) // fluent so we can replace this with 
Java(14+) records later
-    static class Parameters {
-        Set<DemoItem> demoItems;
-        int a;
-        Integer b;
-        int c;
-        int d;
-    }
-
-    public ActionDependentArgsPage act(
-
-            // BULK
-            Set<DemoItem> demoItems,
-
-            // PARAM 1
-            @Parameter(optionality = Optionality.MANDATORY)
-            int a,
-
-            // PARAM 2
-            @Parameter(optionality = Optionality.OPTIONAL)
-            Integer b,
-
-            // PARAM 3
-            @Parameter(optionality = Optionality.OPTIONAL)
-            int c,
-
-            // PARAM 4
-            @Parameter(optionality = Optionality.MANDATORY)
-            int d
-
-            ) {
-
-        messageService.informUser("found a fixed point");
-        return holder;
-    }
-
-    // -- PARAM 1
-
-    @MemberSupport public int default1Act(Parameters params) {
-        _Probe.sysOut("p0: %d %d %d %d", params.a, params.b, params.c, 
params.d);
-        return 1;
-    }
-
-    // -- PARAM 2
-
-    @MemberSupport public Integer default2Act(Parameters params) {
-        _Probe.sysOut("p1: %d %d %d %d", params.a, params.b, params.c, 
params.d);
-        return null;
-    }
-
-    // -- PARAM 3
-
-    @MemberSupport public Collection<Integer> choices3Act(Parameters params) {
-        return _Lists.of(1,2,3,4);
-    }
-
-    @MemberSupport public String validate3Act(Parameters params) {
-        return params.c() < 2 ? "please specify c>=2" : null;
-    }
-
-//    @Model
-//    public int default3Act(Parameters params) {
-//        _Probe.sysOut("p2: %d %d %d %d", params.a, params.b, params.c, 
params.d);
-//        return params.b() + 1;
-//    }
-
-    // -- PARAM 4
-
-    @MemberSupport public int default4Act(Parameters params) {
-        _Probe.sysOut("p3: %d %d %d %d", params.a, params.b, params.c, 
params.d);
-        return params.c() + 1;
-    }
-
-//TODO not yet supported
-//    @Model
-//    public String validate3Act(Parameters params) {
-//
-//        int cPlusD = params.c()+params.d();
-//
-//        return (cPlusD%2 == 1)
-//                ? "c plus d must be even"
-//                : null;
-//    }
-
-
-    @MemberSupport public String validateAct(
-            Set<DemoItem> demoItems,
-            int a,
-            Integer b,
-            int c,
-            int d) {
-        return "just failing always";
-    }
-
-
-}
-
diff --git a/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml 
b/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
index eda36ca9b9..6ae9c6ea2a 100644
--- a/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
+++ b/examples/demo/domain/src/main/java/demoapp/dom/menubars.layout.xml
@@ -91,6 +91,7 @@ For latest we use: 
https://raw.githubusercontent.com/apache/causeway/master/anto
                 </mb3:serviceAction>
                 <mb3:serviceAction objectType="demo.ActionChoicesMenu" 
id="choices"/>
                 <mb3:serviceAction objectType="demo.ActionAutoCompleteMenu" 
id="autoComplete"/>
+                <mb3:serviceAction objectType="demo.ActionDefaultsMenu" 
id="defaults"/>
                 <mb3:serviceAction objectType="demo.ActionDependentArgsMenu" 
id="dependentArgsActions">
                     <cpt:named>Dependent Arguments</cpt:named>
                 </mb3:serviceAction>

Reply via email to