missing attributes not editable in infopath - InfoPath Dev
in

InfoPath Dev

missing attributes not editable in infopath

Last post 01-10-2007 01:15 AM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 01-09-2007 03:26 PM

    missing attributes not editable in infopath

    Hi all,

    I'm seeing an interesting behavior in InfoPath that I want to get around. I used my own schema to build the template on. I have some xml data already around that I will need to convert to valid InfoPath data. The XML I need to convert follows the schema. I intend to just add the PI's at the top of each file.

    I have noticed that InfoPath likes ALL attributes to exist in its data. It doesn't seem to matter if it's optional or not required. InfoPath includes all attributes (some empty if appropriate) unlike some of my raw data. The producers of my raw data typically only added an attribute if the attribute was to have a value. So their data omits a lot of attributes mentioned in the schema. (they are optional, after all)

    I find that if I try to open one of these "converted" forms (PI's added), if any attributes were missing, they can't be edited in InfoPath. For repeating data, such as a table, you can't select the missing field, although it appears blank. If you add a new row, you can edit the field in the new row -- it's just in the old row that lacked the attribute that you can't change it. For non-repeating data, (I've seen a checkbox like this) it is grayed out, and you can't change it.

    I tried to reproduce this with an editable schema (built using InfoPath). I created a form, saved a data that uses the form, and then added some attributes. It didn't have the problem. It added the attributes for me. It seems like it's only when you use your own schema that the problem occurs.

    Has anybody seen this behavior, and what have you done to get around it? I've considered preprocessing the data to add missing fields (as part of the conversion to Infopath) and I'm considering writing an OnVersionUpgrade event too (I did get that to work, but it's not pretty).

    If I can't get InfoPath to do it for me, my next favorite idea would be to write an OnVersionUpgrade that somehow compared the doc to the schema and added all attributes that the doc lacked. This is well beyond my present experience, so I thought I'd ask here before I try that to make sure I haven't missed something.

    thanks
    Joe
  • 01-10-2007 01:15 AM In reply to

    Re: missing attributes not editable in infopath

    Another option would be to write an xsl and use ImportFiles element in the manifest to add this data via Merge Forms option from the file menu (or via a command line switch to call the /aggregate logic). That's a little nonunintuitive but we use it to send parameters to a form on load.

    This problem is most common with the xsd:nil attribute which is required for dates if the value is nil.
    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.