Expand my Community achievements bar.

XDP/PDF pre-population and Submit URL issue.

Avatar

Former Community Member
Hello,<br /><br />We have a forms processing engine running on Windows 200K/XP using Java and jboss' app. server. I am currently having trouble getting XDP functioning properly and I am wondering if someone out there can help. Here are the steps:<br /><br />Using LifeCycle Designer 7.0 I create a form. This form basically has a Submit button and 1 text field. I save this form in both XDP and PDF. The submit button has a submit event in the XDP. <br /><br />Before I attempt to render this to Reader, I modify the XDP to change the 'target' attribute of the <submit> element and I also add a value to the text field. I also add (at the end of the XDP) the PDF file (Base64 encoded) as a <pdf> element. Basically the end of the pdf looks like this:<br /><br /><pdf xmlns="http://ns.adobe.com/xdp/pdf/"><br /> <document><?KeepOnDisk?><br /> <chunk>Base64EncodedStuff<br /> </chunk><br /> </document><br /></pdf><br /></xdp:xdp><br /><br />Once this is done I stream it down to the browser (IE 6.0) and the form comes up in Reader. What I notice is this.<br /><br />1.) Even though the text field (in the xdp) has a value, it doesn't display.<br /><br />2.) Even though the submit button's submit event is setup to call my servlet (in the xdp), it doesn't submit.<br /><br />What I have observed is that what ever I did to the form when the PDF was generated, that's the behavior I see. If I define the submit URL to be 'test.jsp' during form design time, when rendered, the form attempts to find test.jsp instead of the url I defined in the XDP. This is true for the field value as well. It will onlt display the default value as designed into the form.<br /><br />What am I missing? I thought the whole purpose of XDP was to facilitate this exact type of processing! Does the PDF override everything in the XDP?<br /><br />All help is greatly appreciated.<br /><br />Thanks,<br />Bob<br /><br />P.S. And this could be important...If I have a form with ONLY a submit button, I can get it to call my servlet. Very, very strange!
7 Replies

Avatar

Former Community Member
Well, for some strange reason the submit seems to work. Not quite sure what I did. Literally all I did was reboot my system. Strange<br /><br />As far as data pre-population...well I'm still having trouble. I am now trying to add a <xfa:dataset> section. From what I read this should do the trick but doesn't seem too. I am assuming the xfa:dataset XDP structure looks as thus:<br /><br /><xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/"><br /> <xfa:data><br /> <subformname1><br /> <Send /><br /> <TextField1>Field1Val</TextField1><br /> <subformname2><br /> <TextField2>Field2Val</TextField2><br /> <TextField3>Field3Val</TextField3><br /> </subformname2><br /> </subformname1><br /> </xfa:data><br /></xfa:datasets><br /><br />Is this the correct way to map data to fields in an XDP document? <br /><br />Thanks,<br />Bob

Avatar

Former Community Member
Boy do things keep changing...with the exception that I keep talking to myself here, but I suppose it's worth a try.



We upgraded to Designer 7.1 and here's what's going on (even though this was the same behavior as 7.0).



Now by using the datasets as described above and by not chunking the pdf, but rather referencing it through the pdf tag's href attribute, the data prepopulates. Good enough for me.



The issue is redefining the submit url. It only atempts to the url added at desgin time. What I discovered is if I add to a text field the URL I want to submit to and use the following javascript for a regular button it does attempt to call the proper servlet.



event.target.submitForm(form1.Sub1.TextField1.rawValue);



Now when I attempt to submit a form in this capacity, what am I going to get? I want XDP. Is there a way to tell submitForm to submit XDP?



Thanks,

Bob

Avatar

Former Community Member
I doubt you'll find a way to submit XDP with submitForm(). If you know the URL you want to submit to from within your form why not just set the URL on a submit button that's set to submit an XDP to the server.



Button1.resolveNode(#event.submit).setAttribute(http://somedomain.com, target);



Chris

Adobe Enteprise Developer Support

Avatar

Former Community Member
Hey Thanks Chris! I'll give that a try. I didn't know that capability existed. What I'll probalby do (which I'll assume is ok) is make the call look like this...



Button1.resolveNode("#event.submit").setAttribute(form1.Sub1.TextField1.rawValue, "target");



I would need to do this to allow for a dynamically created URL.



Thanks again for your help.

Bob

Avatar

Former Community Member
Chris,



If you are still out there I'd like to ask another question if you don't mind.



I did the above resolveNode call to execute on the initialize event of the TextField1 edit box. Button1 is setup as a Submit event with no url and is defined to return XDP (I believe I set that up correctly) When I am in Designer 7.1 and I go into the PDF Preview window and test it, it works great. It tries to call my servlet when I press Button1. However, when I use Reader 7 (7.0.7 Professional to be exact) and press Button1, I get an "Invalid arguments" error.



Do you know why that is or what I might be doing wrong?



Thanks,

Bob

Avatar

Former Community Member
Hmmm,



For whatever it's worth, especially since I can't explain why, when I open it in Reader 7 the submit action now calls my servlet. If I figure out why, I'll try to remember to post here.



Bob

Avatar

Level 6
Hi,



As far as I know, the chunked pdf will only interact with XDP data if the PDf is reader enables using reader extensions, so for me, this is natural:



1.) Even though the text field (in the xdp) has a value, it doesn't display.



2.) Even though the submit button's submit event is setup to call my servlet (in the xdp), it doesn't submit.



Am I right?



Thank you