[CLOSED] When a window is Hidden and I click a button to show it, its renders incorrectly...

  1. #1

    [CLOSED] When a window is Hidden and I click a button to show it, its renders incorrectly...

    If I show the window without the Hidden Property, it looks fine, but when the window is hidden and I click the button to show the Window, by textboxes & button is missing. Screen Shot below shows what is happening...

    Click image for larger version. 

Name:	Renders incorrect when Hidden.JPG 
Views:	82 
Size:	16.0 KB 
ID:	4492

    <%@ 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 id="Head1" runat="server">
        <title>Simple Form Panel - Ext.NET Examples</title>
    </head>
    <body>
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <br />
        <ext:Button ID="Button1" ArrowAlign="Right" Text="Show Window" OnClientClick="#{WindowDetails}.show();"
            runat="server" />
        <ext:Window ID="WindowDetails" runat="server" Title="Details" Icon="Comment" Height="200"
            Width="400" BodyStyle="background-color: #fff;" BodyPadding="5" Modal="true"
            Hidden="true">
            <Content>
                <ext:FormPanel ID="FormPanel1" runat="server" BodyPadding="0" Border="false" Layout="FormLayout">
                    <Items>
                        <ext:FieldContainer ID="FieldContainer1" runat="server" FieldLabel="Type" Layout="HBoxLayout">
                            <Items>
                                <ext:ComboBox ID="Type" runat="server" EmptyText="Select a Type" Width="140" AllowBlank="false">
                                    <Store>
                                        <ext:Store ID="TypeStore" runat="server">
                                            <Model>
                                                <ext:Model runat="server">
                                                    <Fields>
                                                        <ext:ModelField Name="TypeId" Type="Int" />
                                                        <ext:ModelField Name="Description" Type="String" />
                                                    </Fields>
                                                </ext:Model>
                                            </Model>
                                        </ext:Store>
                                    </Store>
                                </ext:ComboBox>
                            </Items>
                        </ext:FieldContainer>
                        <ext:FieldContainer ID="FieldContainer2" runat="server" FieldLabel="Comments" Layout="HBoxLayout">
                            <Items>
                                <ext:TextArea ID="Comments" runat="server" Width="265" EmptyText="Please enter comments" />
                            </Items>
                        </ext:FieldContainer>
                    </Items>
                    <Buttons>
                        <ext:Button ID="BtnUpdateDetails" ArrowAlign="Right" Icon="Accept" Text="Update"
                            runat="server" />
                    </Buttons>
                </ext:FormPanel>
            </Content>
        </ext:Window>
    </body>
    </html>
    Last edited by Daniil; Jul 17, 2012 at 7:20 PM. Reason: [CLOSED]
  2. #2
    Please change your <Content> tag to an <Items> tag.

    As well, you shouldn't need to place Form Fields inside an <ext:FieldContainer>. That creates an overly nested layout, which should be avoided.
    Geoffrey McGill
    Founder
  3. #3
    Great that works...

    And thanks for the advise on Over Nesting... I remove ALL <ext:FieldContainer>.

    <%@ 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 id="Head1" runat="server">
        <title>Simple Form Panel - Ext.NET Examples</title>
    </head>
    <body>
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
        <br />
        <ext:Button ID="Button1" ArrowAlign="Right" Text="Show Window" OnClientClick="#{WindowDetails}.show();"
            runat="server" />
        <ext:Window ID="WindowDetails" runat="server" Title="Details" Icon="Comment" Height="200"
            Width="400" BodyStyle="background-color: #fff;" BodyPadding="5" Modal="true"
            Hidden="true">
            <Content>
                <ext:FormPanel ID="FormPanel1" runat="server" BodyPadding="0" Border="false" Layout="AnchorLayout">
                    <Content> 
                        <ext:ComboBox ID="Type" runat="server" EmptyText="Select a Type" Width="250" AllowBlank="false" FieldLabel="Type">
                            <Store>
                                <ext:Store ID="TypeStore" runat="server">
                                    <Model>
                                        <ext:Model runat="server">
                                            <Fields>
                                                <ext:ModelField Name="TypeId" Type="Int" />
                                                <ext:ModelField Name="Description" Type="String" />
                                            </Fields>
                                        </ext:Model>
                                    </Model>
                                </ext:Store>
                            </Store>
                        </ext:ComboBox>
                        <ext:TextArea ID="Comments" runat="server" Width="350" FieldLabel="Comments" EmptyText="Please enter comments" />
                    </Content>
                    <Buttons>
                        <ext:Button ID="BtnUpdateDetails" ArrowAlign="Right" Icon="Accept" Text="Update"
                            runat="server" />
                    </Buttons>
                </ext:FormPanel>
            </Content>
        </ext:Window>
    </body>
    </html>

    Quote Originally Posted by geoffrey.mcgill View Post
    Please change your <Content> tag to an <Items> tag.

    As well, you shouldn't need to place Form Fields inside an <ext:FieldContainer>. That creates an overly nested layout, which should be avoided.
  4. #4
    I believe you missed the following comment...

    Please change your <Content> tag to an <Items> tag.
    You should not use the <Content> tag, unless you have non-Ext.NET Controls (or raw text/html) to add into the Container.
    Geoffrey McGill
    Founder
  5. #5
    Got it, thanks.

    Quote Originally Posted by geoffrey.mcgill View Post
    I believe you missed the following comment...



    You should not use the <Content> tag, unless you have non-Ext.NET Controls (or raw text/html) to add into the Container.

Similar Threads

  1. Replies: 11
    Last Post: Aug 08, 2012, 2:02 PM
  2. ext button click asp:gridiew footer row will be show
    By landerajshree in forum 1.x Help
    Replies: 5
    Last Post: Jul 03, 2012, 9:45 AM
  3. Replies: 3
    Last Post: Mar 19, 2012, 12:35 PM
  4. Replies: 4
    Last Post: Sep 17, 2010, 10:33 PM
  5. Replies: 2
    Last Post: May 05, 2010, 3:06 PM

Posting Permissions