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] using reset button to clear html report and dropdowns

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] using reset button to clear html report and dropdowns
 Login/Join
 
Silver Member
posted
I have an html report with four dropdowns and an iframe with the report results. I'm trying to change the reset button to clear all four dropdowns and the iframe with one click. I changed the reset button type to button and added the onclick event handler. Here is the code for it (which is inside SCRIPT tags with some other functions):
 //Begin function form1Reset_onclick
function form1Reset_onclick(ctrl) {
document.getElementById('combobox1').contentWindow.Reset();
document.getElementById('combobox2').contentWindow.Reset();
document.getElementById('combobox3').contentWindow.Reset();
document.getElementById('combobox4').contentWindow.Reset();
document.getElementById('report1').contentWindow.Reset();
}
//End function form1Reset_onclick
</SCRIPT> 


If I leave the type as reset, then all four dropdowns reset, but when I use the above code, nothing gets reset. Any ideas?

Thanks!
Theresa

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


PMF: 5.2.3 HF 4
Server: WF 7.6.11/DB2
Desktop: WF 7.6.11/SQL Server/XP
output: HTML
 
Posts: 38 | Location: Washington, D.C., United States | Registered: April 22, 2010Report This Post
Expert
posted Hide Post
document.getElementById(formid).reset();


This should work for all form objects. An IFRAME is not form a object, but a container for HTML. You need to change the location of the iframe to an empty html page.


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
<JG>
posted
src='#'
 
Report This Post
Master
posted Hide Post
Why not use the Reset button given by HTML composer. It does the job without writing any code manually..

Thanks


8.1.05
HTML,PDF,EXL2K, Active, All
 
Posts: 484 | Registered: February 03, 2009Report This Post
Expert
posted Hide Post
I second / agree with Enigma006's sugesstion.




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Silver Member
posted Hide Post
quote:
Originally posted by Enigma006:
Why not use the Reset button given by HTML composer. It does the job without writing any code manually..

Thanks


I tried that. That was the reset button I was trying to modify. It cleared all of the dropdowns, but not the report output which is in an iframe. I need all of them reset with the click of one button.


PMF: 5.2.3 HF 4
Server: WF 7.6.11/DB2
Desktop: WF 7.6.11/SQL Server/XP
output: HTML
 
Posts: 38 | Location: Washington, D.C., United States | Registered: April 22, 2010Report This Post
Silver Member
posted Hide Post
quote:
Originally posted by JG:
src='#'


JG,

I don't understand. What object is this the source for? Where is this supposed to go?

Theresa


PMF: 5.2.3 HF 4
Server: WF 7.6.11/DB2
Desktop: WF 7.6.11/SQL Server/XP
output: HTML
 
Posts: 38 | Location: Washington, D.C., United States | Registered: April 22, 2010Report This Post
Guru
posted Hide Post
Try this.

On you button property add
  
onclick=window.location.reload()




Your html code should look something like this

  
<INPUT language=java_script class=pagetitle id=button2 style="FONT-WEIGHT: bold; FONT-SIZE: 9pt; Z-INDEX: 145; LEFT: 920px; WIDTH: 80px; FONT-FAMILY: Arial; POSITION: absolute; TOP: 211px; HEIGHT: 25px" onclick=window.location.reload() tabIndex=146 type=button value=Reset name=button2 requests_list="12" persistentuniqueid="compUid_68" autoExecute="True">



Thanks,
Sayed


WF 8.x and 7.7.x Win/UNIX/AS400, MRE/Portal/Self-Service, IIS/Tomcat, WebSphere, IWA, Realmdriver, Active Directory, Oracle, SQLServer, DB2, MySQL, JD Edwards, E-BIZ, SAP BW, R/3, ECC, ESSBASE
 
Posts: 285 | Location: Texas | Registered: June 27, 2006Report This Post
Silver Member
posted Hide Post
I haven't been able to test this yet. My secure connection to the WebFocus server has been down since the holiday (Oct. 11).

Theresa


PMF: 5.2.3 HF 4
Server: WF 7.6.11/DB2
Desktop: WF 7.6.11/SQL Server/XP
output: HTML
 
Posts: 38 | Location: Washington, D.C., United States | Registered: April 22, 2010Report This Post
Silver Member
posted Hide Post
quote:
Originally posted by Sayed:
Try this.

On you button property add
  
onclick=window.location.reload()




Your html code should look something like this

  
<INPUT language=java_script class=pagetitle id=button2 style="FONT-WEIGHT: bold; FONT-SIZE: 9pt; Z-INDEX: 145; LEFT: 920px; WIDTH: 80px; FONT-FAMILY: Arial; POSITION: absolute; TOP: 211px; HEIGHT: 25px" onclick=window.location.reload() tabIndex=146 type=button value=Reset name=button2 requests_list="12" persistentuniqueid="compUid_68" autoExecute="True">



