Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS Designer Forum on Focal Point     [SOLVED] Button addEventListener
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] Button addEventListener
 Login/Join
 
Platinum Member
posted
I'm trying to add custom buttons to the panel and it works if I open any URLs or reports but, I'd like to pass the parms along with it, for eg., EXL Download for the same report with prms selected. I tried with &PARM=&PARM but no luck

   window.addEventListener("iba_pageloading", function (e){
    var panel = document.querySelector(".custom1").ibaObject;
    var ibsite = panel.addButton({"glyphClasses": "fa fa-question", "class": "ibButton", "tooltip": "Visit IB Site"}, ".pd-container-title-button-resize", true);
    var exl = panel.addButton({"glyphClasses": "fa fa-file-excel-o", "class": "ibButton", "tooltip": "Excel Dowload"}, ".pd-container-title-button-resize", true);
    ibsite.addEventListener("click", function(){
        window.open("http://www.ibi.com");
    });
    exl.addEventListener("click", function(){
        window.open='./wfirs/ibfs/WFC/Repository/COE/USB_Locations/USB_Branch_Report.fex';
    });
});

I think its cool to be able to add any button with fontawesome icons but need to be able to run report with parms on the page.

Thanks!
-P

This message has been edited. Last edited by: FP Mod Chuck,


-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************
 
Posts: 246 | Location: Houston,TX | Registered: June 11, 2004Reply With QuoteReport This Post
Expert
posted Hide Post
Is this a composer page ?


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6163 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Platinum Member
posted Hide Post
This is the new "Page" using Designer, they now have abilities to add CSS and JS when building a page which is pretty cool. Again I'm using 8206 Home page to perform this.


-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************
 
Posts: 246 | Location: Houston,TX | Registered: June 11, 2004Reply With QuoteReport This Post
Expert
posted Hide Post
Yes, wasn't sure Designer was in 8.2.05.

You are going to have problems. W are in discussions with IBI to get the parms accessible.

Case open.

It looks promising but seems there is no functions available to retrieve the parms.

If you have the parms shown on the screen, you may be able to use js to collect them, but not sure if the values of select lists are available directly.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6163 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Thanks Waz,
I ended up grabbing the var as getelementById value and am able to pass it along in the URL. I'm hoping we'll see more IBComposer type functions exposed for designer.

-P


-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************
 
Posts: 246 | Location: Houston,TX | Registered: June 11, 2004Reply With QuoteReport This Post
Platinum Member
posted Hide Post
This is the updated code just in case
 
window.addEventListener("iba_pageloading", function (e){
    var panel = document.querySelector(".custom1").ibaObject;
    var ibsite = panel.addButton({"glyphClasses": "fa fa-question", "class": "ibButton", "tooltip": "Visit IB Site"}, ".pd-container-title-button-resize", true);
    var exl = panel.addButton({"glyphClasses": "fa fa-file-excel-o", "class": "ibButton", "tooltip": "Excel Dowload"}, ".pd-container-title-button-resize", true);
    ibsite.addEventListener("click", function(){
        window.open("http://www.ibi.com");
    });
    exl.addEventListener("click", function(){
        var p = document.getElementById('ibx-aria-id-64').value;
        console.log(p);
        var url = './wfirs/ibfs/WFC/Repository/COE/USB_Locations/USB_Branch_Report.fex'  ;
        console.log(url);
        url = url + '?ZIPCODE=' + p ;
        url = url + '&FMT=XLSX' ;
        console.log('final url=' + url);
        window.open(url) ;
        
    });
}); 


-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************
 
Posts: 246 | Location: Houston,TX | Registered: June 11, 2004Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS Designer Forum on Focal Point     [SOLVED] Button addEventListener

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.