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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Fragment works standalone but not when inserted in a form

Avatar

Level 4
I have a search fragment. When I open the fragment and click "Preview" in designer. I click on the "search" button, and it executes a web service that retrieves info from a database and displays it into a table. Everything is working beautifully. The fragment is set to Interactive, and Dynamic XML form.



I now create a new form and I insert this search fragment into the form. This form is also set to Interactive, and Dynamic XML form. Now, when I click on the "search" button, all of the javascript behind the button executes (i.e. my messageBox debugging messages) but the web service that retrieves the database info doesn't seem to execute.



What am I missing? I'm perplexed as to why the fragment works stand-alone but doesn't want to work when incorporated into a parent form.



Any ideas?
14 Replies

Avatar

Level 10
Are you using the same PDF Viewer to look at the form? Are you using Reader or Acrobat?

Avatar

Level 4
Hi Paul, yes I have acrobat pro and am using the pdf viewer for previewing both the standalone fragment and the fragment when it's inside a form.

Avatar

Level 10
If you hit Ctrl-J and look at the java console ...are you getting any errors?

Avatar

Level 4
Nope, no errors in the java debugger console.

The fragment is an xdp (Adobe XML Form) - with form properties "Interactive Form" and "Dynamic XML Form"



The "parent" form that contains the fragment is an xdp with the exact same form properties as the fragment.



Here's what's in the debugger console, just general info:

Acrobat JavaScript Debugger Functions Version 7.0

Acrobat Database Connectivity Built-in Functions Version 8.0

Acrobat EScript Built-in Functions Version 8.0

Acrobat Annotations / Collaboration Built-in Functions Version 8.0

Acrobat Annotations / Collaboration Built-in Wizard Functions Version 8.0

Acrobat Multimedia Version 8.0

Acrobat SOAP 8.0



Anything else I can check?

--Elaine

Avatar

Level 4
I noticed this in the "log" panel at the bottom of Designer:



"Invalid Version: The current version of the XFA Template model exceeds the capability of Acrobat / Adobe Reader 8.1.

PDF Generated Successfully.

Form version is higher than target version. This form may not run properly on target.



2 warnings / errors reported."



Does this explain why the fragment works but the form does not?



Sign me still-learning,

Elaine

Avatar

Level 4
Acrobat Pro version is 8.1.3. Do I need to upgrade to a different version?

Avatar

Level 4
Lastly, one more thing... when I open the fragment standalone, I get the same "current version of the xfa template model" warning, but the fragment calls the web service properly, while the form does not.

Avatar

Level 10
That error only warns you that you have set a target version that is greater than the version that you are viewing with. The only time that will matter is if you use features that are intended for a later release. Fragments was officially added in version 8 so you shoudl be ok.



Is the web service in the public domain? Could I try this here and see if I can duplicate?

Avatar

Level 4
Sure, I can send an archive, can you email amalelaine@gmail.com so I can have your email address to reply with the archive? Or is there an alternate way to get the files to you?

Avatar

Level 4
Just sent them. Thanks for taking a look at this.



--Elaine

Avatar

Level 4
A huge thank you Paul, for resolving the issue for me. Turns out that you have to recreate the data connection on the main form.



Thanks again. I would never have figured that one out. 😉



--Elaine

Avatar

Level 4
Well, I'm not totally working yet. Even when I add the data connection to the main form, sometimes it calls the service (and returns one record only - probablay due to a positioned subform?) and sometimes it totally ignores the service.



The data connection on the form has the identical data connection name that is on the fragment.



I'm wondering if other "binding" is needed? When I create the data connection you can see the object fields are bound (red/green arrows).



Perplexed,

Elaine

Avatar

Level 10
No other data binding is needed .....can you validate that you are getting a response from the web service? You could modify the web service to write something to the log. This way you can at least know that it was called.