SelectUI

This component can dynamically select among a set of other components. This is used to adapt the user interface to the actual data at hand.

Parameters

  • selectF:()=>string – this function will return an identifier of which component you would like to display. This is evaluated every time this component is rendered.

Attributes

  • .choice(selectCode:string,ui:ZUI) -this can be called repeatedly to add choices to this component. If selectCode matches the result of the selectF function then the ui component will be displayed.

Examples

new SelectUI( ()=>{ return pet.type; } )
    .choice("dog", ZUI to display a dog )
    .choice("cat", ZUI to display a cat )
    .choice("pig", ZUI to display a swine );