user1023
user1023

Reputation: 39

Webspeed allows Nested IF statements from Progress 4GL?

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

Answers (2)

Tom Bascom
Tom Bascom

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

Jensd
Jensd

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

Related Questions