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] trigger button on HTML parameter page from iframe report

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] trigger button on HTML parameter page from iframe report
 Login/Join
 
Guru
posted
Hi,

Does anyone have javascript to reference a button on an HTML parameter page from inside a report that is running in an iframe that is using WEBVIEWER to display?

What I've tried:
top.document.getElementId("button1")
window.document.getElementId("button1")
parent.document.getElementId("button1")
document.frames.iframe1.report.document.getElementId("button1")
top.frames.iframe1.document.getElementId("button1")

All with no success.
Ideas?
TIA

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



Greg



current client: WF 8.1.05 & 8.2 - Windows 7 64bit - Tomcat 7 - MRE / BID - IE11

local: WF 8.2 - Windows 7 64bit - Tomcat 6 - MRE / BID - FOCUS - IE11

PMF 8
 
Posts: 274 | Location: Boston/New England | Registered: February 12, 2006Report This Post
Platinum Member
posted Hide Post
gregv,
Have you tried viewing the rendered HTML output for the button in question??

ERINP


WebFOCUS 7.6.9

Reporting client Windows 2003 Service pack 2 using IIS and TomCat 5.5
Reporting Server OS/400 V5R4M0
Outputs: HTML, Excel, PDF, CSV, and Flat Files
 
Posts: 130 | Location: Columbus, Ohio | Registered: February 25, 2009Report This Post
Master
posted Hide Post
This may be a stupid question, but why are you wanting to reference a button from inside a report?


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Expert
posted Hide Post
First of all it's not "getElementId", it's "getElementById".


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
Platinum Member
posted Hide Post
Nice catch Francis...that should do it...


WebFOCUS 7.6.9

Reporting client Windows 2003 Service pack 2 using IIS and TomCat 5.5
Reporting Server OS/400 V5R4M0
Outputs: HTML, Excel, PDF, CSV, and Flat Files
 
Posts: 130 | Location: Columbus, Ohio | Registered: February 25, 2009Report This Post
Expert
posted Hide Post
There's
"opener.document...", "parent.opener.document...",
"self.opener.document...",
"window.opener..."

and even "window.opener.parent.parent.frames"

...

I've used 'em all.


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
Guru
posted Hide Post
Thanks all for your suggestions. No joy.

PBrightwell: the reason I want to access a button on the html parameter page from the report is to re-enable the Run button after the user clicks it (I disable it onclick) and the report is displayed. That way they can't click it twice. This should work if i can just get a reference back to the top.document.

Has anyone used a hidden popup window for communication purposes?

Thanks.



Greg



current client: WF 8.1.05 & 8.2 - Windows 7 64bit - Tomcat 7 - MRE / BID - IE11

local: WF 8.2 - Windows 7 64bit - Tomcat 6 - MRE / BID - FOCUS - IE11

PMF 8
 
Posts: 274 | Location: Boston/New England | Registered: February 12, 2006Report This Post
Virtuoso
posted Hide Post
Is its 'id'-attribute really 'button1', or is that perhaps the value of its 'name'-attribute (a common mistake)?
Is the 'button1' id unique in the page?

Is that button inside a frame by itself, perchance?
If so, you'll have to figure out how both documents (the WEBVIEWER frame document and the report frame document) fit in the top document hierarchy. Firefox+FireBug addon can be helpful there, as can some other tools.

If the button is in a frame, you could use something like:
top.document.getElementById('id of WEBVIEWER frame').getElementById('button1');


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Virtuoso
posted Hide Post
Since the report is using WEBVIEWER, it apparently creates an iframe on its own so, if you're already using an outer iframe, to access any element in the HTML parameter form you may need to access the report's parent's parent document node Confused

Bah! Code speaks better than words:
DEFINE FILE CAR
SHOWME/A500 WITH CAR = '<input type="button" value="Show" onclick="' ||
                          'var x=parent.parent.document.getElementById(''runButton''); ' ||
                          'if(x) { x.value=''Again!'';}' ||
                       '">';
END
TABLE FILE CAR
PRINT 
     CAR.ORIGIN.COUNTRY
     CAR.COMP.CAR
     CAR.CARREC.MODEL
     CAR.BODY.BODYTYPE
     CAR.BODY.SEATS
WHERE CAR.ORIGIN.COUNTRY EQ '&PCOUNTRY.(FIND CAR.ORIGIN.COUNTRY,CAR.ORIGIN.COUNTRY IN car).Country.';
ON TABLE SUBFOOT
"<SHOWME"
ON TABLE SET PAGE-NUM NOLEAD 
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET WEBVIEWER ON
ON TABLE SET WEBVIEWTARG OFF
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
     INCLUDE = endeflt,
$
ENDSTYLE
END


Due to lazyness, I'm relying on auto-prompting as produced in my 7.7.03 environment which auto-magically:

- Creates a basic form with a Country drop-down list and "Run" button (id="runButton")
- Creates an iframe to display the report upon clicking "Run"

From within the WEBVIEWER report, I can reference parent.parent.document.getElementbyId('runButton') and do whatever I want (or can). The sample code changes it's value/caption from "Run" to "Again!" but of course you have more serious needs Smiler

Hope this helps.

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



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report This Post
Guru
posted Hide Post
njsden: That's it! Good One

Thanks!



Greg



current client: WF 8.1.05 & 8.2 - Windows 7 64bit - Tomcat 7 - MRE / BID - IE11

local: WF 8.2 - Windows 7 64bit - Tomcat 6 - MRE / BID - FOCUS - IE11

PMF 8
 
Posts: 274 | Location: Boston/New England | Registered: February 12, 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] trigger button on HTML parameter page from iframe report

Copyright © 1996-2020 Information Builders