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     [SOLVED] OnChange in drop down list to execute an embedded report?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] OnChange in drop down list to execute an embedded report?
 Login/Join
 
Master
posted
Just like the topic says, I'm trying to make the OnChange handler in a drop down list execute an embedded report.

I've changed the Onclick handler to this in the code editor:
 
Posts: 611 | Registered: January 04, 2007Report This Post
Gold member
posted Hide Post
Possibly spelling. It must be exact(capitalization).


WF 8.2.01M
8.2.01M Reporting Server
Windows 2012 Srvr R2
PDF,Excel, HTML
Graphs - a lot of graphs
 
Posts: 60 | Location: Atlanta, GA | Registered: October 30, 2003Report This Post
Master
posted Hide Post
I changed the spelling per note from "mrguru".

Didn't fix it. It's a good point, though, maybe it will help others.


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
 
Posts: 611 | Registered: January 04, 2007Report This Post
Expert
posted Hide Post
onClick will not allow you to change the selected value, you have to use onChange.

Try this example html page:

<html>
 <body>
  <form method="post" action="">
    <select id="edit1" onChange="alert(this.value)">
      <option value="a001">a</option>
      <option value="b002">b</option>
    </select>
  </form>
 </body>
</html>

Try changing the onChange to onClick to see what happens.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Master
posted Hide Post
Thanks for the example Francis, it explains a lot for me when I have some working code to compare to.

I've tried all sorts of changes to spelling and capitalization, but of course nothing works. I am posting my html form's code in it's entirety below, hoping someone will see an obvious error.

<!-- 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>
function window_onload() {
UpdateData();
}
function button2_OnClick(ctrl) {
OnExecute(ctrl)
}
function edit1_onchange(ctrl) {
OnExecute(ctrl)
}

</SCRIPT>

<SCRIPT for=window eventname="onload">window.onload = function() { window_onload(); }</SCRIPT>
</HEAD>
<BODY style="OVERFLOW: auto" edaconnectionrequired="true">
<IFRAME id=report1 title=app/main.fex style="Z-INDEX: 1; LEFT: 5px; OVERFLOW: auto; WIDTH: 795px; POSITION: absolute; TOP: 50px; HEIGHT: 430px" tabIndex=1 name=report1 marginWidth=0 marginHeight=0 frameBorder=no executebuttonId="button2" requests_list="0" autoExecute="False" elementtype="2"></IFRAME>
<SELECT language=javascript id=edit1 style="LEFT: 10px; WIDTH: 205px; POSITION: absolute; TOP: 10px" OnChange=edit1_onchange(this) tabIndex=4 size=1 name=CODE vspace="0" indeterminate="false" accept="0" CHECKED="false" width="0" loop="1" maxLength="100" hspace="0" height="120504924" readOnly="false" start="fileopen" dfformat="A100V" ibiformat="A100V" datafield="CUST_CLASS" displayfield="CUST_CLASS" labelid="text1" addalloption="0" operation="NONE" datasource="cp_main_mqt.mas" boundtovariable="1" requiredfield="1431962" datatype="1" sourcetype="typeMaster"></SELECT>
<INPUT language=javascript id=button2 style="Z-INDEX: 5; LEFT: 230px; WIDTH: 95px; POSITION: absolute; TOP: 10px; HEIGHT: 25px" onclick=edit1_onchange(this) tabIndex=5 type=button size=15 value=Submit name=button2 requests_list="0">
<INPUT id=layoutinfo style="LEFT: -100px; POSITION: absolute; TOP: -100px" type=hidden inputcontrolids="edit1">
<INPUT id=IBIMR_domain style="LEFT: -100px; POSITION: absolute; TOP: -100px" type=hidden value=ykh6hdgo/ykh6hdgo.htm name=IBIMR_domain>
<INPUT id=IBIMR_folder style="LEFT: -100px; POSITION: absolute; TOP: -100px" type=hidden value=#customerprof name=IBIMR_folder>
<INPUT id=ibif_ex style="LEFT: -100px; POSITION: absolute; TOP: -100px" type=hidden value=app/main_frame.htm name=ibif_ex>
<INPUT id=ibiapp_app style="LEFT: -100px; POSITION: absolute; TOP: -100px" type=hidden name=ibiapp_app ismre="1">
<INPUT id=ibic_server style="LEFT: -100px; POSITION: absolute; TOP: -100px" type=hidden value=EDASERVE name=ibic_server>
<xml id=ibi_requests>
<script>

<requests>

<request requestid="0" targettype="iframe" targetname="report1" sourcetype="typeFex" ibif_ex="app/main.fex" IBIMR_domain="ykh6hdgo/ykh6hdgo.htm" IBIMR_folder="#customerprof" IBIMR_sub_action="MR_STD_REPORT" ibiapp_app="" activereport="0" reportcolumns="">

