on 2010 Apr 27 7:49 AM
Hello,
Seems lots of people think that visibility is a boolean. Whereas it is, in fact, a tri-state variable with: blank, none, and visible as possible values.
Now when you have something like this, it is always good to have a constant that you can use to define these value.
It seems to me that there are quite a few different places where these values are defined as public constants.
Which one should we be using?
wdyn_ui_visibility_blank etc from type group WDYN? (seems that there are quite a few good constants defined here. - but aren't type groups a depreciated coding practice?)
if_wdl_core=>visibility_blank etc from class if_wdl_core ??
And if I searched a bit I'm sure I'd find more. The domain has them as a fixed list - not that it makes it any easier.
The pseudo boolean constants ABAP_TRUE and ABAP_FALSE and ubiquitous - not so with WD constants.
In WD Java there was 1 reference against the class that defined the type. Some may say that because WD ABAP is more flexible in this case (allows pseudo booleans to be used for visibility) it is better, I'd probably disagree (in this case). I worry that without a single good reference point, there is risk of different components using the same values for different meanings.
Anyway - to sum up what is really more a rant than a question - what should we use?
Cheers,
Chris
Hi Chris - just to be crazy - I would recommend the following constants:
IFUR_NW7=>VISIBILITY_VISIBILE = 1
IFUR_NW7=>VISIBILITY_BLANK = 2
IFUR_NW7=>VISIBILITY_NONE = 3
After all, why use something as sensible as blank = '00'?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
10 | |
10 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.