Consultor Eletrônico



Kbase P19125: What is the difference between HIDDEN and VISIBLE?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   9/16/2008
Status: Verified

GOAL:

What is the difference between HIDDEN and VISIBLE?

GOAL:

Why to use HIDDEN instead of VISIBLE?

GOAL:

How HIDDEN attribute works?

GOAL:

How VISIBLE attribute works?

FACT(s) (Environment):

Progress 9.x
OpenEdge 10.x
All Supported Operating Systems

FIX:

The HIDDEN and VISIBLE attributes are not simple opposites of each other.

To selectively show different aspects of the interface the HIDDEN attribute needs to be set. In some cases, some fields need to be hidden from some users. In other cases, a screen needs to be hidden while programmatically its content is manipulated.

The reason that HIDDEN should be used is that VISIBLE has side effects. VISIBLE was added to the PROGRESS 4GL in Version 7 to parallel the behavior of the keyword VIEW.

Both VIEW and VISIBLE, when applied to an object, implicitly make other objects visible.

Ex. If you view a button, the frame that contains it and the window that contains the frame are also made visible. The following code sample shows this behavior when run from the
Procedure Editor.

DEFINE BUTTON b LABEL "Hello, World".
DEFINE FRAME f
b AT ROW 1 COLUMN 1 WITH NO-LABELS.
ASSIGN b:VISIBLE = YES.

Running the above program will make the "Hello, World" button visible. But because the button won't actually be seen until the parent frame is made visible, PROGRESS will do that too.
Compare this to the following program. If you run this program you should not be able to see either the frame or the button.

DEFINE BUTTON b LABEL "Hello, World".
DEFINE FRAME f
b AT ROW 1 COLUMN 1 WITH NO-LABELS.
ASSIGN b:HIDDEN = NO.

Even though the button is not HIDDEN, the user never sees it because its container has not been explicitly viewed.

When setting up the content of a frame, the timing of when that frame is made visible needs to be controlled to users. The frame cannot appears before it is ready to be seen. If the VISIBLE attribute is used on objects in the frame, there is a chance that the frame will appear before all your setup code has executed.

Because of these reasons, it is always safer to set the HIDDEN attribute.