Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

While loop with Or statement

Avatar

10-06-2008

Is it possible to have a while loop with the or (||) comparison.



I've been trying while (x != 1 || 2) and variations such as while (x != 1 || x != 2).



When I have just one statement the loop performs as normally, but when I add the second argument it seems to become an infinite loop, I've tested to make sure the variable is updating so I'm pretty sure the problem lies in my loop statement.



I am fairly new to javascript so this might be a case of me trying to use features from other languages that arent available in javascript.



Thank you



Paul

Replies

Avatar

28-07-2008

Actually my query is when i try to make a dialog box open through

"app.response" or through "commit:function (dialog)" function it works fine but the thing is 'warning:javascript window' text is visible but i need to hide this or please suggest an alternative idea for opening a dialog box which is being used as a SEARCH functionality

Thanks a lot

BalajiGurumurthy

Avatar

29-07-2008

The following code is an example of webservices calling..

var response = SOAP.request({

cURL: myURL,

oRequest: req,

cAction: mySOAPAction,

bEncoded: false,

cNamespace: myNamespace,

cResponseStyle: SOAPMessageStyle.Message

});

app.alert(response[0].soapValue[1].soapValue);

The thing is that can u suggest me an idea how to parse the variable 'response' and get the values.

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

29-07-2008

Why not put the response into a hidden field then you can parse it all you want. There is no way to remove the 'warning:javascript window' from the response. That woudl be a breach of security.

Avatar

30-07-2008

var myURL = "?wsdl url";<br />var myNamespace ="http://adobe.com/workflow/services/<webservice name>";<br />var mySOAPAction = "?wsdl url";<br />app.alert(myURL);<br />var aStr = {soapType: "xsd:string", soapValue: "GetUserList:vij"};<br />var req = {};<br />req["synchronousInvoke"] = {a: aStr};<br />var response = SOAP.request({<br />cURL: myURL,<br />oRequest: req,<br />cAction: mySOAPAction,<br />bEncoded: false,<br />cNamespace: myNamespace,<br />cResponseStyle: SOAPMessageStyle.Message<br />});<br /><br />app.alert(response);<br /><br />I have a doubt regarding this variable "response". Actually when i just try to print what the variable contains it is returning as '[object Aggregate]' - but what is it actually denoting and am not getting any idea of really what it is. Only if i know of what that variable is returning then i can able to proceed.<br />Please can u jus simply explain a sample code for clear understanding.<br />Thanks a lot<br />BalajiGurumurthy

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

611 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

30-07-2008

You are getting the entire Soap response not a string so you should be able to interogate the response object by pathing your way down to the node that you want in the response. If you are usinng Acrobat there is a Soap monitor that will allow you to see the response object. You will have to turn on the Javascript debugger to use it (only in Acrobat).