Sitefinity Forms: Multiple choice with large amounts of text

Posted by Community Admin on 04-Aug-2018 22:22

Sitefinity Forms: Multiple choice with large amounts of text

All Replies

Posted by Community Admin on 20-Jan-2012 00:00

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)


It seems like the amount of text that is entered when using the multiple choice widget should be limited, or at least add a message stating a maximum number of characters for creators to use.

Posted by Community Admin on 24-Jan-2012 00:00

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.

Regards,
Stanislav Velikov
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 09-Oct-2017 00:00

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?

This thread is closed