[CLOSED] CycleButton inside of FormPanel ActiveItem does not change

  1. #1

    [CLOSED] CycleButton inside of FormPanel ActiveItem does not change

    I have a CycleButton inside of a FormPanel and when you click the Button, inside the DirectChange event, the ActiveItem does not change accordingly. It works fine as long as it is not inside of a FormPanel.

    <%@ Page Title="" Language="vb" AutoEventWireup="false" CodeBehind="CycleButton.aspx.vb" Inherits="Adhesion.Web.CycleButtonTest" %>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Ext.Net Example</title>
    
        <script type="text/javascript">
     
        </script>
     </head>
    <body>
        <form id="Form1" runat="server">
     
            <ext2:ResourceManager ID="ResourceManager" runat="server" />
    
            <ext2:FormPanel ID="fpUserActionSettings" runat="server" Border="false" LabelWidth="150"
                Cls="bold-form-labels" StyleSpec="padding-top:10px">
                <Items>
                    <ext2:CycleButton ID="CycleButtonContext" runat="server" ShowText="true" Height="34" width="100" >
                        <Menu>
                            <ext2:Menu ID="MenuCycleButton" runat="server">
                                <Items>
                                    <ext2:CheckMenuItem ID="miClient" runat="server" Text="Client" Icon="User" Checked="true">
                                        <DirectEvents>
                                            <Click OnEvent="ContextSelect">
                                                <ExtraParams>
                                                    <ext2:Parameter Name="name" Value="Client" Mode="Value" />
                                                </ExtraParams>
                                            </Click>
                                        </DirectEvents>
                                    </ext2:CheckMenuItem>
                                    <ext2:CheckMenuItem ID="miSecurity" runat="server" Text="Security" Icon="ChartLine">
                                        <DirectEvents>
                                            <Click OnEvent="ContextSelect">
                                                <ExtraParams>
                                                    <ext2:Parameter Name="name" Value="Security" Mode="Value" />
                                                </ExtraParams>
                                            </Click>
                                        </DirectEvents>
                                    </ext2:CheckMenuItem>
                                </Items>
                            </ext2:Menu>
                        </Menu>
                    </ext2:CycleButton>
                </Items>
            </ext2:FormPanel>
        
        </form>
    </body>
    </html>
    Imports Ext.Net
    Public Class CycleButtonTest
    
        Inherits System.Web.UI.Page
    
        Private Sub LoadActions(ByVal id As String)
            ' do some stuff
        End Sub
    
        <DirectMethod()>
        Public Sub ContextSelect(sender As Object, e As DirectEventArgs)
            LoadActions(sender.ID)
        End Sub
    
        Private Sub CycleButtonContext_DirectChange(sender As Object, e As DirectEventArgs) Handles CycleButtonContext.DirectChange
            Ext.Net.X.Msg.Show(New Ext.Net.MessageBoxConfig With {
                               .Title = "Critical",
                               .Message = sender.ActiveItem.Text,
                               .Buttons = MessageBox.Button.OK,
                               .Icon = MessageBox.Icon.ERROR
                               })
        End Sub
    End Class
    Last edited by Daniil; Mar 20, 2014 at 4:51 PM. Reason: [CLOSED]
  2. #2
    Hi @rmelancon,

    It works for me. Please clarify what Ext.NET version are you using?
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @rmelancon,

    It works for me. Please clarify what Ext.NET version are you using?
    This is in Version 2.5.0.24049
  4. #4
    Ok. It appears that it doesn't work if a Menu is not shown yet. I see the same behavior regardless a CycleButton is inside a FormPanel or not.

    I would try to force rendering of Menu.
    <ext:CycleButton>
        <Listeners>
            <AfterRender Handler="this.showMenu(); this.hideMenu();" />
        </Listeners>
    </ext:CycleButton>
  5. #5
    That works. Thanks.

Similar Threads

  1. [CLOSED] Change the text property of a menuitem (cyclebutton)
    By blueworld in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Oct 16, 2012, 11:05 AM
  2. Replies: 2
    Last Post: Sep 21, 2010, 11:14 AM
  3. [CLOSED] How to set the initial ActiveItem of a CycleButton
    By macap in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Sep 08, 2010, 10:09 AM
  4. Replies: 5
    Last Post: Mar 05, 2010, 5:08 AM
  5. [CLOSED] Icon is not showed with the ActiveItem using CycleButton
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Mar 05, 2010, 4:45 AM

Posting Permissions