Skip to content

Commit 44ba5ae

Browse files
committed
Expanding on TreeSelector help texts, ensuring only required fields are marked as required.
1 parent 0caf503 commit 44ba5ae

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

Composite/Plugins/Forms/WebChannel/UiControlFactories/TemplatedTreelSelectorUiControlFactory.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ public Control BuildWebControl()
111111

112112
_userControl.SelectedKey = this.SelectedKey;
113113
_userControl.ElementProvider = this.ElementProvider;
114-
_userControl.SelectableElementPropertyName = this.SelectableElementPropertyName;
115-
_userControl.SelectableElementPropertyValue = this.SelectableElementPropertyValue;
116114
_userControl.SelectableElementReturnValue = this.SelectableElementReturnValue;
115+
_userControl.SelectableElementPropertyName = string.IsNullOrEmpty(this.SelectableElementPropertyName) ? this.SelectableElementReturnValue : this.SelectableElementPropertyName;
116+
_userControl.SelectableElementPropertyValue = this.SelectableElementPropertyValue;
117117
_userControl.SerializedSearchToken = this.SerializedSearchToken;
118118
_userControl.Required = this.Required;
119119

Composite/Plugins/Functions/WidgetFunctionProviders/StandardWidgetFunctionProvider/String/TreeSelectorWidgetFunction.cs

+10-9
Original file line numberDiff line numberDiff line change
@@ -35,39 +35,40 @@ private void SetParameterProfiles()
3535
"Element Provider", new HelpDefinition("The name of a tree element provider (as defined in Composite.config)")));
3636

3737
base.AddParameterProfile(
38-
new ParameterProfile("SelectableElementPropertyName",
38+
new ParameterProfile("SelectableElementReturnValue",
3939
typeof(string),
4040
true,
41-
new ConstantValueProvider(string.Empty),
41+
new ConstantValueProvider("EntityToken"),
4242
StandardWidgetFunctions.TextBoxWidget,
4343
null,
44-
"Selectable Element Property Name", new HelpDefinition("The name of a property used to identify a selectable tree element by")));
44+
"Element field to return", new HelpDefinition("The name of the element field whose value to return for selection. Typical values here can be DataId (for data trees), Uri (for linkable elements), or EntityToken (for any element). Element providers may provide more fields.")));
4545

4646
base.AddParameterProfile(
47-
new ParameterProfile("SelectableElementPropertyValue",
47+
new ParameterProfile("SelectableElementPropertyName",
4848
typeof(string),
4949
false,
5050
new ConstantValueProvider(string.Empty),
5151
StandardWidgetFunctions.TextBoxWidget,
5252
null,
53-
"Selectable Element Property Value", new HelpDefinition("The value of the property optionally used (if provided) to further identify a selectable tree element by")));
53+
"Selection filter, Property Name", new HelpDefinition("An element must have this field to be selectable.")));
5454

5555
base.AddParameterProfile(
56-
new ParameterProfile("SelectableElementReturnValue",
56+
new ParameterProfile("SelectableElementPropertyValue",
5757
typeof(string),
5858
false,
5959
new ConstantValueProvider(string.Empty),
6060
StandardWidgetFunctions.TextBoxWidget,
6161
null,
62-
"Selectable Element Return Value", new HelpDefinition("The value to return for the selected tree element")));
62+
"Selection filter, Property Value", new HelpDefinition("The value of the property optionally used (if provided) to further identify a selectable tree element by. Seperate multiple values with spaces.")));
63+
6364
base.AddParameterProfile(
6465
new ParameterProfile("SerializedSearchToken",
6566
typeof(string),
6667
false,
6768
new ConstantValueProvider(string.Empty),
6869
StandardWidgetFunctions.TextBoxWidget,
6970
null,
70-
"Serialized Search Token", new HelpDefinition("A search token to filter tree elements by")));
71+
"Search Token", new HelpDefinition("A search token, seriallized, to filter which tree elements is shown. To filter what is selectable, use the 'Selection filter' properties.")));
7172
base.AddParameterProfile(
7273
new ParameterProfile("Required",
7374
typeof(bool),
@@ -85,7 +86,7 @@ public override XElement GetWidgetMarkup(ParameterList parameters, string label,
8586
XElement formElement = base.BuildBasicWidgetMarkup("TreeSelector", "SelectedKey", label, helpDefinition, bindingSourceName);
8687
foreach (var propertyName in new []
8788
{
88-
"ElementProvider", "SelectableElementPropertyName", "SelectableElementPropertyValue", "SelectableElementReturnValue", "SerializedSearchToken", "Required"
89+
"ElementProvider", "SelectableElementReturnValue", "SelectableElementPropertyName", "SelectableElementPropertyValue", "SerializedSearchToken", "Required"
8990
})
9091
{
9192
string propertyValue = parameters.GetParameter<string>(propertyName);

0 commit comments

Comments
 (0)