Breaking changes migrating from Ext.NET v1 to v2

Page 1 of 2 12 LastLast
  1. #1

    Breaking changes migrating from Ext.NET v1 to v2

    Hello The Community,

    More and more people are migrating from Ext.NET v1 to v2.

    We add as much breaking changes as we can.
    http://examples2.ext.net/#/Getting_S...AKING_CHANGES/

    If we miss something, please post in this thread.

    Thank you.
  2. #2
    ColumnModel event listeners changes:
    <%-- Old --%>
    <Listeners>
           <HiddenChange />
           <ColumnMoved />
    </Listeners>
    
    <%-- New --%>
    <Listeners>
           <Hide />
           <ColumnMove />
    </Listeners>
    GridPanel event listeners changes (please confirm if these replacements are adequate):
    <%-- Old --%>
    <Listeners>
           <RowDblClick />
           <MouseUp  />
    </Listeners>
    
    <%-- New --%>
    <Listeners>
           <ItemDblClick />
           <ItemMouseUp />
    </Listeners>
  3. #3
    Quote Originally Posted by vadym.f View Post
    ColumnModel event listeners changes:
    <%-- Old --%>
    <Listeners>
           <HiddenChange />
           <ColumnMoved />
    </Listeners>
    
    <%-- New --%>
    <Listeners>
           <Hide />
           <ColumnMove />
    </Listeners>
    I added a new item.
    172. The ColumnModel's HiddenChange event has been removed. Please use its ColumnHide and ColumnShow events.
    Also you can listen the Hide and Show event of a Column itself.

    The ColumnModel's ColumnMoved event has been renamed to ColumnMove.

    Quote Originally Posted by vadym.f View Post
    GridPanel event listeners changes (please confirm if these replacements are adequate):
    <%-- Old --%>
    <Listeners>
           <RowDblClick />
           <MouseUp  />
    </Listeners>
    
    <%-- New --%>
    <Listeners>
           <ItemDblClick />
           <ItemMouseUp />
    </Listeners>
    There is the item #118.
    118. The GridPanel's "Row..." events like RowClick, RowDblClick, RowContextMenu, etc.
    have been renamed to ItemClick, ItemDblCLick, ItemContextMenu, etc.
    I updated it.

    118. The GridPanel's "Row..." events like RowClick, RowDblClick, RowContextMenu, etc.
    have been renamed to ItemClick, ItemDblCLick, ItemContextMenu, etc.

    The GridPanel's mouse events - MouseDown, MouseOut, MouseOver, MouseUp - have been removed.
    The new events - ItemMouseDown, ItemMouseEnter, ItemMouseLeave, ItemMouseUp. They fires in the context of a row.
    If you need listen mouse events in the context of a GridPanel itself, please use its events which names contain "...ContainerMouse...".
  4. #4
    I think that there is one more change.

    I have a code smth like that
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestForm.aspx.cs" Inherits="RdC.Front.TestForm" %>
    <script runat="server">
    		protected void Page_Load(object sender, EventArgs e)
    		{
    			List<string> l = new List<string>();
    			l.Add("a");
    			l.Add("b");
    			UniversRepeater.DataSource = l;
    			UniversRepeater.DataBind();
    		}</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 id="Head1" runat="server">
    	<title>Ext.NET Examples</title>
    </head>
    <body>
    	<form id="Form1" runat="server">
    		<ext:ResourceManager ID="ResourceManager1" runat="server">
    			<Listeners>
    				<DocumentReady Handler="#{TabPanel1}.add(#{Panel1});  #{TabPanel1}.setActiveTab(0);" />
    			</Listeners>
    		</ext:ResourceManager>
    		<br />
    		<ext:TabPanel ID="TabPanel1" runat="server" />
    		<ext:Panel runat="server" ID="Panel1" Title="Title" Layout="FormLayout">
    			<Content>
    				<asp:Repeater runat="server" ID="UniversRepeater">
    					<ItemTemplate>
    						<li class="univers">
    							<asp:Label runat="server" ID="UniversLabel">Label</asp:Label>
    						</li>
    					</ItemTemplate>
    					<SeparatorTemplate>
    						<li class="separator">&nbsp;</li>
    					</SeparatorTemplate>
    				</asp:Repeater>
    			</Content>
    		</ext:Panel>
    	</form>
    </body>
    </html>
    Well, I know that non-ext.Net widgets are not controlled by layout and that they cannot be added to Items collection. And everything added to Content is not controlled by layout. And that code worked perfectly before.
    But now I receive exception Control with type 'System.Web.UI.WebControls.Repeater' cannot be handled by layout. Stacktrace:
    [Exception: Control with type 'System.Web.UI.WebControls.Repeater' cannot be handled by layout]
    Ext.Net.AbstractContainer.PopulateItems(ControlCol lection contentControls, ItemsCollection`1 contentItems) +616
    Ext.Net.AbstractContainer.get_ItemsProxy() +427
    Ext.Net.AbstractContainer.get_ConfigOptions() +3574
    Ext.Net.AbstractPanel.get_ConfigOptions() +56
    Ext.Net.Panel.get_ConfigOptions() +56
    Ext.Net.ClientConfig.Process(Object obj) +408
    Ext.Net.ClientConfig.Serialize(Object obj, Boolean ignoreCustomSerialization, Boolean quoteName) +1369
    Ext.Net.ClientConfig.Serialize(Object obj, Boolean ignoreCustomSerialization) +290
    Ext.Net.ClientConfig.Serialize(Object obj) +53
    Ext.Net.BaseControl.get_InitialConfig() +127
    Basically it should be considered as a bug, because asp:repeater is added to Content and Layout should't be applied to it.
    But anyway I have to wrap my repeater into container to get it working or remove layout, but this is not working in case when I use it inside of FormPanel or if I need to define layout. So the only solution is to wrap it to the container.

    But hey, why so complicated?.. Why we all have to wrap every non-ext.Net control into container even when it is allowed by the framework? I have all rights to add asp:repeater into Content section without any abstract contaners...
  5. #5
    Seems like this <Content> + <asp:Repeater> is defect. We are investigating.

    As well, defining a .Layout on the <Content> parent (Panel) could be removed because Layouts should be ignored for elements within the <Content> region.
    Geoffrey McGill
    Founder & CEO
  6. #6
    Quote Originally Posted by geoffrey.mcgill View Post
    Seems like this <Content> + <asp:Repeater> is defect. We are investigating.
    Please, let me know about results of it

    Quote Originally Posted by geoffrey.mcgill View Post
    As well, defining a .Layout on the <Content> parent (Panel) could be removed because Layouts should be ignored for elements within the <Content> region.
    Yes, I know. It just an example to show that Panel without Layout defined works correctly. Also I have many of FormPanels which are Layout by default.
    BTW, why default layout is an 'anchor', not 'form'?
  7. #7
    If you set Layout property and Items collection is empty then all widgets in Content area will be considered as Items
    Therefore I don't agree that it is a bug, it is expected behaviour (exception), you cannot use Layout and Content with non Ext.Net controls

    but this is not working in case when I use it inside of FormPanel or if I need to define layout.
    Content with non Ext.Net controls should not be used with FormPanel, it has no sense because FormPanel works with items only
    If you "need to define layout" then something wrong in your design because mixing Items (defining Layout assumes that you need Items) and Content is very bad idea and should not be used
    Vladimir Shcheglov
    Sr. Developer
  8. #8
    Quote Originally Posted by Vladimir View Post
    If you set Layout property and Items collection is empty then all widgets in Content area will be considered as Items
    And it's a very strange behaviour. If I add smth to Content area - it must not be considered as Items. And what about "mixing Items (defining Layout assumes that you need Items) and Content is very bad idea and should not be used" in that case? If not mixing - everything is Items anyway, but mixing is bad. And, unfortunately, I have 10+ non-ext.Net widgets and controls which are placed in some Panel's Content with layout=fit and it works correctly, except the repeater.

    Quote Originally Posted by Vladimir View Post
    Therefore I don't agree that it is a bug, it is expected behaviour (exception), you cannot use Layout and Content with non Ext.Net controls
    I don't agree. It was said many many times that Content is not ruled by the layout. So why I can't use the Content? More than that - for what purpose the Content exists? Just for wrapping controls in abstract containers?

    Quote Originally Posted by Vladimir View Post
    Content with non Ext.Net controls should not be used with FormPanel, it has no sense because FormPanel works with items only
    If you "need to define layout" then something wrong in your design because mixing Items (defining Layout assumes that you need Items) and Content is very bad idea and should not be used
    Well, it was not my design at first, but anyway - everything worked perfectly. However I see your point and agree that the violinist is not needed :-)

    BTW, such a design
    	<ext:TabPanel ID="tabPnl" runat="server" ActiveTabIndex="0" 
            Plain="true" Width="600">
            <Items>
    ...
                <ext:Panel ID="MesSolutionsPanel" runat="server" BodyPadding="6" Layout="FormLayout">
                    <Content>
                        <uc:uc1Tag ID="MesSolutions" runat="server" />
                        <uc:uc2Tag ID="MesRendezVous" runat="server" Visible="false" />
                        <uc:uc3Tag ID="MaSolution" runat="server" Visible="false" />
                        <uc:uc3Tag ID="SolutionEvaluationSummary" runat="server" Visible="false" Type="SOLUTION" />
                        <uc:uc4Tag ID="SolutionEvaluationDetail" runat="server" Visible="false" Type="SOLUTION" />
                    </Content>
    				<Items>
                        <ext:TextField runat="server" ID="TabUrl3" Hidden="true" ReadOnly="true" LabelWidth="150" Width="450" />
    				</Items>
                </ext:Panel>
    was working and setting Layout to FormLayout was the only way to get the content rendered correctly in v1.7. And I don't want to wrap every user control in the container additionally just because Content (which is not ruled by layout by definition) should not be used with the layout despite the fact that it works for everything except the repeater.
  9. #9
    And it's a very strange behaviour. If I add smth to Content area - it must not be considered as Items.
    No, Layout property says that you want to use some particular layout logic. Layout logic and non Ext.Net controls is not supported combination.
    We allow only some controls like user controls, content placeholder inside Content of container with Layout property (in this case we read widgets inside user control and consider it as Items of that container)

    If not mixing - everything is Items anyway, but mixing is bad.
    I meant that Items and Content for one container should not be used at one time. Or Items, or Content. Not both
    And if Layout is defined then Content will be considered as Items (to support case when items are defined inside user control or content placeholder)
    The single case where you can use both Items and Content is situation when Content contains user controls with Ext.Net widgets only. In this case, items from Items and user controls will be combined

    And, unfortunately, I have 10+ non-ext.Net widgets and controls which are placed in some Panel's Content with layout=fit and it works correctly, except the repeater.
    Why do you use Layout="Fit" in this case? Your non Ext.Net widgets will not be participated in layout logic

    I don't agree. It was said many many times that Content is not ruled by the layout. So why I can't use the Content? More than that - for what purpose the Content exists? Just for wrapping controls in abstract containers?
    You can use Content as you need. Just combination Container with Layout and Content with non Ext.Net widgets is incorrect and cannot be used
    Vladimir Shcheglov
    Sr. Developer
  10. #10
    Quote Originally Posted by Vladimir View Post
    No, Layout property says that you want to use some particular layout logic. Layout logic and non Ext.Net controls is not supported combination.
    Yes, sure. But it was said that the Content is not ruled by layout so I thought that it won't matter if the layout is defined or not...

    Quote Originally Posted by Vladimir View Post
    We allow only some controls like user controls, content placeholder inside Content of container with Layout property (in this case we read widgets inside user control and consider it as Items of that container)
    I see. Well, repeater worked well in v1.7 inside of content of the container with layout set...

    Quote Originally Posted by Vladimir View Post
    I meant that Items and Content for one container should not be used at one time. Or Items, or Content. Not both
    Well, they may be used together...

    Quote Originally Posted by Vladimir View Post
    And if Layout is defined then Content will be considered as Items (to support case when items are defined inside user control or content placeholder)
    The single case where you can use both Items and Content is situation when Content contains user controls with Ext.Net widgets only. In this case, items from Items and user controls will be combined
    Well, ok. But if user control contains ext.Panel with items - what will be combined and which layout will be used?
    I've found out that repeater in such a case
    <ext:FormPanel Layout="FormLayout">
       <Items>
           <ext:Panel>
                <Content>
                      <asp:Repeater>
    is working correctly, which means that layout is not used on internal panel. So which layout will be used in such a case?
    page:
    <ext:Panel ID="A" Layout="FitLayout">
         <Content>
              <uc:myControl>
         </Content>
          <Items>
               .....
          </Items
    </ext:Panel>
    
    myControl:
    <ext:Panel ID="B">
         <Items>
            .....
         </Items>
    </ext:Panel
    ?
    Will items from the A panel be combined with Items from the B panel? Will they be layouted with fitlayout?


    Quote Originally Posted by Vladimir View Post
    Why do you use Layout="Fit" in this case? Your non Ext.Net widgets will not be participated in layout logic
    Because they were not rendered correctly without it - panels and controls were not sized correctly while switching tabs. But it was in the v1.7 and maybe it was fixed in 2.3, I'll check.

    Quote Originally Posted by Vladimir View Post
    You can use Content as you need. Just combination Container with Layout and Content with non Ext.Net widgets is incorrect and cannot be used
    Well, all of this should be documented really well. And since it worked in the v1.7 - some note should be put into BREAKING_CHANGES document.
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 9
    Last Post: Dec 12, 2012, 5:04 AM
  2. [CLOSED] Migrating from v1.5 to 2.0.1 differences.
    By ViDom in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Sep 27, 2012, 1:47 PM
  3. [CLOSED] Migrating to 2: PartialViewResult
    By PhilG in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: May 21, 2012, 9:27 AM
  4. [CLOSED] Migrating a MVC App from v1 to v2
    By RCN in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 10, 2012, 7:05 PM
  5. [CLOSED] Migrating from Coolite to Ext.Net
    By daneel in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jan 19, 2011, 11:44 AM

Posting Permissions