Implementing IWebBusiness


Author
Message
Govinda Berrio
Govinda Berrio
StrataFrame User (206 reputation)StrataFrame User (206 reputation)StrataFrame User (206 reputation)StrataFrame User (206 reputation)StrataFrame User (206 reputation)StrataFrame User (206 reputation)StrataFrame User (206 reputation)StrataFrame User (206 reputation)StrataFrame User (206 reputation)
Group: StrataFrame Users
Posts: 94, Visits: 481
Hi,



I'm trying to implement the interfaces to make a third party control (Telerik RadComboBox) bindable to SF business objects.



From what I've gleaned from other messages in this forum, I should look at the source code in the SF DropDownList and copy all the code from there into my subclassed control, correct?



Govinda
Replies
Olivier
Olivier
StrataFrame User (200 reputation)StrataFrame User (200 reputation)StrataFrame User (200 reputation)StrataFrame User (200 reputation)StrataFrame User (200 reputation)StrataFrame User (200 reputation)StrataFrame User (200 reputation)StrataFrame User (200 reputation)StrataFrame User (200 reputation)
Group: StrataFrame Users
Posts: 96, Visits: 805
Govinda Berrio (8/27/2008)
Ahhhh... I see now, just implement IWebBusinessBindable and you can set BusinessObjectName and BindingField properties in to bind a property (SelectedValue, Text, etc.) to a BO property. But I have to populate the dropdown with values some other way (I'm using WebBusinessBindingSource), unless I want to implement the IWebListControl.

Attached is the code showing that binding to a third party combobox is pretty much the same as setting up binding to a third party textbox.

Thanks for the help.


Hello

You have some code , to understand How you implement the method in telerik control ?

thanks
Olivier,

==============================================
Asp.net C# - Strataframe - telerik
==============================================
Govinda Berrio
Govinda Berrio
StrataFrame User (206 reputation)StrataFrame User (206 reputation)StrataFrame User (206 reputation)StrataFrame User (206 reputation)StrataFrame User (206 reputation)StrataFrame User (206 reputation)StrataFrame User (206 reputation)StrataFrame User (206 reputation)StrataFrame User (206 reputation)
Group: StrataFrame Users
Posts: 94, Visits: 481
Hi, here is how I subclassed the Telerik RadTextBox using the IWebBusinessBindable interface.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using MicroFour.StrataFrame.Business;
using MicroFour.StrataFrame.UI;
using MicroFour.StrataFrame.UI.Web;
using MicroFour.StrataFrame.Extensibility;

namespace GKG.WebControls.StrataFrameTelerikWrapper
{
    [ToolboxData("<{0}:sfRadTextBox runat=server></{0}:sfRadTextBox>")]
    public class sfRadTextBox : RadTextBox, IWebBusinessBindable
    {

#region " Privates "

        private string _BindingField = "";
        private string _BindingProperty = "Text";
        private string _BindingFormat = "";
        private string _BusinessObjectName = "";
        private BindingDirections _BindingDirection = BindingDirections.TwoWay;
        private string _ErrorMessage = "";
        private bool _InError = false;
        private bool _IgnoreManageUIReadOnlyState = false;

#endregion

#region " Public Properties "

        /// <summary>
        /// The field on the business object to which this control is bound
        /// </summary>
        /// <value></value>
        /// <remarks></remarks>
        [Category(BusinessMod.EDITOR_CATEGORY), 
        DefaultValue(""),
        Description(BusinessMod.EDITOR_BINDINGFIELD_DESC), 
        Editor(Constants.TE_WebBindingFieldTypeEditor, typeof(System.Drawing.Design.UITypeEditor))]
        public string BindingField
        {
            get { return _BindingField; }
            set { _BindingField = value; }
        }

        /// <summary>
        /// The property on the control that is bound to the data on the business object
        /// </summary>
        /// <value></value>
        /// <remarks></remarks>
        [Category(BusinessMod.EDITOR_CATEGORY), 
        DefaultValue("Text"),
        Description(BusinessMod.EDITOR_BINDINGPROPERTY_DESC),
        Editor(Constants.TE_BindingPropertyEditor, typeof(System.Drawing.Design.UITypeEditor))]
        public string BindingProperty
        {
            get { return _BindingProperty; }
            set { _BindingProperty = value; }
        }

        /// <summary>
        /// The format to display the data when the data is bound to the control.
        /// </summary>
        /// <value></value>
        /// <remarks></remarks>
        [Description(BusinessMod.EDITOR_WEBBINDINGFORMAT_DESC),
        Category(BusinessMod.EDITOR_CATEGORY), 
        DefaultValue("")]
        public string BindingFormat
        {
            get { return _BindingFormat; }
            set { _BindingFormat = value; }
        }

        /// <summary>
        /// The name of the business object on the page to which this control is bound
        /// </summary>
        /// <value></value>
        /// <remarks></remarks>
        [Category(BusinessMod.EDITOR_CATEGORY), 
        DefaultValue(""),
        Description(BusinessMod.EDITOR_BUSINESSOBJECT_DESC),
        Editor(Constants.TE_BusinessObjectNameTypeEditor, typeof(System.Drawing.Design.UITypeEditor))]
        public string BusinessObjectName
        {
            get { return _BusinessObjectName; }
            set { _BusinessObjectName = value; }
        }

        /// <summary>
        /// Determines whether or not the control's state is automatically managed by the business object
        /// to which it is bound
        /// </summary>
        /// <value></value>
        /// <remarks></remarks>
        [Description(BusinessMod.EDITOR_IGNOREMANAGE_DESC),
        Category(BusinessMod.EDITOR_CATEGORY), 
        DefaultValue(false)]
        public bool IgnoreManageUIReadOnlyState
        {
            get { return _IgnoreManageUIReadOnlyState; }
            set { _IgnoreManageUIReadOnlyState = value; }
        }

        /// <summary>
        /// Specified whether the data is bound from the control to the data, vice versa, or both.
        /// </summary>
        /// <value></value>
        /// <remarks></remarks>
        [Category(BusinessMod.EDITOR_CATEGORY),
        Description(BusinessMod.EDITOR_WEBBINDINGDIRECTION_DESC)]
        public BindingDirections BindingDirection
        {
            get { return _BindingDirection; }
            set { _BindingDirection = value; }
        }
        #endregion
        #region " Non-Browsable Properties "

        /// <summary>
        /// Determines if the control is editable by the user (wraps Control.Enabled)
        /// </summary>
        /// <value></value>
        /// <remarks></remarks>
        [Browsable(false), 
        DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public bool BindingEditable
        {
            get { return this.Enabled; }
            set { this.Enabled = value; }
        }

        /// <summary>
        /// The error message that is displayed when the control is in error
        /// </summary>
        /// <value></value>
        /// <remarks></remarks>
        [Browsable(false), 
        DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public string ErrorMessage
        {
            get { return _ErrorMessage; }
            set { _ErrorMessage = value; }
        }

        /// <summary>
        /// Determines if the control is in error and the error provider should be displayed
        /// </summary>
        /// <value></value>
        /// <remarks></remarks>
        [Browsable(false), 
        DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public bool InError
        {
            get { return _InError; }
            set { _InError = value; }
        }

        /// <summary>
        /// Determines whether or not the control has bindings that are in addition to the primary data binding
        /// </summary>
        /// <value></value>
        /// <remarks></remarks>
        [Browsable(false)]
        public bool HasAdditionalBindings
        {
            get { return false; }
        }
#endregion

    }
}

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Govinda Berrio - 16 Years Ago
Govinda Berrio - 16 Years Ago
Govinda Berrio - 16 Years Ago
Dustin Taylor - 16 Years Ago
             Thanks Dustin, I'll try that now.
Govinda Berrio - 16 Years Ago
Govinda Berrio - 16 Years Ago
Olivier - 12 Years Ago
                         Hi, here is how I subclassed the Telerik RadTextBox using the...
Govinda Berrio - 12 Years Ago
Dustin Taylor - 16 Years Ago
Olivier - 12 Years Ago
Michel Levy - 12 Years Ago
Olivier - 12 Years Ago
Michel Levy - 12 Years Ago
Olivier - 12 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search