none
People Editor in Custom Webpart stopeed working after CU

    Question

  • Hi,

    I have an issue with People Editor. i have an people editor control in my custom web part. Based on the user id entered in the text box, i use to populate in the People Editor. This was working fine.

    Recently we upgraded our MOSS Server from SP2 to SP3 and Dec 2011 CU.  People editor stopped population.
    My Code below:

    using System;
    using System.Runtime.InteropServices;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Serialization;
    using System.Collections;

    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Security;
    using Microsoft.SharePoint.WebControls;
    using Microsoft.SharePoint.WebPartPages;

    namespace TestPicker
    {
        [Guid("8c01ba24-e0d7-4388-b235-908f937efaa9")]
        public class CustomPicker : System.Web.UI.WebControls.WebParts.WebPart
        {
            TextBox txt;
            PeopleEditor pe;
            Label l1;
            public CustomPicker()
            {
            }

            protected override void CreateChildControls()
            {
                base.CreateChildControls();
                Button b1 = new Button();
                b1.Text = "Populate";
                b1.Click += new EventHandler(b1_Click);
                txt = new TextBox();
                pe = new PeopleEditor();
                pe.SelectionSet = "User";
                pe.AutoPostBack = false;          
                pe.Enabled = true;
                pe.Visible = true;
                pe.ValidatorEnabled = true;
                pe.MultiSelect = false;           
                pe.AllowEmpty = false;
                pe.PlaceButtonsUnderEntityEditor = true;
                this.Controls.Add(txt);
                this.Controls.Add(b1);
                this.Controls.Add(pe);
                l1 = new Label();
                this.Controls.Add(l1);           
            }       

            void b1_Click(object sender, EventArgs e)
            {
                try
                {
                    string value = txt.Text;
                    ArrayList _ArrayPeople = new ArrayList();
                    PickerEntity peEntity = new PickerEntity();
                    peEntity.Key = value;
                    peEntity = pe.ValidateEntity(peEntity);
                    _ArrayPeople.Add(peEntity);              
                    pe.UpdateEntities(_ArrayPeople);
                }
                catch (Exception ex)
                {
                    this.Page.Response.Write(ex.Message);
                }
            }
        }
    }
    Thursday, June 14, 2012 7:11 AM

Answers

All replies