PreviousNextIndex

VIEW-AS phrase

Defines a compile-time defined (static) widget to represent a field or variable on the screen.

Note: Does not apply to SpeedScript programming.
Syntax

VIEW-AS  
  {    combo-box-phrase 
     |  editor-phrase 
     |  FILL-IN 
          [ NATIVE ] 
          [ size-phrase ] 
          [ TOOLTIP tooltip ] 
     |  radio-set-phrase 
     |  selection-list-phrase 
     |  slider-phrase 
     |  TEXT 
          [ size-phrase ] 
          [ TOOLTIP tooltip ] 
     |  TOGGLE-BOX 
          [ size-phrase ] 
          [ TOOLTIP tooltip ] 
  } 

Use the following syntax to specify the type of widget to use for displaying values in a browse column:

VIEW-AS combo-box-phrase | TOGGLE-BOX  

combo-box-phrase
editor-phrase
FILL-IN [ NATIVE ] [ size-phrase ]
radio-set-phrase
selection-list-phrase
slider-phrase
TEXT [ size-phrase ]
TOGGLE-BOX [ size-phrase ]
TOOLTIP tooltip
Example

The following procedure defines a character variable and views it in succession as a text widget, a fill-in widget, an editor widget, and finally as a text widget again. The procedure shows that you can represent a character variable in several ways, as long as each representation appears in a separate frame.

r-viewas.p
DEFINE VARIABLE test AS CHARACTER NO-UNDO INITIAL "Now is the time" 
  FORMAT "x(30)". 
DISPLAY test VIEW-AS TEXT LABEL "Labels cannot be changed" 
  WITH FRAME a SIDE-LABELS. 
PAUSE. 
UPDATE test VIEW-AS FILL-IN LABEL "But fillins can, please enter a new value" 
  WITH FRAME b SIDE-LABELS. 
UPDATE test VIEW-AS EDITOR INNER-CHARS 16 INNER-LINES 2 MAX-CHARS 70 
  LABEL  "As can editors, please enter a new value:" 
  WITH FRAME c.  
DISPLAY test VIEW-AS TEXT FORMAT "x(70)" LABEL "The final value is:" 
  WITH FRAME d. 

For additional examples, see the COMBO-BOX phrase, EDITOR phrase, RADIO-SET phrase, SELECTION-LIST phrase, and SLIDER phrase reference entries.

Notes
See also

COMBO-BOX phrase, EDITOR phrase, RADIO-SET phrase, SELECTION-LIST phrase, SIZE phrase, SLIDER phrase


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex