Page MenuHomePhabricator

[MVVM] Model Selection Support
Open, TODOPublic


Currently Efl.Model_Composite_Selection support "Exclusive" property,
but we need to verify and publish multiple selection.
Also it may better to publish API for multiselection not only support exclusive by property_set.

SanghyeonLee triaged this task as TODO priority.

We agree with that. If I'm not mistaken some of this API is already in master, right?

yes as far as I know. and only we need to verifying them. I think we could expose some API for user-convenience.

cedric added a subscriber: cedric.Nov 16 2018, 10:59 AM

If I remember correctly, I think I was thinking of using a simple composite boolean for the multi selection case. As the Efl.Model_Composite_Selection inherit from it, if there are helper and API user-convenience function you are thinking of, it would indeed make sense to add the non exclusive mode to Composite_Selection and provide the helper there. Do you have a list of helper you are thinking of ?

here it may confusing me,
you meant, Composite_Boolean will stay for multi selection and Composite_Selection will only works in single selection?

About the helper,
this CompositeModel is obviously kind of ViewModel,
and Selection is the property which can change the UI of View also.
I hope user only need to take care about this helper only,
and View is trigger the selection changes by helper automatically,
so no additional user action required.

the feature of selection is quite clear enough I think,

  1. Single Selection

select item
deselect item
is select
get selected item

  1. Multi Selection

select item
deselect item
select items(range or list?)
is select
get selected items
select all
deselect all

is enough,
but the one thing we might consider about helper is,
which structure data is best for user get/controls series of selected items.

Hum, I think your point for having helper on the selection model make sense. That make a good reason for having the multiple selection as its own class or integrated with the single selection. I think it make sense to have one class for single selection which would have a single property to fetch to find the selected item, and another class for multi selection that could have an iterator that return only the selected item.

What do you think of that plan ?

zmike moved this task from Backlog to Cedric on the efl: mvvm board.

We could merge the idea of multi selection and selection class model into one class easily, so let's do it that way.

So in Efl.Select_Model:

  • Add a property that return an iterator<uint64> for all the selected children where the uint64 is the index of the children that is selected.
  • Add a property that return an iterator<uint64> for all the unselected children where the uint64 is the index of the children that is unselected.
  • Add an Eo property and a Model property that turn on/off the multi selected capability.

I think that would cover the complete case. Also to stabilize the class right away, I would move it to be an internal only class as it is to be used by ListView, GridView and TreeView for the time being.

cedric added a comment.Apr 3 2019, 2:25 PM

I have pushed in my branch devs/cedric/mvvm a few patch that should solve this. I will push this to phab once the release cycle is done to not pollute things.