Tinderbox v9 Icon

Pre-populating Displayed Attributes pop-up lists

When string-based attributes (String, List, Set) are shown as Displayed Attributes, once discrete values are added to the attribute these are all shown via a pop-up list via the triangular icon at the right end of the attribute value edit box. For fast entry, autocompletion using matched list items is also possible. However, do bear in mind limitations on the length of and number of entries in these lists.

Or set Suggested value lists. These can be set manually via the Inspector for user attributes (and some system attributes) or by using action code. consider an attribute $MyStatus that will hold the status of bids. To preset 3 suggested values 'won', 'pending' and lost':

attribute("MyStatus")[suggested]=[won;pending;lost]; 

But, what if that list needed to change is a new default status was added, e.g. a 'cancelled'. The above list could be stored in a list attribute that could be edited as a Displayed Attributes avoiding having to set the value is code. Another way can be used is there is a note for each potential value. Thus a container 'Bid States' might hold child notes 'won', 'pending', 'lost'. This code can be used to set the $MyStatus suggested values from the children of the 'Bid States' container:

attribute("Bid States")[suggested]=collect(children(/Status),$Name); 

If that code is run as a rule or edict, whenever a new note is added to, deleted from or renamed in that container, the suggested values will get updated.