Sitefinity Forms: Multiple choice with large amounts of text
We ran into a problem today using the multiple choice form widgets. Our client was creating a multiple choice survey with a large amount of text associated with each radio button. As an example, one of the options was:
Youth engagement: In 2011 we heard a lot of bad news about political disengagement among Canadian youth. But your nominations remind us that there is much to celebrate about the role of young Canadians in our democracy. Over the last year, we saw “vote mobs” sweep university campuses across the country during the May federal election, nearly 1,000,000 young Canadians cast a ballot in mock provincial elections organized by Student Vote, and the election of Canada’s youngest-ever Member of Parliament, 19-year-old Pierre-Luc Dusseault
The create went fine, but when visitors started using the form an error was thrown:
Exception information:
Exception type: DataStoreException
Exception message: Insert of '1568898673-d232953f-9467-481a-b240-3443c170d28b' failed: Telerik.OpenAccess.RT.sql.SQLException: String or binary data would be truncated.
The statement has been terminated.
at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.execute()
at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.execute()
at OpenAccessRuntime.Relational.RelationalStorageManager.generateInserts(NewObjectOID oid, Int32 index, ClassMetaData cmd, PersistGraph graph, Int32[] fieldNos, CharBuf s, Object[] oidData, IntArray toUpdateIndexes)
INSERT INTO [sf_bestdemocraticmomentvote] ([id], [form_multiple_choice__c005]) VALUES (?, ?)
(set event logging to all to see parameter values) Telerik.OpenAccess.RT.sql.SQLException: String or binary data would be truncated.
The statement has been terminated.
at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.execute()
at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.execute()
at OpenAccessRuntime.Relational.RelationalStorageManager.generateInserts(NewObjectOID oid, Int32 index, ClassMetaData cmd, PersistGraph graph, Int32[] fieldNos, CharBuf s, Object[] oidData, IntArray toUpdateIndexes)
at Telerik.Sitefinity.Data.TransactionManager.CommitTransaction(String transactionName)
at Telerik.Sitefinity.Modules.Forms.FormsManager.SaveChanges(Boolean updateSchema)
at Telerik.Sitefinity.Modules.Forms.Web.UI.FormsControl.SaveFormEntry(FormDescription description)
at Telerik.Sitefinity.Modules.Forms.Web.UI.FormsControl.ProcessForm(FormDescription form)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
String or binary data would be truncated.
The statement has been terminated.
at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.execute()
at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.execute()
at OpenAccessRuntime.Relational.RelationalStorageManager.generateInserts(NewObjectOID oid, Int32 index, ClassMetaData cmd, PersistGraph graph, Int32[] fieldNos, CharBuf s, Object[] oidData, IntArray toUpdateIndexes)
Hello,
Yes the problem is there are too many characters each choice field supports up to 255 characters. I have logged this as a feature request. Here is the PITS item.
Is there a workaround for this problem? I am using MVC forms and I would like avoid building a custom form. I expected that increasing the string length beyond 255 via AdvancedSettings>Metadata>DatabaseMappings>MultipleChoice>Database Max Length to address the problem, but it didn't do anything. How do you go about increasing this string length beyond the 255 character limit for the multiple choice widget used on MVC forms?