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.
I am attempting to create a java script that would work with Webfocus 8.1 v5 that would work with an onclick event, however I need for a specific process to complete first then the balance of the processes.
I have the following code that works for me, however I need for the highlighted line to complete and then the following events to complete. This panel is notifying my user that I am processing their request. Since there are so many reports being populated at one time it takes approximately 25 seconds for this to complete. Because there is no change in the screen, the user doesn’t realize that the processes are working unless I add in the alert that is commented out. However we do not want to have to answer the alert .
Is there anyway I can get this to work?
if(typeof(bRuntime) != 'undefined') { // TODO: Add your inline runtime code here } //Begin function window_onload function window_onload() { window.resizeTo(1920,1000); IbComposer_showHtmlElement('pnlMain', false ); IbComposer_showHtmlElement('pnlLoading', true ); IbComposer_showHtmlElement('pnlProcessing', false ); UpdateData(); // TODO: Add your event handler code here //add onInitialUpdate() function to make changes before initial run of the reports } //End function window_onload //Begin function onInitialUpdate function onInitialUpdate(){ IbComposer_showHtmlElement('pnlMain', true ); IbComposer_showHtmlElement('pnlLoading', false ); } //Begin function edtFieldbbTicker_onkeypress function edtFieldbbTicker_onkeypress(event) { var eventObject = event ? event : window.event; var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement; // TODO: Add your event handler code here if (event.keyCode == 13) { // For Enter. // Your function here.
Always put code that's posted to the forum within code tags (click on the </> icon).
[code]
your code here
[/code]
I assume the highlighted line is commented with //needs to complete. I cannot figure out what's going on in here, but if it's an external program of some kind, I would trigger the "balance of the processes" from that program, referencing components using parent. or window.parent. or whatever works...
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
Nena is using the IbComposer_showHtmlElement() function to switch on a hidden Panel box with the message "Processing" in it before running a bunch of reports.
The problem is that nothing changes in the Processing message while all those reports run. So the user doesn't know what is happening (To the user, it might seem that something has gone wrong).
I have a way to display a rudimentary progress bar using just the App Studio components, but it will only work if all those IbComposer_execute() calls run sequentially (i.e., they can't all be running at the same time).
Nena, do you know if each report finishes before the next one begins? The IBI documentation doesn't say.
App Studio WebFOCUS 8.1.05M Windows, All Outputs
Posts: 594 | Location: Michigan | Registered: September 04, 2015
A couple of general remarks to make things easier on everybody:
Indent your javascript code for every level of opening/closing accolades. That makes it much easier to see where blocks of code belonging to the same function or condition begin and end. I know the code template that IBI generates in App Studio (or Dev Studio) doesn't do this, but that doesn't mean you have to follow lead. In fact, I am under the impression that their lack of proper indentation is due to the way they generate HTML pages from their templates (or whatever is behind that) and that those templates may in fact contain indentation.
Secondly, aim to make a single function only perform a single task. In your event handler above, you're hiding multiple components, then you do some processing and then you show them again. Put those separate tasks into separate functions, turning those operations into a single function call in the event handler.
Once your scripts grow to a size of any significance, put them in a separate .js file (or several files even) that you include. Those files are easy to edit in external editors, for example, and if you design them well they can even be reused in other html pages.
Now to get back to the core of the issue; what type of HTML components are 'report1' to 'report12'? I'm guessing they are (i)frames, in which case they will fire an onload event when they complete loading. With that in mind, you could attach an event handler function that checks whether all 12 reports fired their event yet. When the last report fires its onload event, you can hide the 'pnlProcessing'-related elements.
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 :
I do exactly what you are describing with interrogating the Ready state of the Iframe to identify whether a report has finished running, then firing off post processing once its done. It has worked well for the last year and a half since I implemented it. One word of warning. The initial change of the frame in general is IBI setting the loading frame to the IFrame. So the first "Complete" Status you get might not be for the report itself. I put in a loop to test for X amount of occurrences before I went on to my second step. Also the other thing I noticed is that IE (I think it was IE... might have been specifically IE 8 or 9.... its been a while), had a different amount of times it would cycle through the states. So for one browser I had to check for the 3rd occurrence and the others I had to check for the 2nd. So If you do end up going this route, make sure to check for how many times the IFrame "Completes".
Eric Woerle 8.1.05M Gen 913- Reporting Server Unix 8.1.05 Client Unix Oracle 11.2.0.2
Posts: 750 | Location: Warrenville, IL | Registered: January 08, 2013
Originally posted by Squatch: I think I see what is going on here.
Nena is using the IbComposer_showHtmlElement() function to switch on a hidden Panel box with the message "Processing" in it before running a bunch of reports.
The problem is that nothing changes in the Processing message while all those reports run. So the user doesn't know what is happening (To the user, it might seem that something has gone wrong).
I have a way to display a rudimentary progress bar using just the App Studio components, but it will only work if all those IbComposer_execute() calls run sequentially (i.e., they can't all be running at the same time).
Nena, do you know if each report finishes before the next one begins? The IBI documentation doesn't say.
Squatch, You are correct, and the following calls do run sequentially.
Originally posted by Squatch: I think I see what is going on here.
Nena is using the IbComposer_showHtmlElement() function to switch on a hidden Panel box with the message "Processing" in it before running a bunch of reports.
The problem is that nothing changes in the Processing message while all those reports run. So the user doesn't know what is happening (To the user, it might seem that something has gone wrong).
I have a way to display a rudimentary progress bar using just the App Studio components, but it will only work if all those IbComposer_execute() calls run sequentially (i.e., they can't all be running at the same time).
Nena, do you know if each report finishes before the next one begins? The IBI documentation doesn't say.
Squatch, You are correct, and the following calls do run sequentially.
thanks Nena
I just re read your comment, they do run sequentially, however nothing is displayed until all are finished.
Thus, my issue, I need the first to run and complete until I turn that panel off, after the reports have ran.
I hope this clears up my issue. Sorry I didn't respond quicker, I was pull into another project that had to be completed before this one.
I need the first to run and complete until I turn that panel off, after the reports have ran.
From the above I do not understand in what order you need things to happen. I'm probably not alone in that. Perhaps you could turn above statement into a list of subsequent steps that you need to happen? Preferably with the inclusion of which IbComposer_execute calls go with those steps?
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 :
I need the first to run and complete until I turn that panel off, after the reports have ran.
From the above I do not understand in what order you need things to happen. I'm probably not alone in that. Perhaps you could turn above statement into a list of subsequent steps that you need to happen? Preferably with the inclusion of which IbComposer_execute calls go with those steps?
I am using AppStudio, with a onkeypress event.
when the user presses enter I need for the java script call to execute in the following order.
1. IbComposer_showHtmlElement('pnlProcessing', true ); This is the processing panel to be shown to the user. This will need to complete first then the following reports will need to be completed
2. IbComposer_execute('report14', 'report14'); This report takes the users entry and breaks it into the variables used in the sequential reports.
3. IbComposer_ResetDownChainControls('edtFieldbbTicker'); This sets all the variables for the following 12 reports