Jump to: navigation, search

Difference between revisions of "Active List Client"


(Introduction {{Version/WinXSince|5.1.0.0}}{{Version/MobileSince|5.1.0.0}}: removed version flags as the version is already covered by the catrgory)
 
(20 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{UnderConstructionStart}}
+
== Introduction ==
 +
If an Active List is defined on a [[Instance|Content Object]] that is associated with an [[MetaProperty#Integer|integer]] [[MetaProperty]], the property is displayed like a usual [[UBIK WinX Client Basics#Selective List Properties|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|SelectiveList]].
  
==Introduction {{Version/WinXSince|5.1.0.0}} {{Version/MobileSince|5.1.0.0}}==
+
{{Hint|There are no visible differences in the UI between an ActiveList and a MetaProperty SelectiveList. For more information about Active Lists follow [[UBIK_Active_Lists|this link]].}}
If an Active List is defined on a [[Instance|Content Object]] that is associated with an [[MetaProperty#Integer|integer]] [[MetaProperty]], the property is displayed like a usual [[UBIK WinX Client Basics#Selective List Properties|SelectiveList]]. 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.
+
  
When the user opens ActiveList:
+
'''Limitations'''
* All available options from the ActiveList are displayed as text labels.
+
<br>
* The label for each option is shown in the language configured on the web service. If a translation for the configured language is unavailable, the label is displayed in the default language.
+
* [[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.
* Each option in the ActiveList has an associated unique integer value that is set to the MetaProperty when selected.
+
* 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.
* Only one option can be selected at a time. Selecting an option updates the MetaProperty value immediately.
+
  
Sorting of items in the dropdown:
+
=== 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. The following XAML changes are necessary:
  
* If all options in the ActiveList have unique sort order values, they are displayed in ascending order of these sort order values.
+
'''Required adaptions of the ''ItemsSource'' binding:'''
* If sort orders are not unique, options with the same sort order are sorted in ascending order by their label.
+
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.
  
{{Hint|There are no visible differences in the UI between an ActiveList and a MetaProperty SelectiveList.}}
+
'''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}'').
=== XAML ===
+
To enable access to an ActiveList from XAML a new property named SelectiveItems was added to the PropertyViewModel. This property returns the ActiveList if one is configured on the content object; otherwise, it falls back to the SelectiveList defined on the MetaProperty if no ActiveList is available for the content object. Below is an example of how this can be implemented in XAML. For the SelectedItem, it is important to use the PropertyValueToSelectiveItem converter and pass the control’s own ItemsSource path as the ConverterParameter, so that the list can be provided to the converter. This means that no DataTriggers or similar mechanisms are required to switch between ActiveLists and MetaProperty SelectiveLists or to perform any checks.
+
  
 
<tabs>
 
<tabs>
<tab name="MAUI">
+
<tab name="Mobile (MAUI)">
 +
 
 +
 
 +
'''after the change:'''
 
<source lang = "xml">
 
<source lang = "xml">
 +
xmlns:controls="clr-namespace:UBIK.MAUI.Controls"
 +
 
<controls:SfListViewExt
 
<controls:SfListViewExt
 
     x:Name="SelectiveList"
 
     x:Name="SelectiveList"
Line 33: Line 37:
 
     SelectionMode="Single"
 
     SelectionMode="Single"
 
     Style="{DynamicResource UBIKListView}" />
 
     Style="{DynamicResource UBIKListView}" />
 +
</source>
 +
 +
 +
'''before the 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>
 
</source>
 
</tab>
 
</tab>
 +
 
<tab name="UWP">
 
<tab name="UWP">
 +
 +
 +
'''after the change:'''
 
<source lang = "xml">
 
<source lang = "xml">
 +
xmlns:controls="using:UBIK.WinX.Controls"
 +
 
<controls:ComboBoxExt
 
<controls:ComboBoxExt
 
     x:Name="ComboBox"
 
     x:Name="ComboBox"
Line 43: Line 73:
 
     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>
 +
 +
 +
'''before the 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 51: Line 98:
 
</tabs>
 
</tabs>
  
{{UnderConstructionEnd}}
+
{{Attention|When binding to ''SelectiveItems'', the ''SelectiveListToItemsConverter'' is outdated and should not be used anymore. Further info see [[UBIK_WinX_Client_Basics#Selective_List_Properties|here]].}}
 +
 
 +
[[Category:Client|Active List Client]]
 +
[[Category:Mobile|Active List Client]]
 +
[[Category:Version 5.1|Active List Client]]
 +
[[Category:WinX|Active List Client]]
 +
 
 +
== See also ==
 +
* [[UBIK Active Lists|Active Lists Server]]
 +
* [[MROCLS PICK LIST TASK|Pick List Task]]
 +
* [[MRO_Objects_(Client)#Pick_List_Task|MRO Objects (Client) Pick List Task]]
  
[[Category:Active List|Active List Client]]
 
 
[[Category:Client|Active List Client]]
 
[[Category:Client|Active List Client]]
 +
[[Category:Mobile|Active List Client]]
 
[[Category:Version 5.1|Active List Client]]
 
[[Category:Version 5.1|Active List Client]]
 +
[[Category:WinX|Active List Client]]

Latest revision as of 14:04, 28 April 2026

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. For more information about Active Lists follow this link.

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. 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)


after the change:

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}" />


before the 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


after the change:

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}}" />


before the 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}}" />
IC Attention.pngWhen binding to SelectiveItems, the SelectiveListToItemsConverter is outdated and should not be used anymore. Further info see here.

See also