Combo items not showing in FormLayout

  1. #1

    Combo items not showing in FormLayout

    I'm saw an example here and was attempting to pull off the same thing. My form is practically identical to the example except for the FieldSet, but for some reason the Items for my Combo doesn't show.

    I copied the same Store and Combobox to another page and items were shown there. After that I used FireBug to check if my Store had data on the page giving the problem and it did. So someone please point out to me where I went wrong with this.

    Here's my code. Please bear in mind that this code is from a user control that is on a page with a grid. As i said, Its pretty much identical to the example.

    <ext:Store ID="storeAccessLevels" runat="server"
        AutoLoad="true">
        <Reader>
            <ext:JsonReader ReaderID="AccessLevelId">
                <Fields>
                    <ext:RecordField Name="AccessLevelId" />
                    <ext:RecordField Name="LevelName" />
                </Fields>
            </ext:JsonReader>
        </Reader>
    </ext:Store>
    
    <ext:Window ID="userDetailsWindow" runat="server" Icon="User" Title="<%$ Resources:Text, UserDetails %>"
        Width="400" Height="410" AutoShow="false" Modal="true" Show&#111;nload="false">
        <Body>
            <ext:FitLayout ID="FitLayout1" runat="server">
                <ext:TabPanel ID="TabPanel1" runat="server" ActiveTabIndex="0" Border="false" DeferredRender="false">
                    <Tabs>
                        <ext:Tab runat="server" ID="tabGeneralInfo" Title="<%$ Resources:Text, GeneralInfo %>" Icon="Vcard"
                            BodyStyle="padding:5px;">
                            <Body>
                                <ext:FieldSet runat="server" CheckboxToggle="false" Title="<%$ Resources:Text, UserInfo %>" AutoHeight="true">
                                    <Body>
                                        <ext:FormLayout runat="server">
                                            <ext:Anchor>
                                                <ext:TextField ID="txtUserName" runat="server" FieldLabel="<%$ Resources:Text, Username %>" Width="250"
                                                    Disabled="true" />
                                            </ext:Anchor>
                                            <ext:Anchor>
                                                <ext:ComboBox ID="cbxAccessLevels" runat="server" StoreID="storeAccessLevels" FieldLabel="<%$ Resources:Text, AccessLevel %>"
                                                    AllowBlank="true"
                                                    EmptyText="<%$ Resources:Text, All %>" 
                                                    Select&#111;nfocus="true" 
                                                    DisplayField="LevelName"
                                                    ValueField="AccessLevelId"
                                                    TypeAhead="true" 
                                                    Mode="Local"
                                                    TriggerAction="All"
                                                    ForceSelection="true" />
                                            </ext:Anchor>
                                            <ext:Anchor>
                                                <ext:TextField ID="txtExtension" runat="server" FieldLabel="<%$ Resources:Text, Extension %>" Width="250" />
                                            </ext:Anchor>
                                            <ext:Anchor>
                                                <ext:Checkbox ID="chkEnabled" runat="server" FieldLabel="<%$ Resources:Text, Enabled %>" Checked="false" />
                                            </ext:Anchor>
                                            <ext:Anchor>
                                                <ext:Checkbox ID="chkLockedOut" runat="server" FieldLabel="<%$ Resources:Text, LockedOut %>" Checked="false" />
                                            </ext:Anchor>
                                        </ext:FormLayout>
                                    </Body>
                                </ext:FieldSet>
                                <ext:FieldSet runat="server" CheckboxToggle="false" Title="<%$ Resources:Text, PersonalInfo %>" AutoHeight="true">
                                    <Body>
                                        <ext:FormLayout runat="server">
                                            <ext:Anchor>
                                                <ext:TextField ID="txtFirstName" runat="server" FieldLabel="<%$ Resources:Text, FirstName %>" Width="250" />
                                            </ext:Anchor>
                                            <ext:Anchor>
                                                <ext:TextField ID="txtLastName" runat="server" FieldLabel="<%$ Resources:Text, LastName %>" Width="250" />
                                            </ext:Anchor>
                                            <ext:Anchor Horizontal="100%">
                                                <ext:TextField ID="txtEmailAddress" runat="server" FieldLabel="<%$ Resources:Text, EmailAddress %>" Vtype="email" />
                                            </ext:Anchor>
                                            <ext:Anchor>
                                                <ext:DateField ID="dfCreatedDate" runat="server" FieldLabel="<%$ Resources:Text, DateAdded %>" Width="250"
                                                    Disabled="true" />
                                            </ext:Anchor>
                                        </ext:FormLayout>
                                    </Body>
                                </ext:FieldSet>
                            </Body>
                        </ext:Tab>
                        <ext:Tab ID="tabLoginInfo" runat="server" Title="<%$ Resources:Text, GeneralInfo %>" Icon="DoorIn" BodyStyle="padding:5px;">
                            <Body>
                                
                            </Body>
                        </ext:Tab>
                    </Tabs>
                </ext:TabPanel>
            </ext:FitLayout>
        </Body>
        <Buttons>
            <ext:Button ID="btnSave" runat="server" Text="<%$ Resources:Text, Save %>" Icon="Disk">
                <AjaxEvents>
                    <Click OnEvent="SaveUser" Failure="Ext.MessageBox.alert('Saving failed', 'Error during ajax event');">
                        <EventMask ShowMask="true" Target="CustomTarget" CustomTarget="={#{userDetailsWindow}.body}" />
                    </Click>
                </AjaxEvents>
            </ext:Button>
            <ext:Button ID="btnCancel" runat="server" Text="<%$ Resources:Text, Close %>" Icon="Cancel">
                <Listeners>
                    <Click Handler="#{userDetailsWindow}.hide(null);" />
                </Listeners>
            </ext:Button>
        </Buttons>
    </ext:Window>
            protected void Page_Load(object sender, EventArgs e)
            {
                if (!Ext.IsAjaxRequest)
                {
                    BindAccessLevels();
                }
            }
    
            #region Data Methods
            /// <summary>
            /// Bind the data required for the combobox.
            /// </summary>
            private void BindAccessLevels()
            {
                AccessLevelModelCollection collection;
    
                collection = AccessLevelsDataClient.RetrieveAccessLevelsForCombo();
    
                if (collection != null)
                {
                    storeAccessLevels.DataSource = collection;
                    storeAccessLevels.DataBind();
                }
            }
            #endregion
  2. #2

    RE: Combo items not showing in FormLayout

    Hi myron,

    Try adding adding an <ext:ContainerLayout> or <ext:FitLayout> between the <Body> and <ext:FieldSet> controls.

    Example

    <Body>
        <-- add <ext:ContainerLayout> or <ext:FitLayout> around the following Fieldset
            <ext:FieldSet
    Geoffrey McGill
    Founder
  3. #3

    RE: Combo items not showing in FormLayout

    Okay, I'm going to do that right now but I just realised that when i set the ShowOnLoad property of my Window to "true", my ComboItems show properly when the page is loaded and the window is shown.

    But after I close it............. nothing at all.

    No matter how many times I ReBind the store on PostBack/AjaxEvents.
  4. #4

    RE: Combo items not showing in FormLayout

    Well, I did as you suggested and my page just didn't load. Some javascript error about a missing semicolon that I couldnt track down.

    I even removed the Fieldsets and I had the same problem.

    I guess its safe to say it wont work for me. If you can give me another solution then great.. but for now I'm just going to look into creating my window on the fly and populate the fields.


Similar Threads

  1. combo - setValue - showing value not display
    By Tbaseflug in forum 1.x Help
    Replies: 2
    Last Post: Dec 21, 2011, 12:32 AM
  2. Linked combo boxes not showing data
    By reezvi in forum 1.x Help
    Replies: 2
    Last Post: Aug 03, 2011, 7:33 AM
  3. [CLOSED] Checkbox not showing up with FormLayout in IE7
    By bryantharpe in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 07, 2010, 2:15 PM
  4. Replies: 2
    Last Post: Feb 05, 2010, 10:11 AM
  5. [CLOSED] Multiselect Items not showing up...
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Nov 30, 2009, 8:17 AM

Posting Permissions