Tooltip and IDMode="Explicit"

  1. #1

    Tooltip and IDMode="Explicit"

    Example:

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication2.Default" %>
    
    <!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></title>
    </head>
    <body>
        <ext:ResourceManager runat="server" IDMode="Explicit"/>
        <ext:FormPanel runat="server" Title="Test from" Width="300">
            <Items>
                <ext:TextField runat="server" FieldLabel="Required field" AllowBlank="false" BlankText="This field is required!">
                    <ToolTips>
                        <ext:ToolTip runat="server" Html="required field" />
                    </ToolTips>
                </ext:TextField>
            </Items>
        </ext:FormPanel>
    </body>
    </html>
    If TextField control not specify ID property then tooltip not showing. Tooltip generated with config option 'target' with autogenerated clientId of TextField control, but TextField control not have id.

    I want to ask this behavior is intended? Because I try not to specify ID property when not in use.
  2. #2
    Hi,

    Well, if we don't render an id (it happens when IDMode="Explicit" and no .ID), so we can't know anything about client id of component - it will be auto-generated on client side (on ExtJS level).

    I can suggest you the following solution:

    Example
    <%@ Page Language="C#" %>
    
    <!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>
    </head>
    <body>
        <ext:ResourceManager runat="server" IDMode="Explicit" />
        <ext:TextField runat="server" Text="Give me a mouse">
            <Listeners>
                <AfterRender Handler="new Ext.ToolTip({ target : this.id, html: 'Hello!' });" />
            </Listeners>
        </ext:TextField>
    </body>
    </html>
  3. #3
    Thanks for the reply.

    I understand the reason for this behavior. But I think that if the component is specified tooltip, then this component should be the property ID is generated regardless of the Explicit IDMode.
  4. #4
    Sure, we will consider this feature request.
  5. #5
    The feature ticket has been created.
    https://extnet.lighthouseapp.com/pro...res/tickets/94
  6. #6
    Quote Originally Posted by Daniil View Post
    The feature ticket has been created.
    https://extnet.lighthouseapp.com/pro...res/tickets/94
    I use following tool tips for image control as well as label. It works fine thanks for the hint Daniil

     <ext:Image ID="ImgProfileImage" TagString="Profile image" runat="server">
      <Listeners>
         <AfterRender Handler="new Ext.ToolTip({ target : this.id, html: 'Hello!' });" />
      </Listeners>
    </ext:Image>
    
     <ext:Label ID="lblFirstName" runat="server">
       <Listeners>
             <AfterRender Handler="new Ext.ToolTip({ target : this.id, html: 'Hello!' });" />
       </Listeners>
                                      
     </ext:Label>

Similar Threads

  1. [CLOSED] How does "MaskCls" work for "AutoLoad" mask in panel control
    By leon_tang in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jul 19, 2012, 12:09 PM
  2. Replies: 1
    Last Post: Jun 26, 2012, 11:29 AM
  3. Replies: 5
    Last Post: May 02, 2012, 5:37 PM
  4. Replies: 4
    Last Post: Oct 11, 2011, 2:42 AM
  5. Replies: 2
    Last Post: Jun 26, 2011, 1:59 AM

Tags for this Thread

Posting Permissions