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     [CLOSED]Any techniques to disable a Submit button until report renders in New Window

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED]Any techniques to disable a Submit button until report renders in New Window
 Login/Join
 
Silver Member
posted
Hello Everybody!!

I'm looking for any techniques which will keep a submit disabled until a report (pdf, html, excel) renders in a new page..

We have this requirement to prevent users from re-clicking, especially on long-running reports.


Additionally, this is implemented in HTML forrms created in WF8 HTML composer...

At this point..

1. I believe I can get the button disabled on the clickEvent (button click)..(by using the document.getElementById("btnRun").disabled = true)

2. When the called fex has this HTMLFORM BEGIN/END and the output is PDF..then

a. if it is at the top of the fex..the PDF does not render correctly ..it presents the output as markup language...not PDF)..like this:

%PDF-1.4 6 0 obj << /Length 7 0 R >> stream BT /F1 1 Tf ET /GS1 gs 0 Tc 0 Tw 0 0 0 rg 0 0 0 RG 0 J 0 j 10.000000 w 10 M []0 d 1 i q 0.050000 0 0 0.050000 0 0 cm BT /F1 1 Tf 240 0 0 240 360 15280 Tm (PAGE )Tj 240 0 0 240 1224 15280 Tm ( 1)Tj 240 0 0 240 360 14680 Tm (MODEL)Tj ET 0.00 0.00 0.00 RG 360 14560 m 1080 14560 l S BT 240 0 0 240

b. if it is at the end of the fex (after the PDF)....it is not invoked at all.

TABLE FILE CAR
PRINT MODEL
ON TABLE PCHOLD FORMAT PDF
END
-RUN


-SET &NUM_REC = &RECORDS;
-HTMLFORM BEGIN
<script language="javascript">


setTimeout(resetForm(), 10000);

function resetForm() {
return function(){

opener.document.getElementById("btnRun").disabled = false;
opener.document.getElementById("btnRun").value = "go";
opener.document.getElementById("txtTitle").innerHTML = "finsihed '" + &NUM_REC + "'";
}
} //end fcn



-HTMLFORM END

3. There is "Wait for completion..." request/action..but I'm not how it works..nor if it is integrated w/ a page opening in a 2nd window.

Any insights would be greatly appreciated.

Wm

This message has been edited. Last edited by: <Emily McAllister>,


WebFOCUS 8
Windows, All Outputs
 
Posts: 30 | Location: Living in Charlotte, working all over | Registered: July 13, 2015Report This Post
Virtuoso
posted Hide Post
There is an onbeforeunload event that you could use on your destination window -- the window that opens with the report in it. That event executes when you close that window.

It's not perfect though, because someone could close the window prior to completion and start running a new report right away. But -- that might be something you want to offer them, because if they select the wrong parameter you don't want to force them to wait 20 minutes before they can run it again.

Option 2 is to have the report include a button in it that you can connect your opener.document logic to. That is, the user can only unlock the Submit button by clicking on something inside your final output, or having it go off on the output's onload event.

I'll be honest, a user with any moxie will figure out they can refresh the calling page and get their Submit button back. Or open a second copy. This will be a hard one to enforce with smart people.



 
Posts: 1012 | Location: At the Mast | Registered: May 17, 2007Report This Post
Silver Member
posted Hide Post
Thanks John...

I agree w/ all you are saying.
the HTML composer has a 'wait for completion..' method..which works fine if the output is HTML.

If it is PDF or Excel..then that does not get invoked..and the button stays disabled.

From my perspective..the 'wait for completion' should be output type agnostic..and it doesn't seem to be.


WebFOCUS 8
Windows, All Outputs
 
Posts: 30 | Location: Living in Charlotte, working all over | Registered: July 13, 2015Report This Post
Platinum Member
posted Hide Post
The closest we've come is trying to get the users to select Run in New Window. We find they are less likely to hammer the Submit button. First because there is an indication that the report is still running and second because each submit opens a new window.

I've been looking into ways to make that setting the default, but I'm not sure yet.

Two days ago someone consumed all the WebFocus initiators using multiple Submits. This does not sit well with the other users. :-)


WebFOCUS 7.7.05 (Someday 8)
Windows 7, All Outputs
In Focus since 1983.
 
Posts: 103 | Registered: April 27, 2011Report This Post
Silver Member
posted Hide Post
I believe there is room for a slight improvement here. (and I can put in a NFR)

That 'Wait for completion...' task (in the HTML composer) should be output agnostic. Since the xmlroot document is, I assume, communicating behind the scenes aleady with the client, then it should not be too much of a stretch to have it receive something/update something regardless of the output format..because, regardless of what is running ..it has to complete some how (normal end, agent killed, abend).

Any of those end events should tell the form that the process completed..and do its thing..

then..error conditions (ie non normal conditions could be handled one way..normal conditions another.

but..what do I know..


WebFOCUS 8
Windows, All Outputs
 
Posts: 30 | Location: Living in Charlotte, working all over | Registered: July 13, 2015Report This Post
Master
posted Hide Post
W,

What are your redirection settings? I know when I first upgraded to 8.0.08, I had to set my excel to always save on the server and then send the output. The reason I had to do this, was because in the default prompt popup, if I ran an excel report, I wouldn't get the run button back after submitting Excel requests. I don't know if this will help, but I would suggest seeing if this has an impact as I believe it might be the difference between sending a response call or not.


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, 2013Report This Post
Virtuoso
posted Hide Post
What we do (although only in a few cases) is disable the submit button until the target window fires its onload event.
In JQuery terms, those events are called 'submit' and 'ready'.

For that to work, you need to attach events to onsubmit in the launch page and to onload in the target window (attach the event handler from your launch page though and not from the target window!).

You might also want to catch form-validation errors and if those occur, not disable the submit button (or something like that - I'm not at all clear on the correct behaviour there).

Unfortunately, IBI made that a bit complicated... Until they implement our NFR for a return status in OnExecute, you can instead use the function replacement pattern that I shared around a week ago...


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
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED]Any techniques to disable a Submit button until report renders in New Window

Copyright © 1996-2020 Information Builders