Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Radio Buttons to pass variable to drop down lists to update data

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Radio Buttons to pass variable to drop down lists to update data
 Login/Join
 
Platinum Member
posted
I have 4 radio buttons for 4 different reports. I also have 13 drop down list. I would like to do is when I click on the radio button I would like to pass a variable to the program that creates the drop down list. Each drop down list has its own .fex to populate the data. Two of the reports which are Export Reports use the same joins in the .fex to populate the drop down list and the other two repors which are Import Reports use different joins.

For example: Instead of listing all the joins which there are a few I just put an -INCLUDE instead.

This is just one of the .fex's to populate the drop down list.


-DEFAULT &answer = ' '

-IF &answer EQ 'mrka_6_year_trend_export' OR &answer EQ 'mrka_vol_dol_field_export' THEN GOTO EXPRT;
-IF &answer EQ 'mrka_6_year_trend_import' OR &answer EQ 'mrka_vol_dol_field_import' THEN GOTO IMPRT;

-EXPRT
-INCLUDE MRKA_EXPORT_JOINS

TABLE FILE GIEIMX10_EXPRT_VAL
SUM FST.EXPRT_MNTH_W
BY HIGHEST EXPRT_MNTH_W
ON TABLE PCHOLD FORMAT XML
END
-EXIT

-IMPRT
-INCLUDE MRKA_IMPORT_JOINS

TABLE FILE GIEIMX12_IMP_VAL
SUM FST.IMP_MNTH_W
BY HIGHEST IMP_MNTH_W
ON TABLE PCHOLD FORMAT XML
END


My questions when clicking on a radio button for a particular report is there a way to pass a variable to the .fex so it can know which join and code to use. I used "&answer" for now just to show you how I would like it to look like and whats its equal to are the actually names of the .fex's for the reports. I already figured out how to link the drop down list so if the user choose something from the first drop down list it updates the rest of the drop down lists.

If you need more information just let me know.

Thanks.

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


Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats
 
Posts: 121 | Location: California | Registered: June 19, 2008Report This Post
Guru
posted Hide Post
This is definitely doable.

Here is a small example using CAR to illustrate:

-* Carlist.fex

TABLE FILE CAR
PRINT
     &VALUE
BY &VALUE
 
WHERE COUNTRY EQ '&COUNTRY';
ON TABLE PCHOLD FORMAT XML
END  


-* Cartest.htm

<!-- Generated by Report Layout Painter -->
<HTML>
<HEAD>
<SCRIPT id=IBI_RelCallBack type=text/javascript>function AdjustChildrenPosition(){
}
</SCRIPT>
 
<SCRIPT id=IBI_OptionsScript type=text/javascript>
var rltVersion = "764";
var cgipath = "cgipath";
var ibirls = "ibirls2";
 
var rltdyncalendar = "rltdyncalendar";
var gmap = "ibigmap";
var olap="olap";
var olappanebase="olappanebase";
var olapdrill="olapdrill";
 
var ibixmltree="ibixmltree";
 
var ibiOptions = new Array(cgipath,ibirls);
</SCRIPT>
 
<SCRIPT id=IBI_nls src="/ibi_html/javaassist/nls.js" type=text/javascript></SCRIPT>
 
<SCRIPT id=IBI_ibigbl src="/ibi_html/javaassist/ibi/html/js/ibigbl.js" type=text/javascript></SCRIPT>
 
<SCRIPT id=IBI_ibigblloadCss type=text/javascript>
ibigblloadCss(null);</SCRIPT>
<TITLE>HtmlPage</TITLE>
<SCRIPT id=clientEventHandlersJS type=text/javascript>
//Begin function window_onload
function window_onload() {
 
UpdateData();
 
// TODO: Add your event handler code here
//add onInitialUpdate() function to make changes before initial run of the reports
}
//End function window_onload
 
//Begin function COUNTRY_onchange
function COUNTRY_onchange(ctrl) {
update_Combo();
}
//End function COUNTRY_onchange
 
function update_Combo() {
myctrl = document.getElementById("combobox1");
populateDynamicCtrl(myctrl);
}
 
 
//Begin function VALUE_0_onchange
function VALUE_0_onchange(ctrl) {
update_Combo();
}
//End function VALUE_0_onchange
 
//Begin function VALUE_1_onchange
function VALUE_1_onchange(ctrl) {
update_Combo();
}
//End function VALUE_1_onchange
</SCRIPT>
 
