[CLOSED] CompositeField

  1. #1

    [CLOSED] CompositeField

    Hi, guys,

    I am developing a website and using compositefield in many places, and found some things that I dont know if I am doing right.

    Code sample bellow.
    1. ComboBox with FieldLabel on top: tried with compositefield and hboxlabel.
    2. Fileupload inside compositefield

    Code:

    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <%@ Register TagPrefix="asp" Namespace="System.Web.UI.DataVisualization.Charting" %>
    <%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>
    <!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">
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        Label Align Top - Panel hbox
        <ext:Panel Border="false" runat="server" Height="40" LabelAlign="top" Layout="HBoxLayout">
            <Items>
                <ext:ComboBox FieldLabel="Label" runat="server" />
                <ext:ComboBox FieldLabel="Label" runat="server" />
            </Items>
        </ext:Panel>
        Label Align Top - CompositeField
        <ext:CompositeField runat="server" AutoHeight="true" LabelAlign="top">
            <Items>
                <ext:ComboBox FieldLabel="Label" runat="server" />
                <ext:ComboBox FieldLabel="Label" runat="server" />
            </Items>
        </ext:CompositeField>
        FileUpload
        <ext:CompositeField runat="server">
            <Items>
                <ext:FileUploadField runat="server" />
            </Items>
        </ext:CompositeField>
    </body>
    </html>
    Last edited by geoffrey.mcgill; Mar 01, 2011 at 3:44 PM. Reason: [CLOSED]
  2. #2
    Hi,

    Please avoid to use FieldLabel when it is out of 'form' layout. It's requirement of ExtJS, see
    http://dev.sencha.com/deploy/dev/doc...ber=fieldLabel

    The solution is wrapping fields in a container with 'form' layout. The same thing is in case with CompositeField because it uses 'hbox' layout.

    Example
    <%@ 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 runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        Label Align Top - Panel hbox
        <ext:Panel runat="server" Layout="HBoxLayout">
            <Items> 
                <ext:Container runat="server" Layout="FormLayout" LabelAlign="top">
                    <Items>
                        <ext:ComboBox FieldLabel="Label" runat="server" />
                    </Items>
                </ext:Container>
               <ext:Container runat="server" Layout="FormLayout" LabelAlign="top">
                    <Items>
                        <ext:ComboBox FieldLabel="Label" runat="server" />
                    </Items>
                </ext:Container>
            </Items>
        </ext:Panel>
        Label Align Top - CompositeField
        <ext:CompositeField runat="server">
            <Items>
                <ext:Container runat="server" Layout="FormLayout" LabelAlign="top">
                    <Items>
                        <ext:ComboBox FieldLabel="Label" runat="server" />
                    </Items>
                </ext:Container>
               <ext:Container runat="server" Layout="FormLayout" LabelAlign="top">
                    <Items>
                        <ext:ComboBox FieldLabel="Label" runat="server" />
                    </Items>
                </ext:Container>
            </Items>
        </ext:CompositeField>
    </body>
    </html>
    We are investigating the case with FileUploadField in CompositeField.
  3. #3
    Quote Originally Posted by Daniil View Post
    We are investigating the case with FileUploadField in CompositeField.
    I discovered that it's required to set up Width for FileUploadField.

    Example
    <ext:CompositeField runat="server">
        <Items>
            <ext:FileUploadField runat="server" Width="200" />
        </Items>
    </ext:CompositeField>
    Last edited by Daniil; Apr 13, 2012 at 12:59 PM.
  4. #4
    Daniil, thanks.

    I als found a solution for the Combobox with align top. It works nice, and doesnt need of containers nesting.

    I will check the fileupload solution and write back.

    Check this out:
                <ext:Panel runat="server" LabelAlign="top" Layout="ColumnLayout">
                    <Items>
                        <ext:ComboBox FieldLabel="Label1" runat="server" />
                        <ext:ComboBox FieldLabel="Label2" runat="server" />
                    </Items>
                </ext:Panel>
  5. #5
    Quote Originally Posted by SouthDeveloper View Post
    Daniil, thanks.

    I als found a solution for the Combobox with align top. It works nice, and doesnt need of containers nesting.

    Check this out:
                <ext:Panel runat="server" LabelAlign="top" Layout="ColumnLayout">
                    <Items>
                        <ext:ComboBox FieldLabel="Label1" runat="server" />
                        <ext:ComboBox FieldLabel="Label2" runat="server" />
                    </Items>
                </ext:Panel>
    Yes, FieldLabel can work when it's out of 'form' layout although we recommend to use FieldLabel in a 'form' layout context. This will provide the most consistent results cross-browser.
    Last edited by geoffrey.mcgill; Feb 28, 2011 at 3:14 PM.

Similar Threads

  1. [CLOSED] CompositeField LabelWidth
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jul 19, 2012, 12:55 PM
  2. [CLOSED] CompositeField: Second control always behind first.
    By ljcorreia in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Oct 28, 2011, 2:17 PM
  3. [CLOSED] CompositeField as ServerControl
    By Jean-Pierre Poulin in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 06, 2010, 3:24 AM
  4. [CLOSED] [1.0] CompositeField vs MultiField
    By r_honey in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Apr 05, 2010, 3:50 PM
  5. [CLOSED] Looking for CompositeField
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Sep 09, 2009, 1:59 PM

Tags for this Thread

Posting Permissions