FormPanel Validation with Nested User Controls

  1. #1

    FormPanel Validation with Nested User Controls


    My forms were submitting fine using 2.1. After updating to 2.2, myform.getForm().isValid() is returning false even though all the required fields are filled out. I suspect that the problem is either the way the user controls are nested inside the formpanel or something was changed with the allowblank attribute in 2.2. I hoping you could point me in the right direction. Here is an example of the nested user controls:

    <ext:FormPanel runat="server" ID="lspFormPanel" Width="860" ButtonAlign="Center" >
            <%--Panel that contains General Instructions--%>
            <ext:Panel ID="lspInstructions" runat="server" Header="false" Border="false" Hidden="false" Layout="FitLayout" >
                    <uc1:Instructions ID="ucInstruct" runat="server" />
            <ext:Button ID="btnSave" runat="server" Text="Save" Height="40" Icon="Disk" OnDirectClick="click_Save" />
            <ext:Button ID="btnCancel" runat="server" Text="Cancel" Height="40" Icon="Cross" OnDirectClick="click_Cancel" />
            <ext:Button ID="btnSubmit" runat="server" Text="Submit" Height="40" Icon="BasketAdd" >
                    <Click OnEvent="checkValidation" ><Confirmation ConfirmRequest="true" Message="Are you sure that you want to submit this course proposal? No changes can be made after the initial submission." />
                        <EventMask ShowMask="true" Msg="Proposal is Submitting..." /> 
                   <Click Handler = "if (#{lspFormPanel}.getForm().isValid()) return true; else{{icon: Ext.MessageBox.ERROR, msg: 'Please check the fields and try again!', buttons:Ext.Msg.OK}); return false;}" />
    Here is an example of the layout I use inside the user controls:

    <ext:Panel ID="pnl1" runat="server" Layout="AnchorLayout" >
            <ext:Panel ID="pnlInstr" runat="server" Border="false" Layout="FormLayout" >
                    <ext:Label ID="lbl1" runat="server" Html="Test1" />
                    <ext:Label ID="lbl2" runat="server" Html="Test2" />
  2. #2
    I cannot reproduce it, for me true value is returned
    Please post runable test case
  3. #3
    You can close this case. I was destroying an embedded user control that had allowBlank = false listed as a default parameter. In 2.1, the user control was destroyed and allowBlank = false was ignored and now in 2.2 it is not. I set each field to be allowBlank = true before destroying and now it works. Thanks!

Similar Threads

  1. [CLOSED] Issue in layout with nested user controls [1.6]
    By lapix in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Dec 05, 2012, 2:17 PM
  2. [CLOSED] How should I nested with user controls?
    By ViDom in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 04, 2012, 11:14 AM
  3. Replies: 0
    Last Post: Nov 17, 2011, 10:53 AM
  4. Replies: 5
    Last Post: Nov 03, 2011, 2:39 AM
  5. Replies: 0
    Last Post: Nov 20, 2009, 6:57 AM

Tags for this Thread

Posting Permissions