My first tutorial on XML schemas explained how to connect your form to a schema however it did not show some of the Data View palette’s special features with respect to metadata in XML schemas.
Using metadata based on a combination of the XML Schema appInfo and Dublin Core title and description elements, you can influence how the Data Connection Wizard creates fields you drag and drop from the data connection tree into your form. You can also direct the Data View palette to show some of this information in the Schema Data Connection Tree that it displays.
Continue reading…
Posted by Stefan Cameron on August 28th, 2009
Filed under
Data Binding,
Designer,
Scripting,
Tutorials,
XFA
In previous tutorials, I have shown how to connect an XFA form to a database and a web service. Next on the list is the XML Schema (XSD).
If you work in an enterprise setting, chances are you may have already had to deal with corporate data schemas that define how that data is structured. The goal, when connecting a form to a schema, is to ensure that the data consumed and output by the form adheres to a specific structure. Any fields bound to data nodes that aren’t inside the schema space are basically ignored at time of submission.
Continue reading…
Posted by Stefan Cameron on August 3rd, 2009
Filed under
Data Binding,
Designer,
FormCalc,
Instance Manager,
Tutorials,
XFA
Have you ever needed to create data nodes in the Data DOM on-the-fly? How about a need to parse XML obtained from a web service data connection in order to find a value for some property? If that’s the case, then you’ll find-out how to do it in this article.
Creating Data Nodes
In a similar article, John Brinkman showed how to create form variable nodes at runtime however what’s not obvious about data nodes is that you don’t create them using
a class name of your choice.
For example, say you wanted to create the following data node structure:
<custom>
<message>Hello World!</message>
</custom>
Continue reading…
Posted by Stefan Cameron on June 1st, 2009
Filed under
CM,
Data Binding,
Instance Manager,
Scripting,
Tables,
Tutorials,
XFA
Did you know that you can specify the default data binding for new subforms in the “Tools menu > Options dialog > Data Binding panel”?
The default setting is “Normal” which means that all new subforms you insert from the Object Library with have their “Object palette > Binding tab > Default Binding property” set to “Normal” which means implicit binding using the subform’s name.
Setting this to “None” will result in all new subforms having a default binding of “None” which means they don’t participate in data binding by default. Since subforms are often needed purely for form layout, I find it’s safer to use this setting because I know inserting new subforms will not affect any bindings I have already setup in my form. (While it’s true that unnamed subforms don’t participate in data binding, I always name my subforms for clarity and scripting purposes so setting the binding to “None” ensures they don’t mess with data binding unless I want them to.)
Posted by Stefan Cameron on April 23rd, 2009
Filed under
Data Binding,
Designer,
Tips,
XFA
Connecting to a web service usually means using import bindings to capture the response but what if you wanted to do something special with the response? What if the response wasn’t exactly correct for merging into your form (e.g. you just wanted to extract a part of the response and push it into your form somewhere)?
You could still use import bindings (set using the “Object palette > Bindings tab > Import/Export Bindings property”) but then you might have to hide most — or all — of those fields if you didn’t want to expose them. You would wait for the web service data connection to execute, then find the field that contains the piece of data you want and set it where it needs to go. This isn’t ideal, however, because Designer doesn’t expose any events, in the Script Editor, that would let you know that you now have data from the web service response in your form. Furthermore, having those extra fields around could add a lot of unnecessary weight (read: file size).
Continue reading…
Posted by Stefan Cameron on March 23rd, 2009
Filed under
Data Binding,
Designer,
Events,
Scripting,
Tutorials,
XFA