Show and Hide Panel with javascript in Chrome

  1. #1

    Show and Hide Panel with javascript in Chrome

    Hello!

    I've got some troubles with changing panel visibility:
    Chrome don't want to show panel (in FF & IE works fine)

    [javascript]
    		function setPasswordShow(show) {
    			try {
    				UserSetPassword_Panel.setVisible(show);
    				UserSetPassword_Button.setVisible(!show);
    			}
    			catch (e) { }
    		}
    [aspx]
    <ext:Button runat="server" 
    	ID="UserSetPassword_Button" IDMode="Static" 
    	Text="<%$ Resources:User_SetPassword %>">
    <Listeners>
    	<Click Handler="setPasswordShow(true);"/>
    </Listeners>	
    </ext:Button>
    
    <ext:Panel runat="server"
    	Layout="Form" Hidden="true"
    	ID="UserSetPassword_Panel" IDMode="Static" 
    	Title="<%$ Resources:User_SetPassword %>" >
    	<Items>
    		<ext:TextField runat="server" 
    			InputType="Password"
    			ID="UserPassword1_TB" IDMode="Static" 
    			FieldLabel="<%$ Resources:User_Password %>"
    			LabelStyle="width:150px;" Width="300px" AllowBlank="false">
    		</ext:TextField>
    	</Items>
    </ext:Panel>
  2. #2
    Hi Paul,

    Your code appears to be configured correctly.

    Can you post a full (but simplified) .aspx code sample demonstrating how you have the page configured. Start with a simple example demonstrating these two components.
    Geoffrey McGill
    Founder & CEO
  3. #3
    Quote Originally Posted by geoffrey.mcgill View Post
    Hi Paul,

    Your code appears to be configured correctly.

    Can you post a full (but simplified) .aspx code sample demonstrating how you have the page configured. Start with a simple example demonstrating these two components.
    Hello, Geoffrey

    My code is a part of bigger page hierarchy:
    - Master page with Viewport
    - Central part contains ContentPlaceHolder
    - Child page consist of 2 columns of ColumnLayout
    - Right column contains TabPanel
    - First tab contains code i wrote before

    PS:
    BTW, Accordion Layout is strange thing too, I wrote another trouble here:
    http://forums.ext.net/showthread.php...4207#post44207
  4. #4
    Double check that "UserSetPassword_Panel" is the client-side ID of the component. The client-side and server-side ID's may (will) be different.

    The client-side ID is the same as the .ClientID property.
    Last edited by geoffrey.mcgill; Nov 11, 2010 at 6:12 AM.
    Geoffrey McGill
    Founder & CEO
  5. #5
    Quote Originally Posted by geoffrey.mcgill View Post
    Double check that "UserSetPassword_Panel" is the client-side ID of the component. The client-side and server-side ID's may (will) be different.

    The client-side ID is the same as the .ClientID property.
    It works fine in FF and IE, but not in Chrome. An attribute "IDMode" for the "UserSetPassword_Panel" is set to "Static", so client-side ID should be the same.
  6. #6
    Sorry, but I was unable to reproduce this problem in Chrome.

    Here's what I was testing with.

    Example

    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
     
    <!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>Ext.NET Example</title>
        
        <script type="text/javascript">
            var setPasswordShow = function (show) {
                try {
                    Panel1.setVisible(show);
                    Button1.setVisible(!show);
                } catch (e) { }
            };
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
             
            <ext:Button 
                ID="Button1" 
                runat="server"
                IDMode="Static"
                Text="Set Password">
                <Listeners>
                    <Click Handler="setPasswordShow(true);"/>
                </Listeners>  
            </ext:Button>
     
            <ext:Panel 
                ID="Panel1" 
                runat="server"
                Layout="Form" 
                Hidden="true"
                IDMode="Static"
                Title="Set Password" >
                <Items>
                    <ext:TextField 
                        ID="TextField1" 
                        runat="server"
                        InputType="Password"
                        IDMode="Static"
                        FieldLabel="Password"
                        Width="300px" 
                        AllowBlank="false"
                        />
                </Items>
            </ext:Panel>
        </form>
    </body>
    </html>
    Geoffrey McGill
    Founder & CEO

Similar Threads

  1. [CLOSED] TabPanel Show/Hide Panel
    By amitpareek in forum 2.x Premium Help
    Replies: 5
    Last Post: Jul 02, 2012, 3:21 PM
  2. Replies: 2
    Last Post: Dec 19, 2011, 1:53 PM
  3. Replies: 5
    Last Post: May 05, 2011, 7:05 PM
  4. [CLOSED] Show Hide Grid Panel from runtime
    By rnachman in forum 1.x Premium Help
    Replies: 4
    Last Post: Feb 23, 2011, 6:32 PM
  5. How to hide/show ImageButton in JavaScript?
    By dbassett74 in forum 1.x Help
    Replies: 2
    Last Post: Jun 16, 2009, 3:47 PM

Tags for this Thread

Posting Permissions