Focal Point
[CLOSED] ToggLe HTML link visibility

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6887044186

March 25, 2016, 08:53 AM
Deej
[CLOSED] ToggLe HTML link visibility
I have a link on an HTML page that I need to toggle visibility on based on the user's login credentials. I need it to be visible to certain folks while hiding it from others.

Is there a way to do this without javascript?

Thanks!

This message has been edited. Last edited by: Kathleen Butler,



WebFOCUS 8.1.05
Windows, All Outputs
March 25, 2016, 09:18 AM
BabakNYC
What version of WebFOCUS?


WebFOCUS 8206, Unix, Windows
March 25, 2016, 09:24 AM
Deej
8.1.05



WebFOCUS 8.1.05
Windows, All Outputs
March 25, 2016, 10:25 AM
eric.woerle
Deej,

There is no way to do this without javascript. IBI does provide functions for you to use to hide elements:

Syntax: How to Show or Hide an HTML Element

IbComposer_showHtmlElement('elementID', bShow);

Example: Hiding or Showing a Check Box
function checkbox1_onclick(ctrl){
   var curValue = IbComposer_isSelected('checkbox1');
   IbComposer_showHtmlElement('form1', curValue);
}

  or 
Syntax: How to Enable or Disable an HTML Element
IbComposer_enableHtmlElement('elementID', bEnable);

Example: Enabling or Disabling Elements
function checkbox2_onclick(ctrl){
   IbComposer_enableHtmlElement('listbox1', IbComposer_isSelected('checkbox2', 'country'));
   IbComposer_enableHtmlElement('combobox1', IbComposer_isSelected('checkbox2', 'car'));
   IbComposer_enableHtmlElement('listbox2', IbComposer_isSelected('checkbox2', 'model'));
   IbComposer_enableHtmlElement('combobox2', IbComposer_isSelected('checkbox2', 'dcost'));
}



You will have to identify the users group through a small procedure. It would be best to identify the persons group and allow access based on groups instead of their login ID. I beleive the variable for this in 8.1.05 is &FOCSECGROUPS.

My suggestion would be to create a hidden input in the HTML page and populate it using a procedure. Then create your Javascript function to read the value from the hidden input, and Show/Hide your element depending on that result.

If you add the onInitialUpdate(){} function to your HTML page it will run after your inputs have been populated but before any reports are run
//Begin function onInitialUpdate
function onInitialUpdate(){
hideMyLink();
}
//End function OnInitialUpdate  



Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
March 25, 2016, 10:39 AM
Deej
Thank you for the suggestion Eric. I'm not too polished up on my WebFocus javascript so in the meantime I created a .fex file with the link in the header and applied the user permission to that. Then, pulled the report into the HTML page. So far, it seems to be working like I need it to.

I'll do a little more research into the javascript option.

Thanks again!



WebFOCUS 8.1.05
Windows, All Outputs