[CLOSED] add text field to hboxlayout

  1. #1

    [CLOSED] add text field to hboxlayout

    Hi,

    I am think how I can add two text fields to the HBoxLayout tag, this is what I have, it will render the text fields, but the text fields is showing in two rows

    <ext:HBoxLayout ID="HBoxLayout1" runat="server">
                                    <Content>
                                        <ext:TextField ID="TextField7" runat="server" FieldLabel="test" Width="210" LabelWidth="30"
                                            AllowBlank="false" MsgTarget="side">
                                        </ext:TextField>
                                        <ext:TextField ID="TextField1" runat="server" FieldLabel="test" Width="210" LabelWidth="30"
                                            AllowBlank="false" MsgTarget="side">
                                        </ext:TextField>
                                    </Content>
                                </ext:HBoxLayout>
    when I tried to enclose the text field in <Items> instead of <Content>, the page throws an exception (The 'Items' property cannot be set declaratively).

    So how can I add two text fields to the hboxlayout and make them stay in the same row. Thanks.
  2. #2
    Hi,

    Generally things added to the <Content> regions do not participate in the Layout.

    As wel, you should use the .Layout property instead of a Layout Control.

    Example

    <ext:Panel runat="server" Title="Example" Layout="HBoxLayout" Padding="5">    <Items>
            <ext:TextField 
                runat="server" 
                FieldLabel="test" 
                Width="210" 
                LabelWidth="30"
                AllowBlank="false" 
                MsgTarget="side"
                />
            <ext:TextField 
                runat="server" 
                FieldLabel="test" 
                Width="210" 
                LabelWidth="30"
                AllowBlank="false" 
                MsgTarget="side"
                />
        </Items>
    </ext:Panel>
    Hope this helps.
    Geoffrey McGill
    Founder
  3. #3
    Just for my curiosity then, what are the valid child elements for hboxlayout. <Content> is obviously one of them.
  4. #4
    1. Did you place HBoxLayout inside any Ext.Net container? Layout control cannot be independed
    2. Only Items (not Content) can be used with layout control
    3. Please consider to use Layout property instead LayoutControls. It will reduce code (makes it more readable), also in v2 layout controls will be removed (Layout property will be accessible only)
    4. Please note that if you use FieldLabel property then it is better (desirable choice) to place widget inside FormPanel or container with FormLayout
  5. #5
    I did put <Items> in <hboxlayout>, but this is the error I got : The 'Items' property cannot be set declaratively. Anyways, thanks for letting me know that the layout controls will be removed in v2.
  6. #6
    I did put <Items> in <hboxlayout>, but this is the error I got : The 'Items' property cannot be set declaratively.
    Please provide test sample which demonstrates that issue
  7. #7
    With HBoxLayout you have to use BoxItems property (instead Items)
    But as I mentioned before, it is better to use Layout property
  8. #8
    Here is the code snippet

                        <ext:HBoxLayout ID="HBoxLayout1" runat="server">
                            <Items>
                                <ext:TextField ID="TextField7" runat="server" FieldLabel="test" Width="210" LabelWidth="30"
                                    AllowBlank="false" MsgTarget="side">
                                </ext:TextField>
                                <ext:TextField ID="TextField1" runat="server" FieldLabel="test" Width="210" LabelWidth="30"
                                    AllowBlank="false" MsgTarget="side">
                                </ext:TextField>
                            </Items>
                        </ext:HBoxLayout>
  9. #9
    Quote Originally Posted by Vladimir View Post
    With HBoxLayout you have to use BoxItems property (instead Items)
    But as I mentioned before, it is better to use Layout property
    It works. Many Thanks.

Similar Threads

  1. Always empty text field when I validate.
    By chearner in forum 1.x Help
    Replies: 3
    Last Post: Aug 10, 2012, 6:06 PM
  2. [CLOSED] Icon Align in Text Field
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 13, 2011, 8:50 PM
  3. Text Field issue
    By paddy in forum 1.x Help
    Replies: 0
    Last Post: Jul 26, 2011, 7:16 AM
  4. [CLOSED] Problem with Tab Key press in Text Field
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Sep 24, 2010, 4:24 PM
  5. [CLOSED] [1.0] Composite Field vs HBoxLayout
    By jchau in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Jul 09, 2010, 5:12 PM

Posting Permissions