Sharepoint 2007: create a multi-line text property for a custom field type?

I am trying to expand the type of inline select box to include another piece of data: the correct answer. Thanks to this, users will be able to create their own tests directly in Sharepoint instead of using InfoPath or some other confusing solution. I was hoping to simply inherit the existing SPFieldChoice type and add another custom property to store an integer representing the correct answer from the options introduced.

I have a FieldTestQuestion class that inherits from SPFieldChoice along with a fairly simple TestQuestionFieldControl class inherited from RadioButtonChoiceField. My fldtypes_TestQuestionField.xml file:

  <FieldTypes>
    <FieldType>
        <Field Name="TypeName">TestQuestion</Field>
        <Field Name="ParentType">Choice</Field>
        <Field Name="TypeDisplayName">Test Question (Multiple choice)</Field>
        <Field Name="TypeShortDescription">Test Question (Multiple choice)</Field>
        <Field Name="UserCreatable">TRUE</Field>
        <Field Name="ShowInColumnTemplateCreate">TRUE</Field>
        <Field Name="FieldTypeClass">MyCustomFieldTypes.FieldTestQuestion,MyCustomFieldTypes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=****</Field>
        <PropertySchema>
            <Fields>
                <Field Name="CorrectAnswer" DisplayName="Correct answer (line number)" Type="Integer">
                    <Default></Default>
                </Field>
            </Fields>
        </PropertySchema>
    </FieldType>
  </FieldTypes>

, , , : My custom property
(: mudman.us)

, Choice: Custom multi-line text property on the built-in Choice field type
(: mudman.us)

fldTypes_.xml, Sharepoint () "" , () ?

+3
1

, SPFieldChoice; . , SharePoint .

b) . , <fields> :

<Field Name="ChoiceFix" DisplayName="Type each choice on a separate line:" Type="Note" />

, , , , .

+2

Source: https://habr.com/ru/post/1793966/


All Articles