[CLOSED] RadioGroup stop working!

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] RadioGroup stop working!

    Hi,

    We updated our project to Ext.NET 4.2 Web Forms, and the RadioGroup stop working. The checked value is not being pass to server side. Or we are doing something wrong here! Can you help us? Thanks! the test case is below...

    ASPX

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="testeRadioButton.aspx.cs" Inherits="PxhUtils.VIEWER.testeRadioButton" %>
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server">
            </ext:ResourceManager>
            <ext:RadioGroup ID="rgTeste"
                runat="server"
                GroupName="rgTeste" 
                ColumnsNumber="1">
                <Items>
                    <ext:Radio ID="rSim" runat="server" BoxLabel="Sim" Checked="true" />
                    <ext:Radio ID="rNao" runat="server" BoxLabel="Nao" />
                </Items>
            </ext:RadioGroup>
            <ext:Button ID="btnSalvar" runat="server" Text="Testar" Icon="Disk">
                <DirectEvents>
                    <Click OnEvent="btnSalvar_DirectClick"></Click>
                </DirectEvents>
            </ext:Button>
        </form>
    </body>
    </html>
    ASPX.CS

        public partial class testeRadioButton : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
    
            protected void btnSalvar_DirectClick(object sender, DirectEventArgs e)
            {
                X.MessageBox.Alert(rgTeste.CheckedItems.Count.ToString()
                    , "Sim: " + rSim.Checked.ToString() + ", Não: " + rNao.Checked.ToString()).Show();
            }
        }
    Last edited by fabricio.murta; Apr 21, 2017 at 5:53 PM. Reason: solved
  2. #2
    Hello @banrisulssw!

    Your test case works fine for me both on IE11 and Chrome 56!

    On another topic, you can simplify your test case (easier for you and us) if you merge the code behind to the aspx page. It is easier both to copy and to run, as it is compiled at run-time (no need to rebuild the .aspx.cs over and over!).

    For example, like this:

    <%@ Page Language="C#" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
        }
    
        protected void btnSalvar_DirectClick(object sender, DirectEventArgs e)
        {
            var title = rgTeste.CheckedItems.Count.ToString();
            var message = "Sim: " + rSim.Checked.ToString() + ", Não: " + rNao.Checked.ToString();
            X.MessageBox.Alert(title, message).Show();
        }
    </script>
    
    <!DOCTYPE html>
    <html>
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ResourceManager ID="ResourceManager1" runat="server">
            </ext:ResourceManager>
            <ext:RadioGroup ID="rgTeste"
                runat="server"
                GroupName="rgTeste" 
                ColumnsNumber="1">
                <Items>
                    <ext:Radio ID="rSim" runat="server" BoxLabel="Sim" Checked="true" />
                    <ext:Radio ID="rNao" runat="server" BoxLabel="Nao" />
                </Items>
            </ext:RadioGroup>
            <ext:Button ID="btnSalvar" runat="server" Text="Testar" Icon="Disk">
                <DirectEvents>
                    <Click OnEvent="btnSalvar_DirectClick"></Click>
                </DirectEvents>
            </ext:Button>
        </form>
    </body>
    </html>
    The Page_Load() is not necessary, left it there just to illustrate that you can leave the Page_Load method there.

    Here's what I see when I interact with your test case:
    - on open, I click the "Testar" button:
    Click image for larger version. 

Name:	01-open_and_click.png 
Views:	75 
Size:	5.3 KB 
ID:	24891

    - switch the radio and click it again:
    Click image for larger version. 

