Disable Hidden Links

Use this board to ask questions or have discussions with other Rich Displays users.
DaveLClarkI
Experienced User
Posts: 165
Joined: Wed Dec 11, 2013 10:40 am
First Name: Dave
Last Name: Clark
Company Name: WinWholesale, Inc.
Phone: 937-294-5331
Address 1: 31101 Kettering Blvd.
City: Dayton
State / Province: Outside Canada/USA
Zip / Postal Code: 45439
Country: United States
Contact:

Disable Hidden Links

Post 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?
User avatar
Brian
Profound Logic Staff Member
Posts: 286
Joined: Thu Apr 14, 2011 10:23 am
First Name: Brian
Last Name: May
Company Name: Profound Logic Software
Contact:

Re: Disable Hidden Links

Post 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.
DaveLClarkI
Experienced User
Posts: 165
Joined: Wed Dec 11, 2013 10:40 am
First Name: Dave
Last Name: Clark
Company Name: WinWholesale, Inc.
Phone: 937-294-5331
Address 1: 31101 Kettering Blvd.
City: Dayton
State / Province: Outside Canada/USA
Zip / Postal Code: 45439
Country: United States
Contact:

Re: Disable Hidden Links

Post 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!!! ;-)
User avatar
Brian
Profound Logic Staff Member
Posts: 286
Joined: Thu Apr 14, 2011 10:23 am
First Name: Brian
Last Name: May
Company Name: Profound Logic Software
Contact:

Re: Disable Hidden Links

Post 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.
DaveLClarkI
Experienced User
Posts: 165
Joined: Wed Dec 11, 2013 10:40 am
First Name: Dave
Last Name: Clark
Company Name: WinWholesale, Inc.
Phone: 937-294-5331
Address 1: 31101 Kettering Blvd.
City: Dayton
State / Province: Outside Canada/USA
Zip / Postal Code: 45439
Country: United States
Contact:

Re: Disable Hidden Links

Post 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."
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Disable Hidden Links

Post 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.
User avatar
Alex
Profound Logic Staff Member
Posts: 233
Joined: Fri Jan 04, 2008 12:10 pm
First Name: Alex
Last Name: Roytman
Company Name: Profound Logic Software
Contact:

Re: Disable Hidden Links

Post 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.
User avatar
Brian
Profound Logic Staff Member
Posts: 286
Joined: Thu Apr 14, 2011 10:23 am
First Name: Brian
Last Name: May
Company Name: Profound Logic Software
Contact:

Re: Disable Hidden Links

Post 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?
DaveLClarkI
Experienced User
Posts: 165
Joined: Wed Dec 11, 2013 10:40 am
First Name: Dave
Last Name: Clark
Company Name: WinWholesale, Inc.
Phone: 937-294-5331
Address 1: 31101 Kettering Blvd.
City: Dayton
State / Province: Outside Canada/USA
Zip / Postal Code: 45439
Country: United States
Contact:

Re: Disable Hidden Links

Post 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;                                                               
DaveLClarkI
Experienced User
Posts: 165
Joined: Wed Dec 11, 2013 10:40 am
First Name: Dave
Last Name: Clark
Company Name: WinWholesale, Inc.
Phone: 937-294-5331
Address 1: 31101 Kettering Blvd.
City: Dayton
State / Province: Outside Canada/USA
Zip / Postal Code: 45439
Country: United States
Contact:

Re: Disable Hidden Links

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests