Tech Doc Search Tech Support User Forums WebFOCUS Newsletter Summit Education

IB - Developer Center    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] trigger button on HTML parameter page from iframe report
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] trigger button on HTML parameter page from iframe report
 Login/Join
 
Platinum Member
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 7.7.02 - Unix/Solaris - Tomcat 5.5 - MRE / BID - Oracle - IE8

local: WF 7.7.02 - Windows XP SP2 - Tomcat 5.5 - MRE / BID - FOCUS - IE8 PMF 5.2.3 HF2
 
Posts: 156 | Location: Boston/New England | Registered: February 12, 2006Reply With QuoteReport 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, 2009Reply With QuoteReport 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: 726 | Location: TX | Registered: September 25, 2007Reply With QuoteReport This Post
Expert
Posted Hide Post
First of all it's not "getElementId", it's "getElementById".


Francis

1: WF 7.7.03, MRE, BI Dashboard, Dev Studio, IBM DB2 9, MS Windows XP SP2, I.E. 8
2: WF 7.7.02, MRE, BI Dashboard, Self Service, Dev Studio, MS Windows 7 SP1, Apache Tomcat/6.0.20, MS SQL Server, I.E. 8     Output formats: HTML, Excel 2000 and PDF
 
Posts: 6958 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport 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, 2009Reply With QuoteReport 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

1: WF 7.7.03, MRE, BI Dashboard, Dev Studio, IBM DB2 9, MS Windows XP SP2, I.E. 8
2: WF 7.7.02, MRE, BI Dashboard, Self Service, Dev Studio, MS Windows 7 SP1, Apache Tomcat/6.0.20, MS SQL Server, I.E. 8     Output formats: HTML, Excel 2000 and PDF
 
Posts: 6958 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Reply With QuoteReport This Post
Platinum Member
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 7.7.02 - Unix/Solaris - Tomcat 5.5 - MRE / BID - Oracle - IE8

local: WF 7.7.02 - Windows XP SP2 - Tomcat 5.5 - MRE / BID - FOCUS - IE8 PMF 5.2.3 HF2
 
Posts: 156 | Location: Boston/New England | Registered: February 12, 2006Reply With QuoteReport This Post
Guru
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 7.6.11, Windows XP/2003, IBM DB2/400, Oracle RDB, MS SQL-Server 2005, Output: HTML, PDF, Excel 2010 - Currently testing WF 7.7.03 with Oracle 10g
 
Posts: 494 | Location: Netherlands | Registered: August 12, 2010Reply With QuoteReport 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 7.7.03M/Win 2008 - WF Client 7.7.03/Win 2008 - Dev. Studio: 7.7.03 HF1/Windows 7 - DBMS: Oracle 11g
Test: Dev. Studio 7.7.03 H1/Windows 7 (Local) Output: Mostly HTML/PDF/Excel 2000
 
Posts: 1264 | Registered: August 12, 2005Reply With QuoteReport This Post
Platinum Member
Posted Hide Post
njsden: That's it! Good One

Thanks!



Greg



current client: WF 7.7.02 - Unix/Solaris - Tomcat 5.5 - MRE / BID - Oracle - IE8

local: WF 7.7.02 - Windows XP SP2 - Tomcat 5.5 - MRE / BID - FOCUS - IE8 PMF 5.2.3 HF2
 
Posts: 156 | Location: Boston/New England | Registered: February 12, 2006Reply With QuoteReport This Post
  Powered by Social Strata  
 

IB - Developer Center    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-2011 Information Builders, leaders in enterprise business intelligence.