CB:  typo: on “Show” the   .and( ) basically makes the .es = to the 
.es_Selected [but they are not the same entity selection].

— 

> On Sep 23, 2019, at 4:35 AM, Chris Belanger <[email protected]> wrote:
> 
> I have a listBox with an Entity Selection as its dataSource.
> I want to support standard ‘set manipulations’ such as   HIDE,  SHOW,  SHOW 
> ALL,  SELECT ALL [yes, I realize these are not 4D sets, but 
> collections…terminology…]
> 
> Given that:
> Form.es  = entity selection displayed in the ListBox
> Form.es_Selection = “Selected Items” in the listbox 
> 
> I am able to easily HIDE or SHOW the "Selected Items”
> : ($1.parameter="Hide")       
>               Form.es:=Form.es.minus(Form.es_Selected)  // remove the 
> selection
>               Form.es_Selected:=Form.es.getDataClass().newSelection()  // 
> change this to a NEW BLANK selection
> 
> : ($1.parameter="Show")
>               Form.es:=Form.es.and(Form.es_Selected)  // remove the selection
>               Form.es_Selected:=Form.es.getDataClass().newSelection()  // 
> change this to a NEW BLANK selection
> 
> 
> but “SELECT ALL” is giving me issues.
> I can easily set the ‘Selected Items’ to be the same as the Entity Selection
> Form.es_Selected:=Form.es.or(Form.es_Selected)  // select all the records     
>         
>               
> but even though this makes the ‘Selected Items’ the same as the entity 
> selection. It is not reflected in the appearance of the listBox (i.e. all 
> rows are NOT selected as desired)
> I also tried:
> INVOKE ACTION(ak select all) — no affect
> 
> also tried:
> Form.es_Selected:=Form.es.or(Form.es_Selected)  // select all the records     
>         
> Form.es:=Form.es  // cause a re-draw — BUT IT DOESN’T!
> 
> ----
> So does anyone know how to simulate   SELECT ALL in a listbox that has an 
> entity Selection as a datasource?
> 
> thanks,
> Chris

**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to