[CLOSED] [1.0] ComboBox automatically clears value?

  1. #1

    [CLOSED] [1.0] ComboBox automatically clears value?

    Hi,

    I have a combo box to be used as a search input field. When I type in something on it and tick the checkbox control below it, the typed in value is erased. How can I prevent this from happening?

    <ext:Panel ID="Panel2" runat="server" Border="false" Title="Search Catalog" Height="100"  Width="450" Frame="true" LabelAlign="Right" Icon="Magnifier" CtCls="titleNormal" AutoScroll="true" BodyStyle="padding-left: 15px; padding-top: 5px;" Collapsible="false">
                <Items>
                    <ext:ComboBox ID="TreatmentFilter" runat="server" EnableKeyEvents="true" HideTrigger="true" Width="400" EmptyText="Catalog Keyword Search" EnableViewState="true" CausesValidation="false" >
                        <Triggers>
                            <ext:FieldTrigger Icon="Search" HideTrigger="true" />
                            <ext:FieldTrigger Icon="Clear" HideTrigger="true" />
                        </Triggers>
                        <Listeners>
                            <BeforeQuery Handler="this.triggers[0][ this.getRawValue().toString().length == 0 ? 'hide' : 'show']();this.triggers[1][ this.getRawValue().toString().length == 0 ? 'hide' : 'show']();" />
                            <TriggerClick Handler="if (index == 0) {} else if (index == 1) { this.clearValue();  this.triggers[0].hide(); } " />
                        </Listeners>
                    </ext:ComboBox>
                    <ext:Checkbox ID="chkbxTreatmentAllWords" runat="server" HideLabel="true" Name="" BoxLabel="Search for All Words" LabelSeparator=""></ext:Checkbox>
                </Items>
            </ext:Panel>
    Regards,
    Marcelo
    Last edited by Daniil; Sep 27, 2010 at 6:37 PM. Reason: [CLOSED]
  2. #2
    Hi Marcelo,

    Please set the ComboBox's ForceSelection property to false.

    Example
    <%@ Page Language="C#" %>
    
    <%@ 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">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:ComboBox runat="server" ForceSelection="false">
            <Items>
                <ext:ListItem Text="Text 1" Value="Value1" />
                <ext:ListItem Text="Text 2" Value="Value2" />
                <ext:ListItem Text="Text 3" Value="Value3" />
            </Items>        
        </ext:ComboBox>
        <ext:Checkbox runat="server" />
        </form>
    </body>
    </html>

    See also


    http://dev.sencha.com/deploy/dev/doc...forceSelection
  3. #3
    Thanks Daniil, it worked!!

    Please mark as solved.

    Regards,
    Marcelo

Similar Threads

  1. [CLOSED] How combobox automatically loads new value added in the form?
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Mar 19, 2012, 7:46 PM
  2. Expand combobox list automatically.
    By rahesh in forum 1.x Help
    Replies: 0
    Last Post: Nov 11, 2011, 11:12 AM
  3. [CLOSED] ext:NumberField clears to blank on blur (when 0 is entered)
    By jthompson in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Nov 09, 2011, 10:44 PM
  4. Replies: 2
    Last Post: Jun 11, 2010, 8:17 PM
  5. Replies: 2
    Last Post: Feb 05, 2010, 5:46 PM

Posting Permissions