[CLOSED] UserControl TextFields are not firing validation inside FormPanel

  1. #1

    [CLOSED] UserControl TextFields are not firing validation inside FormPanel

    Hi Team

    Please download the code from the below link and let me know your thoughts.

    http://111.93.27.51/Bizbites_ExtIssues/SourceCode/ExtIssues.zip


    Regards
    Mohan
    Last edited by Daniil; Aug 12, 2013 at 2:21 PM. Reason: [CLOSED]
  2. #2
    Please post page and user control here. We don't need any assemblies, just test sample reproduces the issue. Please remove any unrelated code from the example
    Vladimir Shcheglov
    Sr. Developer
  3. #3
    Quote Originally Posted by Vladimir View Post
    Please post page and user control here. We don't need any assemblies, just test sample reproduces the issue. Please remove any unrelated code from the example
    Hi

    Here is the code

    Aspx:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ExtIssues.Default" %>
    
    
    <%@ Register Assembly="Ext.Net" TagPrefix="ext" Namespace="Ext.Net" %>
    <%@ Register Src="UserControls/MultiTranslation.ascx" TagName="MultiTranslation" TagPrefix="UsrCtrl" %>
    <!DOCTYPE html>
    
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
         <style>
            .controlContainer .x-form-item .x-form-element
            {
                padding-left: 5px !important;
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager ID="resourceManager" runat="server"></ext:ResourceManager>
            <ext:Viewport Layout="BorderLayout" ID="mainContainer" runat="server">
                <Items>
                    <ext:FormPanel ID="formPanelEdit" Title="Data Entry" runat="server" Region="Center" ButtonAlign="Left" Layout="FormLayout" Width="400">
                        <Items>
                            <ext:Container ID="userControlContainer" runat="server">
                                <Content>
                                    <UsrCtrl:MultiTranslation ID="multiTranslation" runat="server" />
                                </Content>
                            </ext:Container>
                            <ext:ComboBox runat="server" ID="comboBox" Width="138" AllowBlank="false" BlankText="Combo Box Item Required">
                                <Items>
                                    <ext:ListItem  Value="Alpha" Text="Alpha"></ext:ListItem>
                                    <ext:ListItem  Value="Beta" Text="Beta"></ext:ListItem>
                                    <ext:ListItem  Value="Gama" Text="Gama"></ext:ListItem>
                                </Items>
                            </ext:ComboBox>
                            <ext:TextField ID="textField1" runat="server" MarginSpec="3 0 0 0" FieldLabel="Text Field1" LabelAlign="Top" AllowBlank="false" BlankText="Text Field1 Is Required">
                            </ext:TextField>
                            <ext:TextField ID="textField2" runat="server" MarginSpec="3 0 0 0" FieldLabel="Text Field2" LabelAlign="Top" AllowBlank="false" BlankText="Text Field2 Is Required">
                            </ext:TextField>
                        </Items>
                        <Buttons>
                            <ext:Button ID="btnAdd" runat="server" Text="Add" Icon="ImageAdd">
                                <DirectEvents>
                                    <Click Before="return #{formPanelEdit}.getForm().isValid();" OnEvent="btnAdd_Click">
                                        <EventMask ShowMask="true" />
                                    </Click>
                                </DirectEvents>
                                <Listeners>
                                    <Click Handler="if (#{formPanelEdit}.getForm().isValid()) {return true;}else{Ext.Msg.show({icon: Ext.MessageBox.ERROR, msg: 'FormPanel is incorrect', buttons:Ext.Msg.OK});}" />
                                </Listeners>
                            </ext:Button>
                        </Buttons>
                        <BottomBar>
                            <ext:StatusBar ID="StatusBar1" runat="server">
                                <Plugins>
                                    <ext:ValidationStatus FormPanelID="formPanelEdit" ID="ctl38"></ext:ValidationStatus>
                                </Plugins>
                            </ext:StatusBar>
                        </BottomBar>
                    </ext:FormPanel>
                    <ext:FormPanel ID="formPanelList" runat="server" Region="East" Width="400" Layout="FormLayout">
                        <Items>
                            
                        </Items>
                    </ext:FormPanel>
                </Items>
            </ext:Viewport>
    
    
        </form>
    </body>
    </html>
    --------------------------------------------------------------
    UserControl:
    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MultiTranslation.ascx.cs" Inherits="ExtIssues.UserControls.MultiTranslation" %>
    <%@ Register Assembly="Ext.Net" TagPrefix="ext" Namespace="Ext.Net" %>
    <ext:FormPanel ID="formPanelMultiTranslation" Layout="AnchorLayout" runat="server" Border="false">
        <Items>
            <ext:TextField ID="txt_InputGb" runat="server" Width="200" MaxLength="1000" BlankText="Translation Value Required" LabelAlign="Top"
                Icon="FlagGb" FieldLabel="English" MarginSpec="3 0 0 0" AllowBlank="false">
            </ext:TextField>
            <ext:TextField ID="txt_InputIq" runat="server" Width="200" MaxLength="1000" BlankText="Translation Value Required" LabelAlign="Top"
                Icon="FlagIq" FieldLabel="Arabic" MarginSpec="3 0 0 0" AllowBlank="false">
            </ext:TextField>
            <ext:TextField ID="txt_InputCn" runat="server" Width="200" MaxLength="1000" BlankText="Translation Value Required" LabelAlign="Top"
                Icon="FlagCn" FieldLabel="Chineese" MarginSpec="3 0 0 0" AllowBlank="false">
            </ext:TextField>
            <ext:TextField ID="txt_InputHn" runat="server" Width="200" MaxLength="1000" BlankText="Translation Value Required" LabelAlign="Top"
                Icon="FlagIn" FieldLabel="Hindi" MarginSpec="3 0 0 0" AllowBlank="false">
            </ext:TextField>
        </Items>
    </ext:FormPanel>
    Let me know your thoughts.

    Regards
    Mohan
    Last edited by Daniil; Aug 12, 2013 at 4:02 AM. Reason: Please use [CODE] tags
  4. #4
    Hi @mohan.bizbites,

    I think the user control is rendered as raw HTML in your case.

    To get their components validated, they should be rendered as items.

    Please try to set up Layout="FitLayout" or Layout="AnchorLayout" for the userControlContainer Container.
  5. #5
    Quote Originally Posted by Daniil View Post
    Hi @mohan.bizbites,

    I think the user control is rendered as raw HTML in your case.

    To get their components validated, they should be rendered as items.

    Please try to set up Layout="FitLayout" or Layout="AnchorLayout" for the userControlContainer Container.
    Hi Daniil

    FYI I have already used AnchorLayout in the provided code. Please go through the script once again.

    I have already tried with FitLayout, FormLayout and there is no fun.

    Please let us know your thoughts.

    Regards
    Mohan
  6. #6
    I cannot see any Layout here:
    <ext:Container ID="userControlContainer" runat="server">
  7. #7
    Quote Originally Posted by Daniil View Post
    I cannot see any Layout here:
    <ext:Container ID="userControlContainer" runat="server">
    Sorry I was overlooked, Thank you so much Daniil. You can close this...

    Regards
    Mohan

Similar Threads

  1. Replies: 4
    Last Post: Dec 19, 2012, 9:58 AM
  2. Replies: 5
    Last Post: Nov 12, 2012, 7:39 AM
  3. Replies: 8
    Last Post: Feb 15, 2012, 9:04 AM
  4. TabPanel validation without FormPanel inside
    By AlexMaslakov in forum 1.x Help
    Replies: 5
    Last Post: Sep 09, 2011, 9:20 AM
  5. FormPanel validation unexpected firing
    By RPIRES in forum 1.x Help
    Replies: 2
    Last Post: Jun 11, 2010, 9:36 PM

Tags for this Thread

Posting Permissions