Name:	02-change_and_click.png 
Views:	68 
Size:	5.3 KB 
ID:	24892

    Your test case seems simple enough to reproduce, so I felt like posting screenshots of the results should be best. The shots above look totally sane to me.

    Tried on both browsers mentioned on the beginning of the post and also both latest github development snapshot and NuGet (stock/stable) Ext.NET 4.2.0.

    Did you build your test case on the same major project you migrated to 4.2.0? Can you try running the test case on a fresh project installing Ext.NET from NuGet? There must be something else.
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Hello i did the test with a new application and the error persisted. We're using asp.net 4.0 and .net 4.0, is this relevant for you?
  4. #4
    Hello @banrisulssw!

    I could reproduce the issue by creating a clean project using .NET Framework 4.0.

    Well, for a quick workaround, you have the option to move to .NET 4.5 or newer, and it will work, but I doubt that's an option for you.

    Unfortunately we will need more investigation before we can find a definitive fix, or a workaround that would work for you.

    If you really need something working asap, I can suggest you bind events to the change and set the value on another field, like a checkbox or a hidden text field with the selected value. But that's just a palliative solution until something more definitive can be established.

    We have logged this issue under #1462 in our bugs tracker and will update here as soon as we have news (or fixed) it.
    Fabrício Murta
    Developer & Support Expert
  5. #5
    I upgraded the .net version to 4.5 and we still having the same trouble, can be something on web.config or packages.config?
  6. #6
    Hello again @banrisulssw!

    I've did a big mistake while trying your test case, sorry! This is really a bug that has been reported earlier when Ext.NET 4.2.0 was released!

    Good news is that we have this fixed in our latest github snapshot. The issue is still open just because there may be a race condition due to the changes in how the change event is triggered in radio groups -- something that's not the case in your use case!

    So, for the details:
    - This was reported in this forum thread: After Render RadioGroup Items reset the checked one
    - The issue is #1421
    - The problem with submission has been fixed (you can't imagine how many deja vu I felt while I was investigating the issue today!)
    - The problem still left is just if you trigger a direct event during a radio group's Change event (which gets into a race condition where it can submit the previous state instead of current)

    Bottom line is that the issue has nothing to do with .NET version nor fresh install. The bug is present in public 4.2.0 and has been partially fixed in our sources (so that you can benefit from the fix already).

    Sorry for the confusion. There are directions for another workaround on this if you look at the original bug report thread linked above, but it has a better suited fix in code already.

    As it was a mistake, I am now clearing the bug/issue references from this thread title and closing the non-actual github issue.
    Fabrício Murta
    Developer & Support Expert
  7. #7
    Ok, It's a bug.

    I didn't understand how to fix the problem until the new version of Ext be available. Can you help us with examples? In the case of the value not be passed to server side, and the incosistent checked valor (true/ false at same time).

    Thanks.
  8. #8
    Well easiest way would be downloading the latest github version, building it in release mode and then using the generated NuGet package with your project. Is that not an option for you?
    Fabrício Murta
    Developer & Support Expert
  9. #9
    ok! how do i download the latest github version? Can you explain us? Never used Github...
  10. #10
    Hello! Basically consists on using the git version control system. There are easier UI versions like github desktop. I believe it is fairly straightforward how to use it to just clone and work with any github repository (or local git repositories).

    Just remember for our repository you have read-only access, so you can pull new versions as often as you feel like but, if you make local commits, you won't be able to push them back to github.

    As for the addresses and specific instructions, I believe you have it all in the premium subscription emails you received the moment you purchased Ext.NET Premium subscription. If you don't have those mails anymore, drop us a message at support@ext.net and we can resend them with github instructions.

    I think this should help you with github desktop if you run into any problems setting up the repository on your side using it:
    - Getting started with GitHub Desktop

    You can use also Visual Studio's git integration if you like. At least down to VS2015, it was not perfect, but would work fine for readonly access.

    Commandline git also works for github. May require you to authenticate every time you fetch to check for updates unless you add a SSH key to your git set up. There are lots of documentation about commandline git over the web you can search for.

    Oh, and a Github account for your company would be required to gain access to the github repo, as we have it under limited (private) access.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 7
    Last Post: Jul 12, 2015, 4:46 PM
  2. [OPEN] [#425] radiogroup allowblank not working
    By SoftwareMHC in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Feb 05, 2014, 8:21 PM
  3. Replies: 2
    Last Post: Oct 10, 2012, 6:27 PM
  4. Replies: 2
    Last Post: Jul 11, 2011, 6:16 PM
  5. AjaxEvents stop working
    By Puia in forum 1.x Help
    Replies: 6
    Last Post: May 16, 2009, 5:27 PM

Tags for this Thread

Posting Permissions