To fully conquer this trouble, I enacted the following:
- Updated the SharePoint:SPDataSource as noted in Siraj's answer
- Included ALL required fields in the custom newform.aspx
This second item may not cause as much consternation, but for some forms, I didn't want to populate the "title" field with user input, but rather later with system calculated or concatenated data. For initial releases of SharePoint 2010 up through Service Pack 1, this worked fine to omit "title" from my custom forms. Going forward, this is sadly no longer the case. If you find yourself in similar state of woe, the following will work!
- Set a default text value for the affected field in the affected List Settings (This MUST be done via the web GUI, as no one seemingly thought it important enough to include in the Designer column edit tools)
- Add the field to the custom newform.aspx
- Embed the field within a <div> tag using the following CSS styling to hide it (The exact ID is not important and could be virtually anything, but if left to the system generated Id, it will be something like "ff[Number]{$Pos}"):
- <div style="display:none">
- <SharePoint:FormField runat="server" id="ff6{$Pos}" controlmode="New" fieldname="Title" __designer:bind="{ddwrt:DataBind('i',concat('ff6',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Title')}" />
- </div>
- I tested adding the field as an "ASP:TextBox" to enact code-enforced default text rather than setting the default in the List Settings web GUI, but didn't seem to satisfy the mean warnings
That should do it!
No comments:
Post a Comment