[CLOSED] TextField Hide

  1. #1

    [CLOSED] TextField Hide

    Hi everybody,
    i have a trouble trying to hide a TextField in my Page.

    This is the Markup
    <ext:Button ID="BtnItaliano" runat="server" Text="Italiano" Icon="FlagIt">
        <Listeners>
            <Click Handler="Coolite.AjaxMethods.LinguaItaliano();" />
        </Listeners>
    </ext:Button>
    <ext:Button ID="BtnInglese" runat="server" Text="Inglese" Icon="FlagEngland">
        <Listeners>
            <Click Handler="Coolite.AjaxMethods.LinguaInglese();" />
        </Listeners>
    </ext:Button>
    
    
    
    
    <ext:TextField ID="TxtTitolo" runat="server"  />
    <ext:TextField ID="TxtTitoloEn" runat="server" Visible="false" />
    This is the Code Behind
    [AjaxMethod]
    public void LinguaInglese()
    {
        TxtTitolo.SetVisible(false);
        TxtTitoloEn.SetVisible(true);
    }
    
    [AjaxMethod]
    public void LinguaItaliano()
    {
        TxtTitoloEn.SetVisible(false);
        TxtTitolo.SetVisible(true);
    }
    This is my code, but pressing on the buttons, nothing changes...any suggests?
    I also try with TxtTitoloEn.Hide() but....nothing!

    Thanks,

  2. #2

    RE: [CLOSED] TextField Hide

    Hi Andrea,

    Change Visible="false" by Hidden="true" (just if you set Visible="false" then control is excluded form render and you can't manipulate it during ajax event)






    *

  3. #3

    RE: [CLOSED] TextField Hide

    Hi vladsh,
    i've done what you suggest but nothing change...I still can't manipulate the visibility during an AjaxMethod.
    I also try to omit the Hidden=true properties in the markup making my page display it and clicking on the button the AjaxMethods try to hide it but nothing...

    i've try:

    TxtTitolo.Hidden = True;
    TxtTitolo.Visible = False;
    TxtTitolo.Hide();
    TxtTitolo.SetVisible(false);

    but none of this works.
    Plase help,

    Thanks,
  4. #4

    RE: [CLOSED] TextField Hide

    Hi Andrea,

    Do you use latest version?
    Here is my test case which works fine:

    <%@ Page Language="C#" %>
    
    <%@ Import Namespace="System.Collections.Generic" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    
    
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Ext.IsAjaxRequest)
            {
    
            }
        }
    
        [AjaxMethod]
        public void LinguaInglese()
        {
            TxtTitolo.SetVisible(false);
            TxtTitoloEn.SetVisible(true);
        }
    
        [AjaxMethod]
        public void LinguaItaliano()
        {
            TxtTitoloEn.SetVisible(false);
            TxtTitolo.SetVisible(true);
        }
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server" />
        
            <ext:Button ID="BtnItaliano" runat="server" Text="Italiano" Icon="FlagIt">
                <Listeners>
                    <Click Handler="Coolite.AjaxMethods.LinguaItaliano();" />
                </Listeners>
            </ext:Button>
            <ext:Button ID="BtnInglese" runat="server" Text="Inglese" Icon="FlagEngland">
                <Listeners>
                    <Click Handler="Coolite.AjaxMethods.LinguaInglese();" />
                </Listeners>
            </ext:Button>
    
            <ext:TextField ID="TxtTitolo" runat="server"  />
            <ext:TextField ID="TxtTitoloEn" runat="server" Hidden="true" />
            
        </form>
    </body>
    </html>

  5. #5

    RE: [CLOSED] TextField Hide

    Thank u vladimir for your examples, it works but don't...:).
    I mean that my problem was caused by having a revision of dlls that had some problems with AjaxMethods.
    Upgrading to the latest revision version mine and your examples perfectly works.
    Please mark this as solved.

    Thanks a lot,
  6. #6

    RE: [CLOSED] TextField Hide

    Thanks for update*

Similar Threads

  1. [CLOSED] Focus TextField if Window Hide=true
    By macap in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 12, 2010, 1:59 PM
  2. [CLOSED] [1.0] Show/Hide textfield created runtime with listeners
    By PoloTheMonk in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 26, 2010, 10:57 AM
  3. hide textfield label
    By [WP]joju in forum 1.x Help
    Replies: 5
    Last Post: Dec 10, 2009, 11:11 PM
  4. Replies: 3
    Last Post: Jul 14, 2009, 7:02 AM
  5. [CLOSED] Can't hide TextField label
    By methode in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 02, 2009, 12:19 PM

Posting Permissions