Working with ContentView designers (part 2): TextSetting control

Working with ContentView designers (part 2): TextSetting control

October 27, 2008 0 Comments

The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.

In the previous post about ContentView designers I’ve explained how to add new settings to the ModeSettings collection to give your end users more control over how will EventsView control look like. We’ve added four TextSetting controls and I didn’t go into detail what exactly the properties of these settings do, so let’s start with that.

TextSetting control explained

In the DetailsSettings and MasterSettings collections of PresentationModeSettings control you can enter any control which derives from BaseSettingControl (yes, that means you can create your own settings – but more on that in one of the future posts). The mostly used setting is called TextSetting and it allows you to create a setting that will allow end user to dynamically set:

  • Visibility
  • Label and
  • Format

of any control in the template. Let’s examine the one of the settings controls I’ve created in the previous post:

<sfDesignSettings:TextSetting ID="TextSetting9" 
                              TargetID="Street"   
                              SettingTitle="Street"   
                              AllowLabelSetting="True"   
                              AllowFormatSetting="True" 
                              FormatType="String" 
                              AllowVisibilitySetting="True" 
                              TargetVisibleByDefault="True">  
</sfDesignSettings:TextSetting> 
 

The properties of this control determine following:
  • ID – Not important, only has to be unique inside of the designer template
  • TargetID – ID of the control in a template which is controlled by this setting (in this case it is Literal with ID “Street”
  • SettingTitle – Title of the setting that end user will see when opens designer
  • AllowLabelSetting – Boolean determining whether end user will have the option to set the label for this control
  • AllowFormatSetting – Boolean determining whether end user will have the option to set formatting for this control
  • FormatType – Enumeration (DateTime|Number|String). If AllowFormatSetting is set to true, determines what kind of formatting should be allowed. DateTime will give end user drop down list with list of the date formats, Number will give end user drop down with a list of different number formats, while string will give end user textbox to enter string and “{0}” as a placeholder for the already existing text of the control (usually this is the value of the meta field)
  • AllowVisibilitySetting – Boolean determining whether end user will be able to set the visibility of the target control.
  • TargetVisibleByDefault – Boolean determining whether the control will be visible by default, without any interaction from the end user (NOTE: Setting AllowVisibilitySetting to false and TargetVisibleByDefault to true will result in an always visible control – generally used for mandated fields such as Title)

Take a look at the figure 1 to see how these properties reflect on the setting control in the designer:


Figure 1 : TextSetting control properties and their effects on the setting control in the designer

I hope I’ve made this clear enough. In the next post I’ll explain ContentSetting control and then we’ll move to the subject of creating custom settings. Leave a comment if you have any questions or suggestions.

progress-logo

The Progress Team

View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.

Comments
Comments are disabled in preview mode.
Topics
 
 
Latest Stories in
Your Inbox
Subscribe
More From Progress
New_Mobile_Dev_Ebook_Progress_Website_Thumbail
The New Mobile Development Landscape
Download Whitepaper
 
IDC Spotlight Sitefinity Thumbnail
Choosing the Right Digital Experience Platform to Improve Business Outcomes
Download Whitepaper
 
TheFastestWayToBuildMobileAppsArtboard-2
The Fastest Way to Build Mobile Apps With Cloud Data
Watch Webinar