Apr 21, 2012, 5:25 PM
Combo box event handler
Hello
I want to call a server side function when I change the value in a combo box. I cannot add event handler.
Note:
When I write this:
Thanks
I want to call a server side function when I change the value in a combo box. I cannot add event handler.
<ext:Window ID="Window1" runat="server" Collapsible="true" Icon="Application"
Title="Enter new player bio" Width="600" Height="400" Closable="False" Layout="FormLayout" Padding="7">
<Items>
<ext:ComboBox ID="ComboBox4" runat="server" FieldLabel="Bowling hand">
<Listeners>
<Change Handler="Ext.net.DirectMethods.hideControls();" />
</Listeners>
<Items>
<ext:ListItem Text="left" Value="left" />
<ext:ListItem Text="right" Value="right" />
<ext:ListItem Text="does not bowl" Value="does not bowl" />
</Items>
</ext:ComboBox>
</Items>
<Buttons>
<ext:Button ID="Button1" runat="server" Text="Submit">
<DirectEvents>
<Click OnEvent="func2" />
</DirectEvents>
</ext:Button>
</Buttons>
</ext:Window>
This is the script part:
<script runat="server">
[DirectMethod]
protected void hideControls(object sender, EventArgs e)
{
if (ComboBox4.SelectedItem.Value == "does not bowl")
{
ComboBox6.Visible = true;
}
else
{
ComboBox5.Visible = true;
}
}
</script>
Note:- The window is inside a desktop
- The web form also has a code behind file
Note:
When I write this:
<Focus Handler="Ext.net.DirectMethods.hideControls();" />
something happens...i cannot expand the combo box to see the values it hasThanks
Last edited by Shuaib; Apr 21, 2012 at 5:34 PM.