Jan 25, 2017, 11:06 AM
[OPEN] [#1423] [4.2.0] RadioGroup issue
Hello,
I upgraded to 4.2, but I am facing a new problem, I have a window that contains a radiogroup to choose language and I have to put a listener on change on radiogroup , I tried two methods in a javascript funtion to get the checked value in this radiogroup (as seen in example below) but in the first method the checked input value is not true and it is not taking the checked one and in the second method I am retrieving that the two radio buttons are checked (using ".checked" which is always true) which is also wrong.
this is a weird behaviour in 4.2, it didn't exist in 4.1.
Here is the example:
Also note that if I am updating or rendering a container that contains a radiogroup, the checked one will be unchecked, in 4.1 on updating or rendering a container the checked one is not lost.
Thank you
I upgraded to 4.2, but I am facing a new problem, I have a window that contains a radiogroup to choose language and I have to put a listener on change on radiogroup , I tried two methods in a javascript funtion to get the checked value in this radiogroup (as seen in example below) but in the first method the checked input value is not true and it is not taking the checked one and in the second method I am retrieving that the two radio buttons are checked (using ".checked" which is always true) which is also wrong.
this is a weird behaviour in 4.2, it didn't exist in 4.1.
Here is the example:
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html>
<html>
<head runat="server">
<title>Simple Array Grid With Paging and Remote Reloading - Ext.NET Examples</title>
<link href="/resources/css/examples.css" rel="stylesheet" />
<script type="text/javascript">
function ChangeInterfaceLanguage()
{
//First Method
var language = App.RadioGroup2.getChecked()[0].inputValue;
alert(language);
//Second method
language = App.Arabic.checked;
alert(language);
language = App.English.checked;
alert(language);
}
</script>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />
<ext:Window
ID="Window1"
runat="server"
Closable="false"
Resizable="false"
Height="200"
Icon="Lock"
Title="Login"
Draggable="false"
Width="350"
Modal="false"
BodyPadding="5"
Layout="FormLayout"
Y="320"
Region="Center" >
<Items>
<ext:TextField
ID="txtUsername"
runat="server"
FieldLabel="UserName"
AllowBlank="false"
BlankText="Your username is required."
LabelCls="LabelStyle"
>
<Listeners>
<SpecialKey Handler="
if (e.getKey() == e.ENTER) {
e.stopEvent();
App.Button1.fireHandler();
}
">
</SpecialKey>
</Listeners>
</ext:TextField>
<ext:TextField
ID="txtPassword"
runat="server"
InputType="Password"
FieldLabel="Password"
AllowBlank="false"
BlankText="Your password is required."
LabelCls="LabelStyle"
autocomplete="new-password"
>
<Listeners>
<SpecialKey Handler="
if (e.getKey() == e.ENTER) {
e.stopEvent();
App.Button1.fireHandler();
}
">
</SpecialKey>
</Listeners>
</ext:TextField>
<ext:RadioGroup
ID="RadioGroup2"
runat="server"
GroupName="RadioGroup2"
ColumnsWidths="200,200">
<Items>
<ext:Radio runat="server" ID="Arabic" LabelAlign="Right" BoxLabel="عربي" InputValue="ar" Checked="True"/>
<ext:Radio runat="server" ID="English" LabelAlign="Right" BoxLabel="English" InputValue="en" />
</Items>
<Listeners>
<Change Handler="ChangeInterfaceLanguage()" />
</Listeners>
</ext:RadioGroup>
</Items>
<Buttons>
<ext:Button ID="Button1" runat="server" MinWidth="150" Text="Login" Icon="Accept">
<Listeners>
<Click Handler="VerifyCredentials()">
</Click>
</Listeners>
</ext:Button>
</Buttons>
</ext:Window>
</form>
</body>
</html>
Also note that if I am updating or rendering a container that contains a radiogroup, the checked one will be unchecked, in 4.1 on updating or rendering a container the checked one is not lost.
Thank you
Last edited by Geovision; Jan 25, 2017 at 11:10 AM.