Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    XML Aware Forms

    Here's a bit of weirdness I'm dealing with today.

    In my use case, I have a layout of fields that don't match the layout of the incoming XML document. As I begin to rearrange my default layout (one based on the structure of the XML SchemaSet, a SectionStack of DynamicForms and ListGrids, each bound to an XSElement of my document), I can't easily re-order my fields and intermix fields from different datasources.

    My solution is to include multiple forms with the same DataSource but with a different subset of fields. This feels a bit unnatural to me.

    With XForm compliant systems, each field has an XPath reference to the corresponding element in the document. In this system, the field name is combined with the datasource of the container to make reference to the element in the document. I'm considering what would be needed to extend DynamicForm to make it manage all the fields in my XML document, and not just fields in a single element.

    #2
    Have you found the operationBinding.useFlatFields property?

    useFlatFields is designed to handle the case where the XML structures involved have gratuitous nesting that doesn't match the user's mental model, aka, how a form should display the fields. Does this describe the issue you're running into?

    If not, maybe you could share some details of the domain model to help us understand why it makes sense from the user perspective to intermix fields from different objects in the same form.

    Comment


      #3
      Hmm.. and then xmlSerialize() unflattens the response back into the structure, yes?

      This sounds plausible other than the fact that I have duplicate fields used in different contexts (remember the Timeline object causing duplicate XSElements discussed in http://forums.smartclient.com/showthread.php?t=144?)

      My previous framework did this same thing, but generated field names to be the XPath names (escaping the '/' to something like "_Z_" and used "_C_" and "_T_" to escape the brackets in [x] collections). This insures duplicates will not be a problem and gives enough info to re-inflate the XML document.

      I'm not entirely clear where I would set this value. Is it a property of my root XSElement in my SchemaSet? I'm currently using XMLTools.loadXML() to fetch my document and DS.recordsFromXML() to convert it to JSON, then pass each object in the hierarchy to the corresponding DynamicForm, then to save I use DS.xmlSerialize() and send it back using RPC iManager.sendRequest() going out.

      It appears operationBinding requires the higher level DS operations. Now why didn't I go with this (rhetorical question)?

      Would this change my current RPC workflow?
      Last edited by tgochenour; 17 Feb 2007, 22:36.

      Comment

      Working...
      X