Focal Point
Pop up alert after Query in .fex

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6091054012

January 30, 2007, 05:02 PM
Alan Main
Pop up alert after Query in .fex
I am executing a simple query in a .fex file that looks like this:

TABLE FILE LERTSAVRPT
PRINT
DST.SVDRPTOPT AS ''
WHERE REPORT_ID = '&strRepKey'
AND NT_ACCOUNT_NM = '&SelUser'
ON TABLE SAVE AS TMSVDRPT FORMAT ALPHA
END

I'd like to add something like this:

-IF &LINES GT 0 THEN
ELSE


which would pop up the typical little grey box with the OK button like the alert statement in javascript does. Are there webFocus statements that can do this inline? If not how can I invoke a little javascript at this point?

My .fex file has a -HTMLFORM section that displays several text boxes and select lists to the user. Within the html are several javascripts already for things like onclick, onchange...can I insert the above javascript there or would it have to be in a location referenced by some sort of jsURL setting?
January 30, 2007, 05:12 PM
susannah
the question is whether or not you want processing to STOP while the user interacts with something...thats a very mainframe concept.
I send myself messages throughout some processes using the
CMD NET SEND mycomputername SOMEMESSAGE TEXT HERE WITH EVEN SOME &VAR CONTENT
and a box pops up and processing continues
but that requires that you know the computername for each of your userids.
Also, we don't know your config, so do please edit your profile and inthe signature box, put your config.
Your computer name? click right on MyComputer on your desktop, click Properties, and the ComputerName tab.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
January 30, 2007, 05:24 PM
Alan Main
This application will be used by many users in different locations so addressing individual computer names would not be practical. I guess processing would stop while the user interacts, but that's what happens anyway...the html presents a form to the user, which waits indefinitely until the user makes a few selections and presses Submit, at which point a webFocus report is generated. I am just adding an intermediate step that will save one of the user entries to a table, and I want to pop up a 'Data Saved' or 'Failed to Save' message.
January 30, 2007, 05:57 PM
susannah
not to beat a dead horse, (or maybe its too late,) if you have a network, that sort of thing is maintained in active directory tables - network logon to computer name




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
January 31, 2007, 06:56 AM
OPALTOSH
After your report you could add
-RUN
-IF &LINES GT 0 GOTO REPORTOK;
-TYPE your message or -HTMLFORM htmlpagename
-GOTO EXIT
-REPORTOK
.. whatever you want to do for non zero records
-EXIT

This is the only way to do IF condition THEN action1 ELSE action2
in dialogue manager.
January 31, 2007, 09:39 AM
susannah
however, Adelaide, he won't see the results of that -TYPE statement unless he views the echo of the job, or the view source on the final report provided echo is on.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
February 01, 2007, 12:44 AM
OPALTOSH
Susanah,
You are right about the TYPE but that is why I included the HTMLFORM option which will display a message which the user can see.
Or you could run a dummy report which just outputs a heading with the relevant message/information in it.
February 01, 2007, 02:53 PM
Alan Main
I didn't realize I could have more than one HTMLFORM section in my .fex file. The following does what I want:

-HTMLFORM BEGIN
<script>
alert("Value &SomeValue saved.");

-HTMLFORM END
-RUN

which is basically what OPALTOSH suggested.
Thanks, all.
February 02, 2007, 05:42 AM
Tony A
Alan,

Don't forget to use well formed HTML code in your HTMLFORM section. I know most browsers will suffer it, but one day ................

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10