YesNo Field

From Sense/Net Wiki
Jump to: navigation, search
  •  
  •  
  •  
  •  
  • 100%
  • 6.0
  • Enterprise
  • Community
  • Planned

Overview

YesNo Field is used for storing a boolean value: Yes or No.

Details

Field handler

  • handler: SenseNet.ContentRepository.Fields.YesNo
  • short name: YesNo

Usage in CTD:

   <Field name="YesNoField" type="YesNo">
   ...
   </Field>

Export/import

Currently the field value is exported as string ('yes' or 'no'). No other values (e.g. true/false, 1/0) are accepted.

Example/Tutorials

Fully featured example:

<Field name="MyYesNoField" type="YesNo">
   <DisplayName>My Yes/No Field</DisplayName>
   <Description>Boolean content</Description>
   <Configuration>
     <VisibleBrowse>Show</VisibleBrowse>
     <VisibleEdit>Show</VisibleEdit>
     <VisibleNew>Show</VisibleNew>
     <DefaultValue>Yes</DefaultValue>
     <ControlHint>sn:RadioButtonGroup</ControlHint>
   </Configuration>
</Field>

The above example configures the YesNo field so that:

  • it is visible in browse mode
  • it is visible in edit mode
  • it is visible when new field is added.

Related links

References