[1.0] ext:FitLayout control still present in preview or broken

  1. #1

    [1.0] ext:FitLayout control still present in preview or broken

    Samples in examples.ext.net suggest ext:FitLayout is obsolete and use parameter Layout="Fit" instead. Do we still need <ext:FitLayout/> in 1.0?

    Old code that hasn't been converted to 1.0 used it in the old way crashes the page on the client-side initialization.

    example:
    
    
    
    <ext:FitLayout ID="AdF" runat="server">
    
    
    <Items>
    
    
    <ext:Panel ID="test" runat="server" Title="title" Html="Test" >
    
    
    </ext:Panel>
    
    
    </Items>
    
    
    </ext:FitLayout>
  2. #2

    RE: [1.0] ext:FitLayout control still present in preview or broken

    Hi,

    FitLayout is not obsolete. It can be use and will be supported
    Please note that it must be placed inside container (like Panel)


    Old code that hasn't been converted to 1.0 used it in the old way crashes the page on the client-side initialization.
    Please post that code
  3. #3

    RE: [1.0] ext:FitLayout control still present in preview or broken

    I have confirmed you are correct that the code was missing a parent container. Because I built this code snippet as a sample to show the problem, I guess I produced a different problem.

    But it's a problem I keep running into as I convert more pages from my application to 1.0 preview. Essentially, I'm wondering, is there a plan to have the compiler catch more of these discrepencies because it's really challenging diagnosing the actual problem when all you have is a an javascript error.


    So like for instance, the code you saw above, the full code looks like this:
    
    
    
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" %>
    <!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></title>
    </head>
    <body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="extsm" runat="server" HideInDesign="True" />
    <ext:FitLayout ID="AdF" runat="server">
    <Items>
    <ext:Panel ID="test" runat="server" Title="title" Html="Test" >
    </ext:Panel>
    </Items>
    </ext:FitLayout>
    </form>
    </body>
    </html>
    This produces Expected ':' in Testa.aspx at line 14: char 63.
    The defective output is :
    Ext.onReady(function(){Ext.QuickTips.init();{id:"t est",xtype:"panel",html:"Test",title:"title"}}); ...

    Wrap the FitLayout in a viewport and the error goes away.

    This code produces a similar effect

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" %>
    <!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></title>
    </head>
    <body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="extsm" runat="server" HideInDesign="True" />
    <ext:ViewPort ID="vw" runat="server" HideBorders="true" StyleSpec="margin: 2px 2px 2px 2px;" BoxMinWidth="600" BoxMinHeight="400" Layout="Fit">
    <Items>
    <ext:RowLayout ID="r1" runat="server" Title="test">
    <Rows>
    <ext:LayoutRow>
    <ext:ColumnLayout ID="tt" runat="server">
    <Columns>
    <ext:LayoutColumn>
    <ext:Panel ID="Panel3" runat="server" HideBorders="false" Title="FirstRow">
    <Content>
    Test
    </Content>
    </ext:Panel>
    </ext:LayoutColumn>
    <ext:LayoutColumn>
    <ext:Panel ID="Panel2" runat="server" HideBorders="false" Title="Test">
    <Content>
    Test<br />test
    </Content>
    </ext:Panel>
    </ext:LayoutColumn>
    </Columns>
    </ext:ColumnLayout>
    </ext:LayoutRow>
    <ext:LayoutRow>
    <ext:Panel ID="Panel1" runat="server" HideBorders="false" Title="TEST">
    <Content>
    Test<br />test
    </Content>
    </ext:Panel>
    </ext:LayoutRow>
    <ext:LayoutRow>
    <ext:Panel runat="server" Title="Test" />
    </ext:LayoutRow>
    </Rows>
    </ext:RowLayout>
    </Items>
    </ext:ViewPort>
    </form>
    </body>
    </html>
    Same issue, an incomplete js fragment
    ... ;{id:"Panel3",xtype:"panel",title:"FirstRow",conte ntEl:"Panel3_Content"}...

    Hope this information helps to improve final release of version 1.0. These types of problems where an outter panel needs to be added as a parent used to be caught before the client js runtime.
  4. #4

    RE: [1.0] ext:FitLayout control still present in preview or broken

    Hi,

    We'll take a look at this. I think a server-side Exception should be thrown if the Layout Control is not nested in a parent Container.




    Geoffrey McGill
    Founder
  5. #5

    RE: [1.0] ext:FitLayout control still present in preview or broken

    although... a Layout Control does not require a parent Container if configured within a UserControl (.ascx). We'll do some research.

    Geoffrey McGill
    Founder
  6. #6

    RE: [1.0] ext:FitLayout control still present in preview or broken

    > although... Layout Control does not require a parent Container if configured within a
    > UserControl (.ascx). We'll do some research

    I have confirmed this problem occurs even if a child of a parent <ext:Panel>


    <ext:Panel ID="p" runat="server">
    <Content>
        <asp:PlaceHolder ID="ph" runat="server"/>
    </Content>
    </ext:Panel>
    When I ph.Controls.Add(LoadControl("...")), the loaded child control must STILL be wrapped in it's own <ext:Panel> or else the same problem occurs.

    <ext:Panel ID="p" runat="server"/>
    And in this case, p.Controls.Add(...) produces this error whether I nest the child with a panel or not.


    It also seems relevant that I should add that it would be more intuitive in this case to use p.Content.LoadControl() since Content is the tag we'd use in the designer.

  7. #7

    RE: [1.0] ext:FitLayout control still present in preview or broken

    Hi,

    You should add the controls to the .ContentControls collection in v0.8.x.


    In v1.0, you add to the .BodyControls collection.


    How this helps.


    EDIT: I have those backwards... .ContentControls = v1.0, .BodyControls = v0.8.x
    Geoffrey McGill
    Founder
  8. #8

    RE: [1.0] ext:FitLayout control still present in preview or broken

    In 1.0 preview, it's still ContentControls.

    And when I p.ContentControls.Add( LoadControl(...)), we trap in the client at:

    
    
    
    lookupComponent:function(a){if(Ext.isString(a)){return Ext.ComponentMgr.get(a)}else{if(!a.events)
    a is undefined (bold)

    This only occurs if my child usercontrol has its own child <ext:Panel> at the top.

    However, when I remove that child user control <ext:Panel> and leave only it's children, everything renders properly.
  9. #9

    RE: [1.0] ext:FitLayout control still present in preview or broken

    Hi,

    Please provide a test sample which demonstrates the last issue

Similar Threads

  1. Replies: 11
    Last Post: Oct 25, 2012, 12:08 PM
  2. Replies: 0
    Last Post: Feb 09, 2012, 2:39 PM
  3. Replies: 0
    Last Post: Sep 21, 2011, 11:26 PM
  4. Replies: 4
    Last Post: Jun 21, 2010, 10:31 AM
  5. [CLOSED] [1.0] RadioGroup Control in Content page broken.
    By pasion in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: May 16, 2010, 8:54 PM

Posting Permissions