Jump to: navigation, search

Difference between revisions of "Active List Client"


m
m (XAML)
 
(5 intermediate revisions by the same user not shown)
Line 5: Line 5:
  
 
{{Hint|There are no visible differences in the UI between an ActiveList and a MetaProperty SelectiveList.}}
 
{{Hint|There are no visible differences in the UI between an ActiveList and a MetaProperty SelectiveList.}}
 +
 +
'''Limitations'''
 +
<br>
 +
* [[Multi_Select_%28UBIK_Client%29#Editing_common_properties_of_selected_items_.28UWP_only.29|Mass editing]] is currently not supported for Properties containing Active Lists.
 +
* Copy and Paste for Active Lists is not supported. When copying an object containing Active Lists, the copy of the object will not contain these Active Lists. In this case, the editing UI of the pasted object will appear like that of a standard Integer Property. If a value has already been selected, this value will be copied, though.
  
 
=== XAML ===
 
=== XAML ===
A new SelectiveItems property was added to the PropertyViewModel to enable access to an ActiveList via XAML. No DataTriggers or additional checks are required, as the correct list selection is handled automatically.
+
A new SelectiveItems property was added to the PropertyViewModel to enable access to an ActiveList via XAML. No DataTriggers or additional checks are required, as the correct list selection is handled automatically. As also mentioned [[UBIK_WinX_Client_Basics#Selective_List_Properties|here]], the following XAML changes are necessary:
 +
 
 +
'''Required adaptions of the ''ItemsSource'' binding:'''
 +
If you have old customizings, the '''ItemsSource''' binding needs to be adapted. Instead of binding to the ''PropertyViewModel'' and using the ''SelectiveListToItemsConverter'', you should now directly bind to ''PropertyViewModel.SelectiveItems'' without the use of a SelectiveListToItemsConverter. In the case of previously binding to ''MetaProperty.SelectiveList.Items'' (or ''MetaProperty.SelectiveList'' plus using the ''SelectiveListToItemsConverter''), the binding should be changed to ''SelectiveItems'' only.
 +
Depending on whether a SelectiveList or an ActiveList is configured, the proper list will be chosen automatically.
 +
 
 +
'''Refactoring of the ''SelectedItem ConverterParameter'' binding (Mobile only):'''
 +
Instead of binding to the ContentView x:Name (e.g. ''ConverterParameter={Binding Source={x:Reference YourContentView}}''), it should be changed to the x:Name of the SfListViewExt control and adding the ItemsSource as Path (e.g. ''ConverterParameter={Binding Source={x:Reference SelectiveList}, Path=ItemsSource}'').
  
 
<tabs>
 
<tabs>
Line 36: Line 48:
 
     DisplayMemberPath="DisplayText"
 
     DisplayMemberPath="DisplayText"
 
     ItemsSource="{Binding PropertyViewModel.SelectiveItems}"
 
     ItemsSource="{Binding PropertyViewModel.SelectiveItems}"
 +
    PlaceholderText="{Binding PropertyEdit_PickerPlaceholder, Source={StaticResource AppResources}}"
 +
    SelectedValue="{Binding PropertyValue, Mode=TwoWay}"
 +
    SelectedValuePath="Value"
 +
    Visibility="{Binding PropertyViewModel.ShowComboBox, Converter={StaticResource BoolToVisConverter}}" />
 +
</source>
 +
</tab>
 +
 +
<tab name="Mobile (MAUI) before change">
 +
<source lang = "xml">
 +
xmlns:controls="clr-namespace:UBIK.MAUI.Controls"
 +
 +
<ContentView x:Name="YourContentView" ...>
 +
  <controls:SfListViewExt
 +
      x:Name="SelectiveList"
 +
      BindingContext="{TemplateBinding BindingContext}"
 +
      ItemSize="40"
 +
      ItemTemplate="{StaticResource PopupSelectiveListItemTemplate}"
 +
      ItemsSource="{Binding PropertyViewModel, Converter={StaticResource SelectiveListToItems}}"
 +
      SelectedItem="{Binding ValueItem.PropertyValue, Mode=OneWay, Converter={StaticResource PropertyValueToSelectiveItem}, ConverterParameter={Binding Source={x:Reference YourContentView}}}"
 +
      SelectionBackground="{DynamicResource UBIKAccentColor}"
 +
      SelectionMode="Single"
 +
      Style="{DynamicResource UBIKListView}" />
 +
  ...
 +
</ContentView>
 +
</source>
 +
</tab>
 +
<tab name="UWP before change">
 +
<source lang = "xml">
 +
xmlns:controls="using:UBIK.WinX.Controls"
 +
 +
<controls:ComboBoxExt
 +
    x:Name="ComboBox"
 +
    Grid.ColumnSpan="2"
 +
    HorizontalAlignment="Stretch"
 +
    DisplayMemberPath="DisplayText"
 +
    ItemsSource="{Binding PropertyViewModel, Converter={StaticResource SelectiveListToItemsConverter}}"
 
     PlaceholderText="{Binding PropertyEdit_PickerPlaceholder, Source={StaticResource AppResources}}"
 
     PlaceholderText="{Binding PropertyEdit_PickerPlaceholder, Source={StaticResource AppResources}}"
 
     SelectedValue="{Binding PropertyValue, Mode=TwoWay}"
 
     SelectedValue="{Binding PropertyValue, Mode=TwoWay}"
Line 44: Line 92:
 
</tabs>
 
</tabs>
  
 +
[[Category:Client|Active List Client]]
 +
[[Category:Mobile|Active List Client]]
 +
[[Category:Version 5.1|Active List Client]]
 +
[[Category:WinX|Active List Client]]
  
 
== See also ==
 
== See also ==

Latest revision as of 13:49, 23 April 2026

Wiki Under Construction Start.PNG

Introduction

If an Active List is defined on a Content Object that is associated with an integer MetaProperty, the property is displayed like a usual SelectiveList which is based on a MetaProperty. An ActiveList (i.e., if it has been configured on the server for a content object) always takes precedence over a MetaProperty SelectiveList. For editing, it behaves exactly the same as with a standard SelectiveList.

IC Hint square.pngThere are no visible differences in the UI between an ActiveList and a MetaProperty SelectiveList.

Limitations

  • Mass editing is currently not supported for Properties containing Active Lists.
  • Copy and Paste for Active Lists is not supported. When copying an object containing Active Lists, the copy of the object will not contain these Active Lists. In this case, the editing UI of the pasted object will appear like that of a standard Integer Property. If a value has already been selected, this value will be copied, though.

XAML

A new SelectiveItems property was added to the PropertyViewModel to enable access to an ActiveList via XAML. No DataTriggers or additional checks are required, as the correct list selection is handled automatically. As also mentioned here, the following XAML changes are necessary:

Required adaptions of the ItemsSource binding: If you have old customizings, the ItemsSource binding needs to be adapted. Instead of binding to the PropertyViewModel and using the SelectiveListToItemsConverter, you should now directly bind to PropertyViewModel.SelectiveItems without the use of a SelectiveListToItemsConverter. In the case of previously binding to MetaProperty.SelectiveList.Items (or MetaProperty.SelectiveList plus using the SelectiveListToItemsConverter), the binding should be changed to SelectiveItems only. Depending on whether a SelectiveList or an ActiveList is configured, the proper list will be chosen automatically.

Refactoring of the SelectedItem ConverterParameter binding (Mobile only): Instead of binding to the ContentView x:Name (e.g. ConverterParameter={Binding Source={x:Reference YourContentView}}), it should be changed to the x:Name of the SfListViewExt control and adding the ItemsSource as Path (e.g. ConverterParameter={Binding Source={x:Reference SelectiveList}, Path=ItemsSource}).

Mobile (MAUI)

xmlns:controls="clr-namespace:UBIK.MAUI.Controls"

<controls:SfListViewExt
   x:Name="SelectiveList"
   BindingContext="{TemplateBinding BindingContext}"
   ItemSize="40"
   ItemTemplate="{StaticResource PopupSelectiveListItemTemplate}"
   ItemsSource="{Binding SelectiveItems}"
   SelectedItem="{Binding ValueItem.PropertyValue, Mode=OneWay, Converter={StaticResource PropertyValueToSelectiveItem}, ConverterParameter={Binding Source={x:Reference SelectiveList}, Path=ItemsSource}}"
   SelectionBackground="{DynamicResource UBIKAccentColor}"
   SelectionMode="Single"
   Style="{DynamicResource UBIKListView}" />

UWP

xmlns:controls="using:UBIK.WinX.Controls"

<controls:ComboBoxExt
   x:Name="ComboBox"
   Grid.ColumnSpan="2"
   HorizontalAlignment="Stretch"
   DisplayMemberPath="DisplayText"
   ItemsSource="{Binding PropertyViewModel.SelectiveItems}"
   PlaceholderText="{Binding PropertyEdit_PickerPlaceholder, Source={StaticResource AppResources}}"
   SelectedValue="{Binding PropertyValue, Mode=TwoWay}"
   SelectedValuePath="Value"
   Visibility="{Binding PropertyViewModel.ShowComboBox, Converter={StaticResource BoolToVisConverter}}" />

Mobile (MAUI) before change

xmlns:controls="clr-namespace:UBIK.MAUI.Controls"

<ContentView x:Name="YourContentView" ...>
   <controls:SfListViewExt
      x:Name="SelectiveList"
      BindingContext="{TemplateBinding BindingContext}"
      ItemSize="40"
      ItemTemplate="{StaticResource PopupSelectiveListItemTemplate}"
      ItemsSource="{Binding PropertyViewModel, Converter={StaticResource SelectiveListToItems}}"
      SelectedItem="{Binding ValueItem.PropertyValue, Mode=OneWay, Converter={StaticResource PropertyValueToSelectiveItem}, ConverterParameter={Binding Source={x:Reference YourContentView}}}"
      SelectionBackground="{DynamicResource UBIKAccentColor}"
      SelectionMode="Single"
      Style="{DynamicResource UBIKListView}" />
   ...
</ContentView>

UWP before change

xmlns:controls="using:UBIK.WinX.Controls"

<controls:ComboBoxExt
   x:Name="ComboBox"
   Grid.ColumnSpan="2"
   HorizontalAlignment="Stretch"
   DisplayMemberPath="DisplayText"
   ItemsSource="{Binding PropertyViewModel, Converter={StaticResource SelectiveListToItemsConverter}}"
   PlaceholderText="{Binding PropertyEdit_PickerPlaceholder, Source={StaticResource AppResources}}"
   SelectedValue="{Binding PropertyValue, Mode=TwoWay}"
   SelectedValuePath="Value"
   Visibility="{Binding PropertyViewModel.ShowComboBox, Converter={StaticResource BoolToVisConverter}}" />

See also

Wiki Under Construction End.PNG