<variables>
<variable field="CODE" file="cp_main_mqt.mas" desc="CODE" datatype="0" operation="" default="" name="CODE" textvarname="" accept="0" type="unresolved" select="0" min="" max="" controltype="7" create="1"></variable></variables></request></requests></script>
</xml></BODY>
<SCRIPT id=IBI_loader type=text/javascript>
getActiveReportJscript();
setUserInfo();
</SCRIPT>
</HTML>


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
 
Posts: 611 | Registered: January 04, 2007Report This Post
Expert
posted Hide Post
Jason, you really should always post code between
[code]
[/code]
tags to ensure proper display of code.

Meanwhile, I'll take a look at your code.

Cheers,


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Jason, add this to the function edit1_onchange:

alert(ctrl.value);


My assumption is that you're getting a JavaScript error, but the error notification is turned off.

If you're using Internet Explorer, check the JS error notification setting. Internet Explorer > Tools > Internet Options > Display a notification about every script error - this checkbox should be checked.

This is, of course, an assumption.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Master
posted Hide Post
Francis,
Thanks for your help! I changed the edit1_onchange function to run the alert that you posted, and it worked great! Whenever I change the drop down list it pops up the alert with the new value.

function edit1_onchange(ctrl) {
alert(ctrl.value);
}


I made the "display an error" change in my IE settings, but nothing comes up.

So, I guess we just need to figure out why when the function says:
function edit1_onchange(ctrl) {
OnExecute(ctrl)
}

it doesn't run the embedded report.

Thanks for your help!

This message has been edited. Last edited by: Jason K.,


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
 
Posts: 611 | Registered: January 04, 2007Report This Post
Silver Member
posted Hide Post
quote:
executebuttonId="button2"


Notice that piece on the IFRAME in your HTML, I believe that means that the frame is only responding to the button2 for OnExecute. So the easiest way to handle this would be to have your OnChange event trigger the OnClick event of button2. That is how we usually handle it, as we have the same need in our shop.


WF 7.6.4
Windows XP and UNIX
 
Posts: 41 | Registered: November 26, 2008Report This Post
Gold member
posted Hide Post
[quote]OnExecute(button2)[/quote]


This should take care of your problem.


WF 8.2.01M
8.2.01M Reporting Server
Windows 2012 Srvr R2
PDF,Excel, HTML
Graphs - a lot of graphs
 
Posts: 60 | Location: Atlanta, GA | Registered: October 30, 2003Report This Post
Gold member
posted Hide Post
OnExecute(button2)

no [quote]....


WF 8.2.01M
8.2.01M Reporting Server
Windows 2012 Srvr R2
PDF,Excel, HTML
Graphs - a lot of graphs
 
Posts: 60 | Location: Atlanta, GA | Registered: October 30, 2003Report This Post
Gold member
posted Hide Post
Jason,

I am having the same issue, I can't even get an alert to fire in the onchange event. It works fine in the onclick event so I know the syntax is correct.

Have you had any success?


WebFOCUS 769
Windows
all
 
Posts: 53 | Registered: April 29, 2009Report This Post
Virtuoso
posted Hide Post
Jason, knegrotto,

When you say that you want to execute an "embedded report", what do you mean?
Do you want to run a report when the contents of the dropdown list box changes? or when the user clicks another value?


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Gold member
posted Hide Post
I have a frame with a fex as a data source. The fex uses the value from the dropdown box as a parameter. When the contents of the dropdown change, the report output should be refreshed based on the new parameter value.

Apparently the onchange event is not firing and is a known issuw in 7.6.9. There is a hotfix but it causes other problems so we backed it out.

Instead I am using a workaround I found on the forum. It remaps the OnChange Event every time the OnClick event is triggered as follows:

//Begin function combobox50_onclick
function combobox50_onclick(ctrl) {
combobox50.onchange=combobox50_onchange
}
//End function combobox50_onclick


WebFOCUS 769
Windows
all
 
Posts: 53 | Registered: April 29, 2009Report This Post
Virtuoso
posted Hide Post
Using our WrapApp product, we would define a list box object and a trigger (a fex) attached to it which executes the report when the user clicks a value. So each time you click, you see a different output. No javascript needed!


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Expert
posted Hide Post
That WrapApp site seems to be down Frowner


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Master
posted Hide Post
Thanks folks, changing the
function edit1_onchange(ctrl) {
OnExecute(ctrl)
}

TO

function edit1_onchange(ctrl) {
OnExecute(button2)
}

fixed it.


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
 
Posts: 611 | Registered: January 04, 2007Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by Francis Mariani:
That WrapApp site seems to be down Frowner


Thanks Francis. It is now up! Music


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report 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     [SOLVED] OnChange in drop down list to execute an embedded report?

Copyright © 1996-2020 Information Builders