Using The Selector


SeedCode Complete comes with a generic "selector" you can use instead of value lists to present a list of choices to your users. This is probably one of the most useful aspects of Complete when you're extending and customizing it.

You can see the selector in use on the Projects layout: click the button "add milestones from a template" on the Schedule tab. The mini-window that pops up is our selector and it can show any list of items. In this case it is showing a list of milestone templates of the type "project".

Getting to know the selector will definitely save you time as you make mods to Complete.

How it works

The entire selection process is run in the script "Load and Display Selector ( SelectValues ) { SelectIDs , MultipleSelection , SelectedValue... }"
This works by taking a list of values you pass in, and displaying these in a portal-- a special "virtual list" portal that can be used to show anything. You can pass in just a list of text phrases, or you can pass a second parameter containing a list of IDs corresponding to the list of values: this is what you'd do if you were using this to select records from a table.
The notes at the beginning of this script describe all the parameters than can be passed into this script. For an example of what it looks like when you call this, check out the "Perform Script" step after the comment "Select A Process for this Project" in the script "Select A Process for this Project".
The results of the selection can be retrieved using Get ( ScriptResult ) immediately after step performing "Load and Display Selector.."
Selection is done on the layout "Generic Selector". Note that there are merge fields in the top blue section and in the blue section below the portal used to show a description and instructions: these are passed into the "Load and Display Selector.." scripts as the SelectNames and SelectNotes parameters.
The "SelectValues" parameter can support text formatting, so while you can only pass one phrase in per line, you can format this with bolding and text coloring before you pass it to the "Load and Display Selector..." script so you can end up with a very nice display here.
This selector can only show as many rows as there are records in the CalendarRows table (notes on adding rows here are the same as adding calendar rows). This effectively means that you can only see 100 rows or so here: so this is best used for shorter lists that users don't have scroll too deeply (less than 100 rows, tops).
Follow us: