[CLOSED] [Bug 2.2] ValidityChange not triggering when radio button prechecked and other input nested inside panel or container

  1. #1

    [CLOSED] [Bug 2.2] ValidityChange not triggering when radio button prechecked and other input nested inside panel or container

    If before I click any radio buttons, I set focus to the textfield and meet the validation requirements with input, the button should become enabled. It does not.
    <%@ Page Language="C#" %>
    <script runat="server">
     protected void Page_Load( object sender, EventArgs e ) {
     }
     protected void OnSubmit( object sender, DirectEventArgs e ) {
      X.MessageBox.Show( new MessageBoxConfig() { Buttons = MessageBox.Button.OK, Message = "Test", Title = "Test" } );
     }
    </script>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="//www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Test20</title>
    </head>
    <body>
    <form id="f" runat="server">
    
    <ext:Viewport ID="vp" runat="server" Layout="VBoxLayout">
    <LayoutConfig>
        <ext:VBoxLayoutConfig Align="Stretch" />
    </LayoutConfig>
    <Items>
     <ext:FormPanel ID="UserF" runat="server" Width="400" Border="false" BodyCls="BodyFrame" DefaultButton="Submit">
     <Items>
    
      <ext:RadioGroup ID="rg" runat="server" Vertical="true" ColumnsNumber="1" FieldLabel="Choose a profile type to create below" StyleSpec="padding-left:6px;" AllowBlank="false">
      <Items>
       <ext:Container ID="rc" runat="server" ColumnWidth="1.00">
       <Items>
        <ext:Radio runat="server" BoxLabel="Box1" Enabled="true" />
        <ext:Radio runat="server" BoxLabel="Box2" Enabled="true" Checked="true" />
        <ext:Label runat="server" Text="Future" />
        <ext:Radio runat="server" BoxLabel="Box3" Disabled="true" />
       </Items>
       </ext:Container>
      </Items>
      </ext:RadioGroup>
      <ext:Container ID="CapP" runat="server" BodyCls="BodyFrame" Height="140" PaddingSpec="0 0 0 110px">
      <Content>
       <ext:TextField ID="UserName" runat="server" FieldLabel="User Name" AllowBlank="false" MinLength="5" MaxLength="256" EnforceMaxLength="true" EmptyText="Login name" Width="380" />
      </Content>
      </ext:Container>
      
     </Items>
     <Buttons>
      <ext:Button ID="Submit" runat="server" Text="Create User" Disabled="true">
      <DirectEvents>
       <Click OnEvent="OnSubmit" Method="POST" DisableCaching="true">
        <EventMask ShowMask="true" MinDelay="500" Msg="Creating User..." />
       </Click>
      </DirectEvents>
      </ext:Button>
     </Buttons>
     <Listeners>
      <ValidityChange Handler="#{Submit}.setDisabled(!valid);" />
     </Listeners>
     </ext:FormPanel>
    </Items>
    </ext:ViewPort>
    <ext:ResourceManager ID="rm" runat="server" CleanResourceUrl="true" ScriptMode="Development" InitScriptMode="Linked"
      HideInDesign="true" GZip="true" />
    </form>
    </body>
    </html>
    Last edited by Daniil; Apr 09, 2013 at 4:08 AM. Reason: [CLOSED]
  2. #2
    Additionally, the only way to get the button to be valid, thus enabled is to click on the currently unselected radio. That won't work if you only have one enabled radio.
  3. #3
    Hello!

    You should use Content collection only for not Ext.NET controls. Please, move TextField to Items collection:

    <ext:RadioGroup ID="rg" runat="server" Vertical="true" ColumnsNumber="1" FieldLabel="Choose a profile type to create below" StyleSpec="padding-left:6px;" AllowBlank="false">
      <Items>
       <ext:Container ID="rc" runat="server" ColumnWidth="1.00">
       <Items>
        <ext:Radio runat="server" BoxLabel="Box1" Enabled="true" />
        <ext:Radio runat="server" BoxLabel="Box2" Enabled="true" Checked="true" />
        <ext:Label runat="server" Text="Future" />
        <ext:Radio runat="server" BoxLabel="Box3" Disabled="true" />
       </Items>
       </ext:Container>
      </Items>
      </ext:RadioGroup>
      <ext:Container ID="CapP" runat="server" BodyCls="BodyFrame" Height="140" PaddingSpec="0 0 0 110px">
          <Items>
         <ext:TextField ID="UserName" runat="server" FieldLabel="User Name" AllowBlank="false" MinLength="5" MaxLength="256" EnforceMaxLength="true" EmptyText="Login name" Width="380" />
              </Items>
      </ext:Container>
  4. #4
    The reason I used Content with a TextField is just for this example (to simplify). In my real case, I have to use Context because there is a user control where this textfield appears. I have to call and access members and properties in this user control I also have a few other controls that aren't Ext.net that don't participate. So Items may not be an option. Any thoughts?
  5. #5
    Hello,

    To get a TextFeld participated in validation, it must be "hierarchically" an item of a FormPanel. Any non-Ext.NET things you can wrap in a Container if needed and put into an Items collection.

    Hope this helps.
  6. #6
    Yeah, this is my understanding as well. All my problems keep coming back to the lack of access to usercontrol properties and members if I use UserControlLoader. I'm working on a solution but it's require a lot of redesign.
  7. #7
    Quote Originally Posted by michaeld View Post
    Yeah, this is my understanding as well. All my problems keep coming back to the lack of access to usercontrol properties and members if I use UserControlLoader. I'm working on a solution but it's require a lot of redesign.
    Seems we are discussing this problem in another thread, aren't?

    Can we close the current thread?

Similar Threads

  1. [CLOSED] Button align issue inside container in IE
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 15, 2012, 6:23 AM
  2. Replies: 6
    Last Post: Oct 15, 2012, 6:20 AM
  3. Replies: 3
    Last Post: Aug 12, 2011, 5:56 PM
  4. [CLOSED] Hiding Panel on Radio Button Click
    By CMA in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 01, 2010, 12:24 PM
  5. Replies: 6
    Last Post: Feb 03, 2010, 3:31 PM

Posting Permissions