<SCRIPT for=window eventname="onload">window.onload = function() { window_onload(); }</SCRIPT>
</HEAD>
<BODY style="OVERFLOW: auto" edaconnectionrequired="true">
<SELECT id=combobox1 style="Z-INDEX: 1; LEFT: 30px; WIDTH: 490px; POSITION: absolute; TOP: 160px" tabIndex=1 name=combobox1 attvariables="VALUE;COUNTRY;" ibiapp_app="support_files" ibic_server="EDASERVE" sourcetype="typeFex" datatype="1" datasource="carlist.fex" cacheruntimedata="0"></SELECT> 
<SPAN id=VALUE contentEditable=false style="LEFT: 20px; WIDTH: 1071px; POSITION: absolute; TOP: 80px" tabIndex=0 name="VALUE" size="20" vspace="0" indeterminate="false" CHECKED="false" width="0" loop="1" maxLength="2147483647" hspace="0" height="70225556" readOnly="false" start="fileopen" columns="1">
<TABLE contentEditable=false style="WIDTH: 100%; HEIGHT: 100%" cellSpacing=0 cellPadding=0>
<TBODY>
<TR>
<TD>
<INPUT language=javascript id=VALUE_0 type=radio onchange=VALUE_0_onchange(this) value=CAR name=VALUE displaytext="CAR"> 
<LABEL style="CURSOR: default" tabIndex=0 for=VALUE_0>CAR</LABEL></TD></TR>
<TR>
<TD>
<INPUT language=javascript id=VALUE_1 type=radio CHECKED onchange=VALUE_1_onchange(this) value=MODEL name=VALUE displaytext="MODEL"> 
<LABEL style="CURSOR: default" tabIndex=0 for=VALUE_1>MODEL</LABEL></TD></TR></TBODY></TABLE></SPAN>
<SELECT language=javascript id=COUNTRY style="LEFT: 30px; POSITION: absolute; TOP: 30px" tabIndex=0 onchange=COUNTRY_onchange(this) size=1 name=COUNTRY ibiapp_app="support_files" ibic_server="EDASERVE" sourcetype="typeMaster" datatype="1" datasource="CAR.mas" vspace="0" indeterminate="false" CHECKED="false" width="0" loop="1" maxLength="2147483647" hspace="0" height="71936988" readOnly="false" start="fileopen" dynalldisplayvalue="ALL" addalloption="1" displayfield="COUNTRY" datafield="COUNTRY" dfformat="A10" ibiformat="A10"></SELECT> 
<INPUT id=layoutinfo style="LEFT: -100px; POSITION: absolute; TOP: -100px" type=hidden inputcontrolids="combobox1;VALUE;COUNTRY">
<INPUT id=ibiapp_app style="LEFT: -100px; POSITION: absolute; TOP: -100px" type=hidden value=support_files name=ibiapp_app></BODY>
<SCRIPT id=IBI_loader type=text/javascript>
doBeforeLoad();
</SCRIPT>
</HTML>  


Works in 7.6.8 - but should also work in 7.1.x

Cheers

Stu


WebFOCUS 8.2.03 (8.2.06 in testing)
 
Posts: 253 | Location: Melbourne, Australia | Registered: February 07, 2007Report This Post
Platinum Member
posted Hide Post
I really never figured out when I click on the radio button if it can pass a variable to the program that creates the drop down list. So instead I was able to change the datesource when I click on the radio button which works just as well but I had to create the additional .fex's.

Below is the code i added to my html page:

<script type=text/javascript>
function setdatasource(ImpExp)
{
if (ImpExp=="mrka_6_year_trend_export" || ImpExp=="mrka_vol_dol_field_exp")
{
document.getElementById("combobox2").setAttribute("datasource","mrka_exp_volume.fex");
document.getElementById("combobox3container").style.display="none";
document.getElementById("combobox4").setAttribute("datasource","mrka_exp_category.fex");
document.getElementById("combobox5").setAttribute("datasource","mrka_exp_subcategory.fex");
document.getElementById("combobox6").setAttribute("datasource","mrka_exp_type.fex");
document.getElementById("combobox7").setAttribute("datasource","mrka_exp_bulkbottle.fex");
document.getElementById("combobox8").setAttribute("datasource","mrka_exp_size.fex");
document.getElementById("combobox9").setAttribute("datasource","mrka_exp_alcohol.fex");
document.getElementById("combobox10").setAttribute("datasource","mrka_exp_value.fex");
document.getElementById("combobox11").setAttribute("datasource","mrka_exp_other.fex");
document.getElementById("combobox12").setAttribute("datasource","mrka_exp_commodity.fex");
document.getElementById("combobox13").setAttribute("datasource","mrka_exp_yrenddate.fex");
}
else
{
document.getElementById("combobox2").setAttribute("datasource","mrka_imp_volume.fex");
document.getElementById("combobox3").setAttribute("datasource","mrka_imp_dollar.fex");
document.getElementById("combobox3container").style.display="block";
document.getElementById("combobox4").setAttribute("datasource","mrka_imp_category.fex");
document.getElementById("combobox5").setAttribute("datasource","mrka_imp_subcategory.fex");
document.getElementById("combobox6").setAttribute("datasource","mrka_imp_type.fex");
document.getElementById("combobox7").setAttribute("datasource","mrka_imp_bulkbottle.fex");
document.getElementById("combobox8").setAttribute("datasource","mrka_imp_size.fex");
document.getElementById("combobox9").setAttribute("datasource","mrka_imp_alcohol.fex");
document.getElementById("combobox10").setAttribute("datasource","mrka_imp_value.fex");
document.getElementById("combobox11").setAttribute("datasource","mrka_imp_other.fex");
document.getElementById("combobox12").setAttribute("datasource","mrka_imp_commodity.fex");
document.getElementById("combobox13").setAttribute("datasource","mrka_imp_yrenddate.fex");
}
}


Then in my drop down list i left the datasource blank.

Volume:
SELECT id=combobox2 style="LEFT: 120px; WIDTH: 300px; POSITION: absolute"
name=Volume
newchainnumber="0"
datasource=" "
datatype="1"
sourcetype="typeFex"
ibic_server="EDASERVE"
ibiapp_app="mrkanalysis"
cacheruntimedata="0"
chainnumber="0"
inchainindex="2"
addalloption="1"
dynalldisplayvalue="All Volumes"
/SELECT


Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats
 
Posts: 121 | Location: California | Registered: June 19, 2008Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Radio Buttons to pass variable to drop down lists to update data

Copyright © 1996-2020 Information Builders