6 Replies Latest reply on May 7, 2009 3:26 PM by Kevin Cavallo

    Static vs. Dynamic Forms

    Kevin Cavallo Level 4

      I thought that I understood static vs dynamic forms, but what I'm seeing has me stumped.  Here's the issue:


      I have a form that requires multiple instances of a subform, based on repeating nodes in XML data.  Inside each subform instance there are data fields, but I can't bind them directly to the XML because the values require some calculation based on the data passed in.  So, I have a javascript loop in the containing subform that creates a new instance of the repeating subform and sets the rawValues of the underlying data fields.  The javascript is in the Initialize event.  I'm passing the .xdp into Output for rendering.  The script is set to run on the Server.

       

      The issue is that when I look at the resulting PDF file in Reader, I do have the correct number of subform instances displayed.  However the data fields reflect the data from the first instance, so that I might have five sections that all look the same and the data is correct for the first section.  The form will render fine in the Designer preview if I set the form preview type to Dynamic, but the behavior will replicate the Output behavior if I set the preview to Static.

       

      What I understood is that having a static form will mean that the form will not *re-render* in Reader, but the initial form rendering in Output should create the subforms correctly.  I am getting multiple instances, they just don't reflect the correct data values.

        • 1. Re: Static vs. Dynamic Forms
          pguerett Level 6

          What event do you have your code on? Is it possible that the event is not firing on the server but is firing on the client?

           

          Paul

          • 2. Re: Static vs. Dynamic Forms
            Kevin Cavallo Level 4

            I've tried this in the Initialize event and in the Form Ready event.  I've also rewritten the form to repeat the subform via databinding on the multiple XML nodes and tried filling in the data on the IndexChange event.  No luck.

            • 3. Re: Static vs. Dynamic Forms
              pguerett Level 6

              Can you post the form and data and I will give it a try ......you will have to save th eform as a PDF to post it here. I have already asked to have xdp allowed but it takes time.

               

              Paul

              1 person found this helpful
              • 4. Re: Static vs. Dynamic Forms
                Kevin Cavallo Level 4

                Paul, thanks for your help.  I've figured out the problem, although perhaps you can tell me what the underlying issue is.  In the repeating subform the text areas that I was setting were defined as Text objects.  Redefining them as TextField objects has fixed the problem.  Any idea why setting the raw value of a TextField is different than a Text object?  I originally didn't need to use a text field because these are non fill-in text areas on the form.  Once again, this was only an issue if the form output was set to static rather than dynamic.

                 

                Regards,

                Kevin

                • 5. Re: Static vs. Dynamic Forms
                  pguerett Level 6

                  A TextField is an interactive object that allows the user to enter information. A Text Object is simply text (like instructions). The Text object usually does not change at run time. I do not think that a Text Object has a rawValue property.

                   

                  Paul

                  • 6. Re: Static vs. Dynamic Forms
                    Kevin Cavallo Level 4

                    Yeah it does.  Throw a text object on a subform and in the subform's initialize event, set the text object's rawValue to a string.  It'll work.  There's just some funny business when it's on a repeating subform rendered in Output.  Works great in Reader.