问题
I have a FormsLib with a couple of xml files in there. When I pull up either InfoPath or the standard EditForm and clear out a value on the SPListItem (sync with the xml file) the old value comes back. If I add a space it works. I have tried it via the OM also and the result is the same.
So, for example, if I have a field with the value "Johan" and I pull up the form and clear out that value it still says "Johan" after the update.
Anyone else had any experience with this?
回答1:
Yes. I have encountered this and the work around I came up with was to add a single space instead of clearing out the field entirely. In my experience though, it only happened if I made the changes in the EditForm. When done in InfoPath, it seemed to work.
Of course, after using " " as my empty value, I had to trim it whenever I needed to check if the field was indeed blank.
回答2:
I have found an alterntive solution to this issue and I have blogged about it: http://johanleino.wordpress.com/2009/08/24/node-demotion-does-not-work-with-blank-empty-values/
来源:https://stackoverflow.com/questions/950272/splistitem-in-formslib-does-not-handle-blank-values