PDA

View Full Version : [CLOSED] RadioGroup stop working!



banrisulssw
Mar 27, 2017, 3:15 PM
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.ToSt ring()
, "Sim: " + rSim.Checked.ToString() + ", Não: " + rNao.Checked.ToString()).Show();
}
}

fabricio.murta
Mar 27, 2017, 6:21 PM
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:
24891

- switch the radio and click it again:
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.

banrisulssw
Mar 28, 2017, 7:52 PM
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?

fabricio.murta
Mar 29, 2017, 10:08 PM
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 (https://github.com/extnet/Ext.NET/issues/1462) in our bugs tracker and will update here as soon as we have news (or fixed) it.

banrisulssw
Mar 30, 2017, 8:55 PM
I upgraded the .net version to 4.5 and we still having the same trouble, can be something on web.config or packages.config?

fabricio.murta
Mar 30, 2017, 10:31 PM
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 (https://forums.ext.net/showthread.php?61722)
- The issue is #1421 (https://github.com/extnet/Ext.NET/issues/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.

banrisulssw
Mar 31, 2017, 7:35 PM
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.

fabricio.murta
Mar 31, 2017, 11:31 PM
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?

banrisulssw
Apr 03, 2017, 7:50 PM
ok! how do i download the latest github version? Can you explain us? Never used Github...

fabricio.murta
Apr 03, 2017, 8:34 PM
Hello! Basically consists on using the git version control system. There are easier UI versions like github desktop (https://desktop.github.com/). 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 (https://help.github.com/desktop/guides/getting-started/)

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!

banrisulssw
Apr 05, 2017, 1:12 PM
Ok, thanks Fabricio! I've sent an email to support@ext.net yesterday morning and still waiting for the answer.

geoffrey.mcgill
Apr 05, 2017, 5:44 PM
Hello. Your email was received, and a response was sent, but I see now that it was rejected by your mail server and bounced back.


The response from the remote server was:
555 5.7.1 <----------_---_------@--------.com.br>: Recipient address rejected: Falha no teste SPF. Este seu servidor 999.99.999.99 nao consta em seu DNS como autorizado a enviar e-mails em nome do seu dominio. Corrija este registro (txt v=spf1) em seu DNS e retransmita a mensagem. Repasse esta mensagem para o seu suporte de TI.

Please resend your request from an email address that can accept replies.

banrisulssw
Apr 07, 2017, 8:18 PM
Hello, i did what you said and did not work. I genereated a package from the master branch using the .bat, created a new Project and added the references , and the error persisted.

fabricio.murta
Apr 07, 2017, 9:15 PM
Hello @banrisulssw!

I don't remember saying anything about .bat. If you had to manually run a batch file, that is a potential reason no package would be created at all.

You should get NuGet packages dumped off a Release configuration Build. When you first open the solution, it opens in the Debug configuration. Switch that to Release and build. It should take some time and then dump the NuGet packages under src/bin/NuGet.

And then you should set up your NuGet package manager to search that directory or copy over and extract the corresponding .nupkg file to your project solution's packages folder.

Or, forget about the NuGet package and do it the hard way, manually copying over the generated DLL files once you build the project.

I consistently cannot reproduce the issue here when using github Ext.NET. I don't think there's any difference, but are you using the short version test case suggested here (https://forums.ext.net/showthread.php?61831&p=281538&viewfull=1#post281538)?

banrisulssw
Apr 10, 2017, 2:49 PM
Yes, i'm using your test case. Even installling the nuget package, the radio button still not working. I'll rollback the Ext.Net version from our Project, please let me know when the issue is solved. Thanks for the help.

fabricio.murta
Apr 10, 2017, 4:46 PM
Hello @banrisulssw!

Yes, you're actually right! For some reason the fix didn't make it to the generated NuGet package from sources! I'm investigating this right now and will keep you posted!

fabricio.murta
Apr 10, 2017, 5:15 PM
Ops! My bad! Seems I didn't switch the default project in the solution I created, so I was using stock nuget version by mistake. :)

Something that may just have happened to you, maybe?.. I mean, maybe if you installed the NuGet package to a fresh project in the same solution, it won't download it again if the version and package name is the same. To me, I was using the "Ext.NET.MVC" so on the new package I just used "Ext.NET.MVC5" and it ensured the new package was pulled off local repository.

Anyway, I've just pushed a change in Ext.NET to version the DLL and NuGet package after 4.2.1-current, so it won't conflict with public NuGet packages. Just pull the changes, rebuild, and make sure you check the "enable prerelease" checkbox on your NuGet package manager so the 4.2.1-current version is shown.

So, yes, it worked on the NuGet package locally generated, I'm positive this should have been this version mistake issue.

Using the NuGet packages pulled out from sources.

24905

(side note: the version overall in the project will still read 4.2.0 -- client-side, on readmes... these are changed when a new version is actually released)

banrisulssw
Apr 11, 2017, 3:20 PM
Awesome, it's working now, thanks Murta

fabricio.murta
Apr 11, 2017, 7:02 PM
Hello @banrisulssw!

Glad to know that it worked! But still curious, was it then the NuGet package version conflicting with the published one? You just pulled from github and used the "prerelease" version then?