Expand my Community achievements bar.

SOLVED

Binded fields associated with separate Web Service requests

Avatar

Level 2

Hi,

I'm attempting to create a Data Connection that allows the user to select from approximately 2000 attributes. Presently, my web service operation request takes in an ID value and returns an object encapsulating these 2000 attributes.
If for example I have a "firstName" attribute is it possible to have 2 instances of this field on my form but associated with different request IDs?
If so, how do I go about this?

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

I assume that the workitemID is unique for eachweb servce call made ...correct. So in fact you are making two different web service calls and want to bind the name to the same field but maintain the data from the previous call right?

Paul

View solution in original post

21 Replies

Avatar

Former Community Member

You will not be able to return an object as Acrobat/Reader will have no idea what that object is. You can only return simple types. Or you could return XML and load that into the DOM and parse it to get the values you want.

Paul

Avatar

Level 2

Thanks for your reply. My WSDL operation does return an object which contains all these attributes as simple types. So I then have a list of these attributes for selection from the Data View. I presume if they're there for selection that they will be bound when the web service response is returned?

Regardless how can I solve the problem outlined in my original post?

Thanks.

Avatar

Former Community Member

Are they being returned as 2000 individual nodes or one node containing XML with 2000 attributes?

I guess a better way of asling this woudl be in the DataView in Designer do you see 2000 nodes to bind to or a single node (that may contain upto 2000 attribute values)?

Paul

Avatar

Level 2

If I'm understanding the term "node" correctly then I have one node with 2000 attributes.

I've attached a screenshot of my Data View to make sure I've answered this correctly.

Avatar

Former Community Member

Then you shoudl be able to simply bind to the fields you need.

Paul

Avatar

Level 2

OK, but just in reference to my original query how do I go about having 2 instances of a "firstName" field on my form but associated with different request IDs?

So potentially on my form, the 2 firstName fields would have different values.

Where can I get more information on doing this?

Avatar

Former Community Member

Each firstname field will be unique by the expression that is used. If the field is not in a repeating section then the field itself will have an occurance number (i.e. firstName[0]).

So simply drag and drop the node you want onto the field and you shoudl be good to go!

Paul

Avatar

Level 2

Thanks. Where can I get more information on these expressions that you refer to or where are they entered?

Avatar

Former Community Member

It is described in the help but it is not easy to find. If I get confused and I am unsure I simple write a simple command to have the SomExpression determined for me. I use this ocmmand to get the value then adjust my script accordingly:

app.alert(objectname.somExpression);

This will return the full path (include instance numbers) of the object identified in the command.

Avatar

Level 2

I'm sorry but I'm not sure I'm grasping this fully.

I see if I drag on 2 firstName fields onto the form that one has an instance number of 0 and the other an instance number of 1.

But as these fields both belong to the same Web Service operation then surely they will contain the same values on population when the response is returned?

I want them to contain different values, say "David" if the workItemID in the request is 245 and "John" if the workItemID in the request is 467 etc.

Is it possible to configure this approach? Just want to clarify this.

Avatar

Correct answer by
Former Community Member

I assume that the workitemID is unique for eachweb servce call made ...correct. So in fact you are making two different web service calls and want to bind the name to the same field but maintain the data from the previous call right?

Paul

Avatar

Level 2

Yes, that's it. The workItemID is indeed unique.

So I want to have 2 "firstName" fields on the same form that are effectively populated with data from 2 separate web service calls.

Avatar

Former Community Member

The binding that you are doing assumes that you will have a one to one mapping hence you woudl need a unique data connection for each web service call that you want to make. The Form Design does not support a dynamic bind so you cannot change it after th eform is rendered. So the way I solved this was to return all of the data in a single field in the WS as XML. I could then load the XML into the data dom and map the values of the data to th efields by script.

Paul

Avatar

Level 2

Thanks for your explanation. In this case, just to clarify, would the Data Connection in this case be an XML file or are you suggesting to say return an array as part of the Web Service incorporating all Work Items? (not too sure if the latter works)

Avatar

Former Community Member

I woudl return a string that represents an  xml structure that includes all work items. You may have to wrap it in a CData section so that the rest of the SOAP envelope does not get confised.

Paul

Avatar

Level 2

I've had a look now at the SOM Expression Specification.


If I return all workItemIDs say is it possible to use an expression to select the workItemID that I am interested in?

As far as I can see the array notation must be numeric, so you'd need to know what order the Work Items have been returned in.

Is there any notation similar to a "where workItemID = 'ABC'" clause?

Thanks.

Avatar

Former Community Member

Not by default...there may be something in XPath for that (I am no expert in XPath) but that would be it.

Paul

Avatar

Level 2

OK, I presume so XPath is supported as a method for binding fields to XML elements etc? I didn't see any mention of it in the SOM Specification.

Avatar

Former Community Member

No XPath is not supported on the client ...only on the server. Sorry if I mislead you.

Paul

Avatar

Level 2

No worries...but I am a bit confused now. Do your replies (numbers 13 and 15) above apply for the client or just the server?

If not, is there any way around this for the Adobe LiveCycle Designer client?

Thanks.

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----