[CLOSED] Setting a ComboBox Value

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] Setting a ComboBox Value

    Hi all

    I've got a Ext:Windows with a TabPanel and some Panels.
    The first visible Panel attached to the TabPanel holds a Combobox.
    After selecting a Value from the ComboBox other Panels (let's call them Panel B & C) from the Windows will be attached to the TabPanel.

    So far, so good...

    After I close the Window an reopen it, Panel B & C are still attached and the ComboBox contains the last selection ! I use the show/hide mechanism for the Window - that's the reason why, I know :-)

    with this Code

    myWindow.ViewStateMode = UI.ViewStateMode.Enabled
    tabMain.HideTabStripItem(PanelB)
    tabMain.HideTabStripItem(PanelC)
    the Window Clean Up seems to be Ok but the ComboBox still holds the last Selection ?

    this Code seems to be not working

    myCombobox.SetValue(String.Empty)
    How can I rest the ComboBox w/o destroying the whole Window ?

    Kind Regards
    Peter
    Last edited by Daniil; May 31, 2011 at 10:49 AM. Reason: Marked as [CLOSED]. No more info was provided.
  2. #2
    Hi,

    ComboBox1.Reset()
    should work as you need.
  3. #3
    Doesn't work :-(

    The ComboBox Text still remains untouched !
  4. #4
    I can't reproduce.

    Here is my test case.

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Show(object sender, DirectEventArgs e)
        {
            this.Window1.Show();
            this.ComboBox1.Reset();
        }
    </script>
    
    <!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:Window ID="Window1" runat="server" Layout="FitLayout" Hidden="true">
            <Items>
                <ext:TabPanel runat="server">
                    <Items>
                        <ext:Panel runat="server" Title="Tab1">
                            <Items>
                                <ext:ComboBox ID="ComboBox1" runat="server">
                                    <Items>
                                        <ext:ListItem Value="1" Text="Item 1" />
                                        <ext:ListItem Value="2" Text="Item 2" />
                                    </Items>
                                </ext:ComboBox>
                            </Items>
                        </ext:Panel>
                    </Items>
                </ext:TabPanel>
            </Items>
        </ext:Window>
        <ext:Button runat="server" Text="Show" OnDirectClick="Show" />
        </form>
    </body>
    </html>
  5. #5
    can I fire the Reset also from Code Behind ? Via Direct Event ?
  6. #6
    Mm, there is DirectEvent in my example.
  7. #7
    Yes, sorry !
    Didn't see that...

    But anyway, it doesn't work :-(
    The last selection (the Text in the ComboBox) remains visible.
  8. #8
    Did you test my example? I can't see any text when open the Window again.

    Please provide your test case.
  9. #9
    It's a large Page, eMail ?
  10. #10
    I believe you don't need to sent us the whole page.

    Please simplify it as much as you can and post here. Here is the guide how to simplify.
    How to reduce a sample

    Or, maybe, you could prepare a test case basing on my sample.
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 10
    Last Post: May 16, 2014, 4:39 AM
  2. [CLOSED] Icons combobox dissapear when setting value clientside
    By CarWise in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 14, 2011, 9:19 AM
  3. [CLOSED] javascript error while setting combobox first value
    By ISI in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 26, 2011, 2:22 PM
  4. [CLOSED] Setting Combobox value in code behind
    By iansriley in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Dec 15, 2010, 7:35 PM
  5. [CLOSED] Issues setting ComboBox selected items
    By dlouwers in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Jan 14, 2009, 12:07 PM

Tags for this Thread

Posting Permissions