Reputation: 39
Does Javascript accept nested IF statements coming from Progress 4GL? This piece of code below is placed inside the document ready function, is this acceptable in javascript? When the pdf appears, it shows nothing.. :(
<!--WSS IF get-value('action') = 'print' then DO: -->
<!--WSS IF get-value('action') = 'go' then DO: -->
newPopup("print_preview.html?win=pdf&programname=pdf_sample2.p",1250,1250);
<!--WSS END. -->
<!--WSS ELSE DO: -->
newPopup("print_preview.html?win=pdf&programname=pdf_sample.p",1250,1250);
<!--WSS END. -->
<!--WSS END. -->
Upvotes: 0
Views: 493
Reputation: 14020
Did you perhaps intend to code something like this:
<!--WSS IF get-value('action') = 'print' then DO: -->
newPopup("print_preview.html?win=pdf&programname=pdf_sample2.p",1250,1250);
<!--WSS ELSE IF get-value('action') = 'go' then DO: -->
newPopup("print_preview.html?win=pdf&programname=pdf_sample.p",1250,1250);
<!--WSS END. -->
Upvotes: 1
Reputation: 8011
These two lines:
<!--WSS IF get-value('action') = 'print' then DO: -->
<!--WSS IF get-value('action') = 'go' then DO: -->
Implies that the parameter "action" must be both 'print' and 'go' for this line to run:
newPopup("print_preview.html?win=pdf&programname=pdf_sample2.p",1250,1250);
That will of course never happen (action can only have one exact value). If "action" has the value 'print' the second popupscript will be called.
You have to keep in mind what is happening on serverside (everything WebSpeed related) and what happens on clientside (HTML, JavaScript, CSS).
Look at the rendered HTML-code in your browser. Does it look OK? Also: do you get javascript errors in the console? These are basic HTML/JavaScript debugging steps to take.
Upvotes: 3