Validation on FormPanel with a Container

  1. #1

    Validation on FormPanel with a Container

    Hello,

    I have a FormPanel with some reqired TextField items and an Ext:Container element with an asp UserControl. The UserControl has an Ext:Panel with some other required Ext:TextField controls.

    If I call isValid() on the form, fields into the UserControl are ignored tough they are marked as invalid on the UI .

    Here what's in the UserControl

    
    <ext:FormPanel ID="Form1" runat="server" Title="New record"
            AutoHeight="true" MonitorValid="true" Padding="5" ButtonAlign="Right"
            Layout="FormLayout">
            <Items>
                    <ext:NumberField ID="NewId" runat="server" FieldLabel="New Id" Width="240"
                                                    AllowBlank="true" MinValue="1" MaxValue="999999999" />
                     <ext:Container ID="Container12" runat="server">
                             <Content>
                                     <ctrl:AddressPanel ID="NewAddress" runat="server">
                                     </ctrl:AddressPanel>
                             </Content>
                     </ext:Container>
                     ...
    And here's the UserControl content
                    <ext:Panel ID="AddressPanel" runat="server" Title="Address" Padding="5" Layout="FormLayout"
                        AutoScroll="true">
                        <Items>
                            <ext:ComboBox ID="Region" runat="server" TriggerAction="All" ValueField="Value"
                                DisplayField="Text" FieldLabel="Region" Width="250" AllowBlank="false">

    Wat's wrong?

    It's possible to include the fields in the UserControl in the validation process?
    Last edited by lcestola; Jun 15, 2012 at 12:42 PM. Reason: Better explaination
  2. #2
    Hi,

    If you will wrap the user control Panel in an <ext:FormLayout> control, its components should participate in validation.
  3. #3
    Hi Daniil, thank you for the response and sorry for delay :)

    I've tryed to wrap the user control placing a FormLayout as a parent of the Panel, but still can't see the inner TextField along with the others in the javascript items array of the form.

    <ext:FormLayout ID="addressPanel" runat="server" Padding="5" BodyStyle="margin: 15 15 15 15">
        <Content>
            <ext:Panel ID="AddressPanel" runat="server" Title="Address" Padding="5" Layout="FormLayout"
                AutoScroll="true">
                <Items>
                    <ext:ComboBox ID="Region" runat="server" TriggerAction="All" ValueField="Value"
                        DisplayField="Text" FieldLabel="Region" Width="250" AllowBlank="false">
    May I still be missing something?
  4. #4
    Ok, I finally solved like you suggested :)

    I was wrongly putting fileds into Content instead of the Anchors collection (like you wrote here).

    For other's convenience, here is a link to your example.

    Thank you very much.
  5. #5
    Glad to hear you have resolved the problem due to the example I have posted earlier!

Similar Threads

  1. [CLOSED] Retrieve the formpanel ID rendered within a container window
    By Daly_AF in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Apr 23, 2012, 10:22 AM
  2. Doubt about formpanel with ext container
    By NishaLijo in forum 1.x Help
    Replies: 1
    Last Post: Feb 21, 2012, 7:59 AM
  3. Validation without FormPanel
    By AlexMaslakov in forum 1.x Help
    Replies: 6
    Last Post: Sep 09, 2011, 9:22 AM
  4. FormPanel Validation
    By Ganesh3.shirsath in forum 1.x Help
    Replies: 1
    Last Post: Oct 07, 2010, 8:11 AM
  5. Help, FormPanel Validation Invalid
    By diego in forum 1.x Help
    Replies: 0
    Last Post: Jan 21, 2010, 11:23 AM

Tags for this Thread

Posting Permissions