Highlighted

Web Service and flowable subform

_jerome_dinnat_

10-07-2008

Hi,



I call a web service in my form to retrieve some fields.

I retrieve a list of users (login ,name, email etc ...).



I want when I click on the button that all the fields appear in a table.



I try to drag and drop the connection body to the form design. It create me a table in a flowable subform with an overflowleader and fields that look well. In the binding tab I check that Repeat is check but when I click on the form there is only one row fill in.



Thanks for the help 🙂



Edit : the form is an interactive pdf form.



For example the web service return me 4 users.

If I click on the button only the first user data creating a row.

If I fill 4 in the repeat min box, the 4 rows with data appear but I can specify this value, it depends on what the users choice.



I try to add script in the button :



MyNodeToRepeat.instanceManager.addInstance(0);



but I need to click 4 times on the button.

Replies

Highlighted

_jerome_dinnat_

10-07-2008

I add this script in the request button : <br /><br />var i = xfa.connectionSet.Connexionauxdonnées.nodes.length;<br />for(var j=0;j<i-1;j++){<br /> this.resolveNode("requeteFilsResponse.result.liste").instanceManager.addInstance(0);<br /> }<br /><br />but I think it isn't the way to do this. <br /><br />It works but I have a empty row before I click on the button (the repeat min box is fill to 1, if don't check the box it doesn't work )
Highlighted

_jerome_dinnat_

11-07-2008

Hi,



var i = xfa.connectionSet.Connexionauxdonnées.nodes.length; just give me the nodes number under Connexionauxdonnées but what I want is the number of nodes returned by the call to the web service.



How can I have that ?



Thanks
Highlighted

_jerome_dinnat_

11-07-2008

I try a different way but I still have problems 😞



SOAP.wireDump = true;

var oListURL = "http://par-f-pwxp-2115:8080/InfoBis/ServiceWebSfrBis?wsdl";

var service = SOAP.connect(oListURL);

var e;

try

{

xfa.host.messageBox("Starting list retrieval.");

var service = SOAP.connect(oListURL);

if(typeof service != "object") {

xfa.host.messageBox("Couldn't get List object.");

}

if(service.requeteFils == "undefined") {

xfa.host.messageBox("Couldn't get requeteFils Call.");

}

// Start the query

var name = 'myname';

var oItems = service.requeteFils(name);

xfa.host.messageBox('oItems'+oItems);

if(oItems == null) {

xfa.host.messageBox("List empty.");

}



...



My oItems variable has always the undefined value. However if the web service return me value if I use it by drag and drop it directly on the form.



Any ideas ?



I just want to know the number of Items returned. 😞
Highlighted

_jerome_dinnat_

11-07-2008

I change the code to work with document/literal web service. I can see the result in the console and my data are there in a xml format.<br /><br />In that statement : <br /><br />var oItems = service.requeteFils(name);<br /><br />The result is load in the variable oItems ? Therefore, the variable oItems is an Xml variable ?<br /><br />Edit: I can retrieve the number of node by this statement : <br /><br />var nfils = oItems[0].soapValue[0].soapValue.length;<br /><br />then I call my instancemanager on my repeatable subform :<br /><br />for(var j=0;j<nfils-1;j++){<br />this.resolveNode("Liste.Repete.Tableau").instanceManager.addInstance(0);<br /> }<br />xfa.connectionSet.connectionFils.execute(0);<br /><br />and execute the webservice again. It works but I call the web service twice which is not very well.<br /><br />How can I do better ?<br /><br />Thanks a lot.
Highlighted

Avatar

Guest

14-07-2008

Scripting should not be necessary. Check to make sure you're saving as a dynamic pdf and make sure the "Re-merge Form Data" option is selected on the button properties (Object inspector, Execute tab). Also note that doc/lit is the only supported operation type.

If you want to add some script for debugging purposes, you might find it helpful to use the saveXML() method in the postExecute event and throw the output into a text field.

e.g.



Highlighted

_jerome_dinnat_

14-07-2008

Hi again,



What I want to do is when I click on a button a web service is call with in input a name present in a textfield and in output a list of persons depending on this name.



In my table, I put the informations of this person in a column and opposite of that the informations of the persons present in the list.



It works the first time I click on the button.



But if I click again with a different name, no new rows are created but the old data are replaced by the new ones. It make sense for me but I don't know how to solve this problem.



Do I need to save the data with script and to fill my table after ?
Highlighted

Avatar

Guest

15-07-2008

So, if I understand you correctly, the field that you're binding to the web service request is not part of the table. You want to be able to change the value of that field and call the web service multiple times. Each time a call is made the response is added to a new row in the table. Is that correct?



Ernest

Adobe Systems
Highlighted

_jerome_dinnat_

16-07-2008

Hi,



Actually, I have a table with three columns and four rows.

My webservice's response is a list of users containing four informations for each user (login, name, email and division). Each information is binding to one case of the second column.



For example if the list is :



first response



User1 = apink, alex pink, apink@..., 5

User2 = tblue, tony blue, tblue@..., 5



My table will look like this :



column one | column two | column three



apink

alex pink

apink@...

5

----------------------------------------------

tblue

tony blue

tblue@...

5

-----------------------------------------------



which is what i want. But I want that if I call the web service again with a different parameter a new table will be created and the old will be still here like this :



second response



User1 = kvarsen, Kyle varsen, kvarsen@..., 5

User2 = someone, some one, sone@..., 5



column one | column two | column three



apink

alex pink

apink@...

5

----------------------------------------------

tblue

tony blue

tblue@...

5

-----------------------------------------------

column one | column two | column three



kvarsen

kyle varsen

kvarsen@...

5

----------------------------------------------

someone

some one

sone@...

5

-----------------------------------------------



I hope to have been clear.



Thanks for your help