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.
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? TIAThis 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
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
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 :
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
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
Hope this helps.This message has been edited. Last edited by: njsden,