Customizing the metamodel > What you can do with USRPROPS/SAPROPS > Layout capabilities > Grids, list boxes, and text boxes > Restricted lists
  
Restricted lists
Restricted lists are activated by making the appropriate changes to the properties files for the properties whose choices are to be restricted. There are two forms of restriction
Syntax
PROPERTY property-name
{ EDIT of-edit-type of-type OF DEFINITION AND SUPERS REFERENCED IN property-name ... }
and
PROPERTY property-name
{ EDIT of-edit-type of-type OF DEFINITION REFERENCED IN property-name ... }
Example
To restrict the choices available to the user when completing the “Operation” property to those methods which belong to the Class identified in the property “To Class”, use:
DEFINITION "Message" { PROPERTY "To Class" { KEY EDIT OneOf "Class" }
...
PROPERTY "Operation"
{ EDIT ParmOneOf "Method" OF DEFINITION REFERENCED IN "To Class" KEYED BY
{ "Class Name" : "To Class", Name, "Formal Parameters"}
LENGTH 1000
HELP "Choose an operation from the choices" }
...
}
To restrict the choices to the methods of the “To Class” or any of its super classes, use:
DEFINITION "Message" { PROPERTY "To Class" { KEY EDIT OneOf "Class" }
...
PROPERTY "Operation"
{ EDIT ParmOneOf "Method" OF DEFINITION AND SUPERS REFERENCED IN "To Class" KEYED BY
{ "Class Name" : "To Class", Name, "Formal Parameters"}
LENGTH 1000
DISPLAY { FORMAT STRING LEGEND "$$NONE$$" }
HELP "Choose an operation from the choices" }
...
}
See also
Grids, list boxes, and text boxes