[CLOSED] Trailing spaces in Ext.Net.ListItems for Combos causes unexpected behaviour...?

  1. #1

    [CLOSED] Trailing spaces in Ext.Net.ListItems for Combos causes unexpected behaviour...?

    Run this, you'll see that because there are trailing spaces in the names and values of the list items used in the multicombo it stops working and does not let you check any of the items!

    
    
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ext_forum_mCombo.aspx.cs" Inherits="OSyS.Kms._Ext._temp_.ext_forum_mCombo" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    
    <head runat="server">
        <script runat="server">
    
            protected void Page_Load(object sender, EventArgs e)
            {
                this.multiComboCause.SelectedItems.Clear();
    
                this.multiComboCause.Items.Add(new Ext.Net.ListItem("test1 ", "test1 123 123 "));
                this.multiComboCause.Items.Add(new Ext.Net.ListItem("test2 ", "test2 123 123 "));
                this.multiComboCause.Items.Add(new Ext.Net.ListItem("test3 ", "test3 123 123 "));
    
                this.multiComboCause.UpdateSelection();
            }
    
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
        <ext:ResourceManager ID="extResourceManager" runat="server" />
        <ext:Panel ID="Panel2" runat="server" Layout="fit">
            <Items>
                <ext:MultiCombo ID="multiComboCause" runat="server" Width="260" SelectionMode="All" AnchorHorizontal="100%" FieldLabel="Cause">
                </ext:MultiCombo>
            </Items>
        </ext:Panel>
        </form>
    </body>
    </html>
    Last edited by Daniil; Mar 15, 2011 at 7:46 AM. Reason: [CLOSED]
  2. #2
    Hi,

    MultiCombo normalize and trim values therefore do not use trailing and leading spaces in the values
  3. #3
    If multicombo normalises and trims the values then why doesn't it work when you gives it a value with a trailing space?

    If what you say is true it should still work but contain values without spaces at the end!
  4. #4
    Hi,

    The widget normalizes values of checked records and save those values inside own collection. But it doesn't modify the values inside the store. Therefore it cannot find the records in the store.
    I recommend trim the values manually before using it as multicombo data

Similar Threads

  1. [CLOSED] Can't add ListItems to ComboBox in codebehind [1.0]
    By SFritsche in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jul 18, 2012, 5:05 PM
  2. [CLOSED] ListItems / ComboBox - value is always a String?
    By wagger in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 31, 2011, 3:46 PM
  3. [CLOSED] adding listitems dynamically in a combobox
    By LeeTheGreek in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Dec 22, 2009, 4:26 PM
  4. Replies: 7
    Last Post: Jul 20, 2009, 2:14 PM
  5. RecordField with spaces in name
    By Tbaseflug in forum 1.x Help
    Replies: 1
    Last Post: Jul 20, 2009, 6:53 AM

Posting Permissions