As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I want to pass a random number in FOCEXEC of the parent that calls the child fex. This way every time the child is invoked from the parent,a different random number will be passed in the URL.
For example, -SET &ACROSSCOLNAME = 'DUMMY'; -SET &TMPFORMAT = 'monthly'; -SET &METmetric1 = 'Peak_Volume'; -SET &FUNmetric1 = 'SUM'; -SET &PARFEX = 'r16489'; -SET &SERIES1WIDTH =1 ; -SET &SERIES1TYPE =1 ; -SET &SERIES1TYPE=1; -SET &SERIES1AXIS=0; -SET &RANDOM = RDUNIF('D4.3') * 100; . . -* I am passing the above values in FOCEXEC to a child fex,
But when the URL is passed with the paramters,the RANDOM value remains the same always. But I need something like this : Every time I click on a bar, a link with different RANDOM numbers need to be generated.
Is there something that should be done with Javascript to overwrite the inital value,every time another action occurs.?This message has been edited. Last edited by: Kerry,
This does'nt work. When we SET a variable and then try to pass that variable in the FOCEXEC, the value does not change since the function does not get executed.
Here is an example of updating the drilldown its self.
It is set to update every 10 seconds.
This will only work for HTML reports, and I've only tested with IE.
TABLE FILE CAR
PRINT COUNTRY
ON TABLE SET STYLE *
TYPE=DATA, FOCEXEC=DRILL(RANDOM=''), $
ENDSTYLE
END
-RUN
-HTMLFORM BEGIN
<script language="JavaScript">
<!--
function setRandom() {
var anc_list = document.getElementsByTagName("A") ;
for (var _c1=0;_c1<anc_list.length;_c1++) {
var _bits = anc_list[_c1].href.toString().split('=') ;
_bits[_bits.length-1] = new Date() ;
anc_list[_c1].href = _bits.join('=') ;
}
alert(document.body.innerHTML) ;
window.setTimeout('setRandom()',10000) ;
}
setRandom() ;
//-->
</script>
-HTMLFORM END
That sounds like something that can be added to an on_click event where "var" can be incremented and used in the drilldown code... I'll see if I can come up with something that does that. But, I'm off for the night. So, feel free to do it to it...
Doug
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005
-* File PassRandom.fex
DEFINE FILE CAR
RD/D3 WITH SALES=RDUNIF('D4.3') * 100;
END
TABLE FILE CAR
SUM SALES
FST.RD NOPRINT
BY COUNTRY
BY CAR
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
TYPE=DATA, COLUMN=SALES, FOCEXEC=GETRANDOM(COUNTRY=COUNTRY CAR=CAR RD=FST.RD), $
ENDSTYLE
END
Thanks for the response. The javascript code works fine for the tables. Upon clicking on the link, it takes me to the URL that has the random values poplualted. But this works fine only when we click on a link (href). What am I supposed to do to make this work in the graph. When a bar is clicked the URL is populated without the random value.
GRAPH FILE CAR SUM SALES ACROSS COUNTRY
ON GRAPH SET LOOKGRAPH VBAR ON GRAPH SET 3D OFF ON GRAPH SET BARNUMB OFF ON GRAPH SET GRID ON ON GRAPH SET GRAPHEDIT SERVER ON GRAPH SET GRMERGE ON ON GRAPH SET VZERO OFF
ON GRAPH SET STYLE *
TYPE=DATA,COLUMN=N1,FOCEXEC=TEST(RANDOM = ''), $
ENDSTYLE END -RUN -HTMLFORM BEGIN
<script language="JavaScript"> function setRandom() { var anc_list = document.getElementsByTagName("A") ; for (var _c1=0;_c1 var _bits = anc_list[_c1].href.toString().split('=') ; _bits[_bits.length-1] = new Date() ; anc_list[_c1].href = _bits.join('=') ; } window.setTimeout('setRandom()',10000) ; }
-* File random4.fex
GRAPH FILE CAR
SUM SALES
ACROSS COUNTRY
BY BODYTYPE
ON GRAPH SET GRMERGE ON
ON GRAPH SET STYLE *
TYPE=DATA, JAVASCRIPT=runfex (COUNTRY BODYTYPE), $
ENDSTYLE
END
-RUN
-HTMLFORM BEGIN
<script type="text/javascript">
function runfex(country, bodytype)
{
random = Math.floor((Math.random()*100000));
url = 'WFServlet?&|IBIAPP_app=test&|IBIF_ex=RANDOM2&|COUNTRY=' + country + '&|BODYTYPE=' + bodytype + '&|RANDOM=' + random;
fexwindow = window.open(url, 'fexwindow');
fexwindow.focus();
}
</script>
-HTMLFORM END
-EXIT
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
As GRAPHEDIT SERVER creates an image and then mapps the drilldoes with the AREA tag, the change is simple.
GRAPH FILE CAR
SUM SALES
ACROSS COUNTRY
ON GRAPH SET LOOKGRAPH VBAR
ON GRAPH SET 3D OFF
ON GRAPH SET BARNUMB OFF
ON GRAPH SET GRID ON
ON GRAPH SET GRAPHEDIT SERVER
ON GRAPH SET GRMERGE ON
ON GRAPH SET VZERO OFF
ON GRAPH SET STYLE *
TYPE=DATA,COLUMN=N1,FOCEXEC=TEST(RANDOM = ''), $
ENDSTYLE
END
-RUN
-HTMLFORM BEGIN
<script language="JavaScript">
<!--
function setRandom() {
var anc_list = document.getElementsByTagName("AREA") ;
for (var _c1=0;_c1<anc_list.length;_c1++) {
var _bits = anc_list[_c1].href.toString().split('=') ;
_bits[_bits.length-1] = new Date() ;
anc_list[_c1].href = _bits.join('=') ;
}
alert(document.body.innerHTML) ;
window.setTimeout('setRandom()',10000) ;
}
setRandom() ;
//-->
</script>
-HTMLFORM END