Page 1 of 2
Disable Hidden Links
Posted: Mon Dec 23, 2013 2:53 pm
by DaveLClarkI
I have a hidden link to support the use of a function key. However, under certain conditions, the use of that function key should not be allowed. I would prefer that the function key simply be ignored and I thought I could accomplish that by simply disabling the link to which the function key shortcut is assigned.
I just tested that, though, and it is not working -- i.e., it still allows the associated response indicator to be sent to the RPG program when the function key is pressed. I'm passing the word 'true' or 'false' in the indicator variable assigned to the "disabled" property for the link. Seems to me that should work -- but it doesn't. Help?
Re: Disable Hidden Links
Posted: Mon Dec 23, 2013 4:19 pm
by Brian
Hi Dave,
I am assuming you are setting this property in the RPG program? If so, you wouldn't pass in "true" or "false" as literals. You would just set the indicator equal to *ON or *OFF in your program. If you need more assistance, please don't hesitate to ask.
Re: Disable Hidden Links
Posted: Mon Dec 23, 2013 4:27 pm
by DaveLClarkI
Bonkers! Why is the "visibility" property handled differently from the "disabled" property in terms of how it is bound to an RPG variable? Aaarrrggghhh!!! ;-)
Re: Disable Hidden Links
Posted: Mon Dec 23, 2013 4:53 pm
by Brian
It is not. You would bind an indicator to to the visibility property and turn it *On or *Off in the same manner.
Re: Disable Hidden Links
Posted: Mon Dec 23, 2013 4:59 pm
by DaveLClarkI
Well, the Profound designer disagrees with you. There are two different dialogs that are displayed for the two different properties. The dialog for the "visibility" property allows you to specify what the content of the indicator will be. The dialog for the "disabled" property does not. But, both dialogs state that the binding is for an "indicator."
Re: Disable Hidden Links
Posted: Mon Dec 23, 2013 5:05 pm
by Scott Klement
I'm confused. How do you put 'true' or 'false' into an indicator variable? Aren't indicator variables limited to one byte?
I agree with you that 'visibility' is a little different. In visibility, you need to make the indicator represent the words 'visible' or 'hidden'. You adjust the formatting so that *ON is either visible or hidden, and *OFF is either visible or hidden, depending on how you set up the formatting.
Re: Disable Hidden Links
Posted: Mon Dec 23, 2013 5:10 pm
by Alex
The disabled property is based on the HTML attribute "disabled" and can only be true or false, controlled by an RPG indicator which is set to *On or *Off respectively.
The visibility property is based on the CSS property "visibility", and can potentially have more options:
visible
hidden
collapse
inherit
That's why the binding dialog has more options. But the most common options are visible and hidden (the others are barely used). So the default settings in the dialog just allow you to use an RPG indicator with *On or *Off, just as you would with the disabled property.
Re: Disable Hidden Links
Posted: Mon Dec 23, 2013 5:11 pm
by Brian
True the dialogs are different. However, if you use the Indicator data type on the Visibility property, you would set that indicator to *On or *Off, just like the Disabled property. The indicator format option tells the PUI runtime what to translate the *On or *Off into.
Now, if you choose to define your datatype for the Visibility property as Character, then yes you would pass the literals of visible/hidden to the screen. Does that make more sense?
Re: Disable Hidden Links
Posted: Mon Dec 23, 2013 5:14 pm
by DaveLClarkI
Scott Klement wrote:I'm confused.
Yeah, I'm confused, too. ;-) I guess this code in my RPG program is just plumb wrong!
Code: Select all
if (pRunMode <> 'MAINT'); // if not running in maintenance mode
maint_vis = 'hidden'; // remove maintenance column
insert_dis = *on; // disable insert link
else; // else
maint_vis = 'visible'; // leave maintenance column
insert_dis = *off; // enable insert link
endif;
Re: Disable Hidden Links
Posted: Mon Dec 23, 2013 5:20 pm
by DaveLClarkI
Brian wrote:True the dialogs are different. However, if you use the Indicator data type on the Visibility property, you would set that indicator to *On or *Off, just like the Disabled property. The indicator format option tells the PUI runtime what to translate the *On or *Off into.
Now, if you choose to define your datatype for the Visibility property as Character, then yes you would pass the literals of visible/hidden to the screen. Does that make more sense?
I'm clear now. And, long story short, disabling the link (correctly) results in preventing the function key from being recognized. Thanks.