PDA

View Full Version : [CLOSED] Radiogroup problem in upgrade from 2.3 to 2.4



rcombis
Jan 24, 2014, 12:57 AM
I have a bunch of radiogroups that have ext:radio as their children. This is an example below.


<ext:RadioGroup ID="rbgGender" runat="server" ColumnsNumber="1" Layout="VBoxLayout">
<Items>
<ext:Radio ID="rbGenderMale" runat="server" BoxLabel="Male" InputValue="1" Height="13" />
<ext:Radio ID="rbGenderFemale" runat="server" BoxLabel="Female" InputValue="2" Height="13" />
<ext:Radio ID="rbGenderDefault" runat="server" BoxLabel="Both" InputValue="0" Checked="true" Height="13" />
</Items>
<DirectEvents>
<Change OnEvent="markAsOutOfSync" />
</DirectEvents>
</ext:RadioGroup>

The markAsOutOfSync directEvent looks at the values and sends info back to browser letting user know what selection they choose. Sort of like a summary view.

In this direct event I use:


.GenderType = rbgGender.CheckedItems(0).InputValue

and then I do something with that returned value.

With 2.3 this worked fine.

In 2.4 rbgGender.CheckedItems has all the values of ALL checkedItems in any radiogroup. (I have 12 or so RadioGroups) So the count of checkedItems for rbgGender returns 12, when it really is only 1.

Why is this happening?

Thanks,
Rob

Daniil
Jan 24, 2014, 3:46 AM
Hi Rob,

I cannot reproduce with the example below and have no idea why it might behave how you described. Please provide a full test case.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html>
<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:RadioGroup ID="RadioGroup1" runat="server" ColumnsNumber="1" FieldLabel="RadioGroup1">
<Items>
<ext:Radio ID="Radio1" runat="server" BoxLabel="Male" InputValue="1" />
<ext:Radio ID="Radio2" runat="server" BoxLabel="Female" InputValue="2" />
<ext:Radio ID="Radio3" runat="server" BoxLabel="Both" InputValue="0" Checked="true" />
</Items>
<DirectEvents>
<Change OnEvent="OnChange" />
</DirectEvents>
</ext:RadioGroup>

<ext:RadioGroup ID="RadioGroup2" runat="server" ColumnsNumber="1" FieldLabel="RadioGroup2">
<Items>
<ext:Radio ID="Radio4" runat="server" BoxLabel="Male" InputValue="1" />
<ext:Radio ID="Radio5" runat="server" BoxLabel="Female" InputValue="2" />
<ext:Radio ID="Radio6" runat="server" BoxLabel="Both" InputValue="0" Checked="true" />
</Items>
<DirectEvents>
<Change OnEvent="OnChange" />
</DirectEvents>
</ext:RadioGroup>
</form>
</body>
</html>

rcombis
Jan 24, 2014, 4:17 PM
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="test_radio_group.aspx.vb" Inherits="blueOcean.test_radio_group" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<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" />
<div>
<ext:RadioGroup ID="RadioGroup1" runat="server" ColumnsNumber="1" FieldLabel="RadioGroup1">
<Items>
<ext:Radio ID="Radio1" runat="server" BoxLabel="Male" InputValue="1" />
<ext:Radio ID="Radio2" runat="server" BoxLabel="Female" InputValue="2" />
<ext:Radio ID="Radio3" runat="server" BoxLabel="Both" InputValue="0" Checked="true" />
</Items>
<DirectEvents>
<Change OnEvent="OnChange" />
</DirectEvents>
</ext:RadioGroup>

<ext:RadioGroup ID="RadioGroup2" runat="server" ColumnsNumber="1" FieldLabel="RadioGroup2">
<Items>
<ext:Radio ID="Radio4" runat="server" BoxLabel="Male" InputValue="1" />
<ext:Radio ID="Radio5" runat="server" BoxLabel="Female" InputValue="2" />
<ext:Radio ID="Radio6" runat="server" BoxLabel="Both" InputValue="0" Checked="true" />
</Items>
<DirectEvents>
<Change OnEvent="OnChange" />
</DirectEvents>
</ext:RadioGroup>

<ext:DisplayField ID="dfGroup1" runat="server" FieldLabel="Group 1 Count" />
<ext:DisplayField ID="dfGroup2" runat="server" FieldLabel="Group 2 Count" />
</div>
</form>
</body>
</html>

Code Behind


Imports Ext.Net

Public Class test_radio_group
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

End Sub

Public Sub onChange(sender As Object, e As DirectEventArgs)
dfGroup1.Text = RadioGroup1.CheckedItems.Count.ToString
dfGroup2.Text = RadioGroup2.CheckedItems.Count.ToString
End Sub
End Class

This test case shows that the checked items count for each radiogroup as 2, when it should be 1.

Happened when I went from 2.3 to 2.4

Let me know if you need any more info

rcombis
Jan 24, 2014, 8:06 PM
CheckboxGroup acting in the exact same way.

When you pull a count of the checked items for a CheckBox Group it is counting all the checked items from all of the CheckBoxGroups on the page.

Why is this happening?

geoffrey.mcgill
Jan 25, 2014, 12:15 AM
Why is this happening?

It might be a defect.

We are investigating.

Vladimir
Jan 25, 2014, 7:55 AM
I cannot reproduce it with latest code
May be it is fixed already
Try to update from SVN and retest

rcombis
Jan 25, 2014, 8:59 PM
I cannot reproduce it with latest code
May be it is fixed already
Try to update from SVN and retest

I downgraded to 2.3 and everything is working again.

I do my updates through NuGet, so probably won't update to latest build from SVN.

Can you kindly update this thread when problem is fixed in your main 2.4 release.

Thanks,
Rob

Vladimir
Jan 25, 2014, 9:05 PM
Sorry but we don't change official releases
Please update from SVN or wait next release

rcombis
Jan 25, 2014, 11:09 PM
Sorry but we don't change official releases
Please update from SVN or wait next release

Your official release has an error.

Why would you not fix that?

geoffrey.mcgill
Jan 26, 2014, 2:03 AM
Why would you not fix that?

The fix would be added to Svn, which appears to be working correctly with your sample.

What's in Svn will become part of the next official release (2.5.0).

Daniil
Jan 27, 2014, 5:39 AM
I cannot reproduce the issue with the v2.4 release installed via NuGet.