Thanks,
Sayed


My VPN was fixed today. I tried your suggestion, but it didn't help. When I click on the Reset button, I get a popup that says that IE needs to resend the information and to click Retry to continue. When I click on Retry, it comes back with a blank page with just the "No query information to decode" message.


PMF: 5.2.3 HF 4
Server: WF 7.6.11/DB2
Desktop: WF 7.6.11/SQL Server/XP
output: HTML
 
Posts: 38 | Location: Washington, D.C., United States | Registered: April 22, 2010Report This Post
Expert
posted Hide Post
Combine what Francis and JG suggested ....
function form1Reset_onclick(ctrl) {
document.getElementById('report1').src = "";
document.form.reset();
}

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
I had to do something similar. Setting src for a frame did not work for me either. What did work was coding it like this:
window.top.frames.report1.location.href = 'about:blank';
That did the trick for me. I'm using IE8, which may be why setting src does not work (guessing here).


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Silver Member
posted Hide Post
I tried the suggestions posted. I can either get all of the dropdowns to reset, or I can get the report results to be cleared. I cannot get one button to clear/reset everything with one click.

Here's what I currently have in my button onclick event handler:
  document.getElementById('report1').src = "";
document.form1.Reset();


Theresa


PMF: 5.2.3 HF 4
Server: WF 7.6.11/DB2
Desktop: WF 7.6.11/SQL Server/XP
output: HTML
 
Posts: 38 | Location: Washington, D.C., United States | Registered: April 22, 2010Report This Post
Expert
posted Hide Post
Is the frame part of the form? If it is then it should be reset by the reset action, if not then you need to either ensure that it is wihn the frame or reset it separately.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
I tried to simulate your problem. SO I created an html file with four unchained dropdowns to populate &vars for use with selecting records out of the car database. One for country, one for car, one for model and one for bodytype.
I included a Run button and a Reset button. The run button runs a very simple report and the reset button was just that, no actions specified.
Last the iframe was added to hold the result of the simple report.
Running it showed that the reset button reset all dropdowns, but not the iframe. SO added the onclick event for the reset button to clear the iframe. That worked, but now the dropdowns were not reset any more.
So what I did was add the reset of the dropdowns myself. Using your code with the 'contentWindow.Reset' mnethod presented a javascript error message. So I tried to simply set the selected index of the combobox to 0. That had the desired effext. The code in the onclick event nnow is:
document.getElementById('combobox1').selectedIndex = 0;
document.getElementById('combobox2').selectedIndex = 0;
document.getElementById('combobox3').selectedIndex = 0;
document.getElementById('combobox4').selectedIndex = 0;
window.top.frames.iframe1.location.href = 'about:blank';
and this clears all elements on my screen.

Hope this helps ...


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Silver Member
posted Hide Post
quote:
Originally posted by GamP:
The code in the onclick event nnow is:
document.getElementById('combobox1').selectedIndex = 0;
document.getElementById('combobox2').selectedIndex = 0;
document.getElementById('combobox3').selectedIndex = 0;
document.getElementById('combobox4').selectedIndex = 0;
window.top.frames.iframe1.location.href = 'about:blank';
and this clears all elements on my screen.

Hope this helps ...


That did it! Thanks, GamP!! This code worked for me.

Theresa


PMF: 5.2.3 HF 4
Server: WF 7.6.11/DB2
Desktop: WF 7.6.11/SQL Server/XP
output: HTML
 
Posts: 38 | Location: Washington, D.C., United States | Registered: April 22, 2010Report This Post
Guru
posted Hide Post
This works sweet, except how would I get it to work with chained drop downs? When reset it retains the previous load. I have a last name combobox and a first name combobox. Say I pick adams for the last name, this will limit the choices now for the first name down to only three. This is what it is suppose to do. Then I hit reset button, select a different last name and I still get the previous first names........any ideas?? Thanks I'm also having trouble setting the focus on the last name combobox.


WebFOCUS Server 8.1.05
Windows 2008 Server
WebFOCUS AppStudio 8.1.05
Windows 7 Professional
IE 11 and Chrome Version 43.0.2357.124 m.
Mostly HTML, PDF, Excel, and AHTML
 
Posts: 272 | Location: Kalamazoo, Michigan | Registered: September 30, 2010Report This Post
Expert
posted Hide Post
Cool Thanks again all you contributors...
I just found some of the "document.getElementById" code that I needed, right here on FocalPoint.
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report 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] using reset button to clear html report and dropdowns

Copyright © 1996-2020 Information Builders