Focal Point
[SOLVED] Portal/Page Filters

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

August 01, 2017, 02:01 PM
MeM
[SOLVED] Portal/Page Filters
I have created a portal with which I have specific filters that should be applied to the entire portal, but I will also have filters that are page/tab specific. Is there a way to have one html page with all the filters, and only the appropriate filters are active based on the page the user is on? I am running into issues having a portal filter and a separate page filter when the portal refreshes.

Version 8.105

This message has been edited. Last edited by: MeM,


WebFOCUS 8.2.02
Windows, All Outputs
August 01, 2017, 03:23 PM
MartinY
I also ran into this need a few months ago and this is not something yet available (8105).

What I did is to create an HTML page with multiple tabs and then manage (with js/jquery) the displayed selection (displayed outside the tab control) based on selected tab.
Such a pain...


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
August 01, 2017, 04:01 PM
MeM
Thank you Martin. Do you have any basic example of the js/jquery?


WebFOCUS 8.2.02
Windows, All Outputs
August 02, 2017, 08:32 AM
MartinY
Basic sample...not really. I did a lot of search on js and jquery with trial and error before I've been able to find a combination that is working with WF8 and the way IBI generates the HTML.
The greatest challenge was with the tab control where each tab don't have a unique id that can be easily referred as in WF7.

So basically I would say that

- step 1 is to hide the specific control to a tab in the onInitialUpdate() function using :
function onInitialUpdate() {
   repTabStatus = 'Hidden';
   showDLStatus = 'Displayed';
   IbComposer_showHtmlElement('lrep',0);
   IbComposer_showHtmlElement('rep',0);
   hideTabRep();
}

- step 2 define a function for tabOnclick() where you will need to test the tab's name. I also had to defined internal variables to determine if my specific control are displayed and if I have the specific tab selected :
function MyTabCtrl_onclick(event) {
  $(document).ready(function(){
     var eventObject = event ? event : window.event;
     selTab = eventObject.target ? eventObject.target : eventObject.srcElement;
     if ((selTab.innerText == '!IBI.AMP.#SALESMANTRACK;') || (repTabStatus == 'OnTop' && showDLStatus == 'Displayed') )
          hideDL ();
     else
     {
          if (repTabStatus == 'OnTop')
             repTabStatus = 'Displayed';
          showDL ();
     }
  });
}

- step 3 you have to play around with your own conditions to show/display controls and tab. Here few function sample.
function QtrMthSel_onclick(event) {
   var eventObject = event ? event : window.event;
   var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement;
   // When select by quarter hide DailyEvolution tab
   if (QtrMthSel1.checked == true)
   {
      hideTabDaily();
      IbComposer_showHtmlElement("QTR",1);
      IbComposer_showHtmlElement("period",0);
   }
   else
   {
      showTabDaily();
      IbComposer_showHtmlElement("QTR", 0);
      IbComposer_showHtmlElement("period",1);
   }
}

function customer_onchange(event) {
   var eventObject = event ? event : window.event;
   var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement;
   var curCust = IbComposer_getCurrentSelection('customer');
   if ((curCust != 'FOC_NOSELECTION' && curCust != '_FOC_NULL' && curCust != 'FOC_NONE') || curCust == 'NODATA')
       hideTabRep ();
   else
       showTabRep ();
}
function showTabRep () {
  $(document).ready(function(){
    repTabStatus = "Displayed";
    $("#MyTabCtrl").children(":first").next().next().show();
   });
}
function hideTabRep () {
  $(document).ready(function(){
    repTabStatus = "Hidden";
    $("#MyTabCtrl").children(":first").next().next().hide();
    IbComposer_showHtmlElement("QMSales", 0);
    IbComposer_selectTab("MyTabCtrl", 1);
    showDL();
   });
}
function hideTabDaily () {
  $(document).ready(function(){
    $("#MyTabCtrl").children(":first").next().hide();
    IbComposer_showHtmlElement("DailyGraph", 0);
    IbComposer_selectTab("MyTabCtrl", 1);
    showDL ();
  });
}
function showTabDaily () {
  $(document).ready(function(){
    $("#MyTabCtrl").children(":first").next().show();
    IbComposer_showHtmlElement("DailyGraph", 1);
    IbComposer_selectTab("MyTabCtrl", 1);
    showDL ();
  });
}
function hideDL () {
// when rep is chosen, hide the following drop down lists, labels and change position
    IbComposer_selectTab("MyTabCtrl", 3);
    repTabStatus = "OnTop";
    showDLStatus = 'Hidden';
    IbComposer_showHtmlElement('lcomp',0);
    IbComposer_getComponentById("lrep").style.left='340px';
    IbComposer_getComponentById("rep").style.top='20px';
}
function showDL () {
// when rep is not chosen, show the following drop down lists, labels and change position
    showDLStatus = 'Displayed';
    IbComposer_showHtmlElement('lrep',1);
    IbComposer_showHtmlElement('rep',1);
    IbComposer_getComponentById("lrep").style.left='700px';
    IbComposer_getComponentById("rep").style.top='70px';


- step 4, a lot of tests...

Hope that this may help.
It's not the only solution. But in my case, it was the one that works.


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
August 02, 2017, 04:01 PM
MeM
Thank you Martin!


WebFOCUS 8.2.02
Windows, All Outputs