SPListItem in FormsLib does not handle blank values

我们两清 提交于 2019-12-24 19:15:02

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!