RadToolTip: code sample requested for showEvent="FromCode"

13 posts, 1 answers
  1. Lina
    Lina avatar
    30 posts
    Member since:
    Jan 2008

    Posted 29 Jan 2008 Link to this post

    Hi,

    Can you give a simple code sample using the showEvent="FromCode" property?  I didn't find any documentation on using showEvent with this option and  I don't see any method called show().

    In my app, when some data changes, I want to show a tooltip informing the user of the change (kind of like a new mail alert from outlook).  So I need to programatically show the tooltip as opposed to the user focusing on a control.

    Thanks,
    Lina
  2. Fabio Wada
    Fabio Wada avatar
    9 posts
    Member since:
    Aug 2005

    Posted 30 Jan 2008 Link to this post

    Hi Lina,

    Try this code:

    function showMyToolTip() { 
      var tooltip = $find("<%=myToolTip.ID%>"); 
      tooltip.show(); 

    In this link there are others methods:
    http://www.telerik.com/help/radcontrols/prometheus/tooltip_RadToolTip_client_object.html


    Fabio Wada
  3. Lina
    Lina avatar
    30 posts
    Member since:
    Jan 2008

    Posted 30 Jan 2008 Link to this post

    Hi Fabio,

    Thanks for responding.  I am looking for server side code.  Is there a way to show the tooltip from codebehind?

    Thanks,
    Lina
  4. Fabio Wada
    Fabio Wada avatar
    9 posts
    Member since:
    Aug 2005

    Posted 30 Jan 2008 Link to this post

    Hi Lina,

    You can use script injection. I didn't find other way.

    private void Button1_Click( object  sender, System.EventArgs e) {
      InjectScript.Text= "<script>showMyToolTip()</" + "script>";
    }


    Fabio Wada.

  5. Fabio Wada
    Fabio Wada avatar
    9 posts
    Member since:
    Aug 2005

    Posted 30 Jan 2008 Link to this post

    Hi Lina,

    You can use script injection. I didn't find other way.

    private void Button1_Click( object  sender, System.EventArgs e) {
      InjectScript.Text= "<script>showMyToolTip()</" + "script>";
    }


    Fabio Wada.

  6. Lina
    Lina avatar
    30 posts
    Member since:
    Jan 2008

    Posted 30 Jan 2008 Link to this post

    Hi Fabio,

    I was able to show the tooltip by injecting this:

    InjectScript.Text = "<script type='text/javascript'>Sys.Application.add_load(function(){showMyToolTip()})</" + "script>";    

    In my code I have a RadAjaxPanel in which there is a Timer, the RadToolTip and the InjectScript label.  If I create Button1 outside the panel the javascript method is called and the tooltip shows.  If I move the button into the panel the javascript method is no longer called.

    Any ideas why this is happening?

    Eventually I need to show the tooltip from the method that is called by the Timer, hence I need the tooltip to work when it is invoked from inside the Panel.

    Thanks,
    Lina

  7. Answer
    Fabio Wada
    Fabio Wada avatar
    9 posts
    Member since:
    Aug 2005

    Posted 31 Jan 2008 Link to this post

    Hi Lina,

    If you are using RadAjaxPanel, so you can use this code to show the tool tip from button inside the RadAjaxPanel. The label injection script doesn't work called from RadAjaxPanel.

    protected void Button1_Click(object sender, EventArgs e) { 
      RadAjaxPanel1.ResponseScripts.Add("showMyToolTip();"); 


    I hope that this code help you.
    Fabio Wada
  8. Tervel
    Admin
    Tervel avatar
    1337 posts

    Posted 31 Jan 2008 Link to this post

    Hello,

    FYI, for Q1 2008 release we plan some handy new features to RadToolTip that will make it even easier to use.
    One such thing is to add a server-side Show method.
    For the time being the approach taken is the right one.

    Best regards,
    Tervel
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  9. Lina
    Lina avatar
    30 posts
    Member since:
    Jan 2008

    Posted 31 Jan 2008 Link to this post

    Thanks Fabio, that worked!
  10. Lina
    Lina avatar
    30 posts
    Member since:
    Jan 2008

    Posted 31 Jan 2008 Link to this post

    Hi Tervel,  looking forward to the new features and thanx for the update.
  11. Mark
    Mark avatar
    13 posts
    Member since:
    Apr 2008

    Posted 08 Apr 2008 Link to this post

    I dont seem to be able to get this to work.

    I want to launch a RadToolTipManager through server side.  Is this possible? 

    The closest I have got is using a RadAjax panel example above but i get "null is null or not an object"

    function

    showMyToolTip() {

    $find("<%=RadToolTipManager1.ClientID %>").get_tooltips()[0].show();
    }

    I have also tried the inject script example but that doesnt even call my javascript function.

    Thanks

    Mark

  12. Mark
    Mark avatar
    13 posts
    Member since:
    Apr 2008

    Posted 08 Apr 2008 Link to this post

    Just to add to the last post.

    What i am trying to eventually achieve with this is a tooltip of validation errors.  So I have radtextboxes etc which ajax back and validate.  If there is a problem with the validation the error is stored in session, the codebehind then shows the tool tip manager (which is using a user control 

    Control

    ctrl = Page.LoadControl("ToolTip.ascx");

    panel.ContentTemplateContainer.Controls.Add(ctrl);

    )

    This user control then reads from the session and displays a lit of all validation errors on the page.  I want the tooltip to scroll up and down the page as the user does.  What would be nice is if i could also put a link in the user control against the error.  When the user selects the link it takes the user to where the validation error is on the page.

    I realise I might trying to take the control a little to far but should this be feasible.

    Thanks

  13. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 10 Apr 2008 Link to this post

    Hi Mark,

    Your code seems fine and if you get "null" for the RadToolTipManager, I would suggest to call the function with a small timeout. If this doesn't fix the problem, please open a support ticket and send us a small sample project which isolates the behavior that you experience. We will check it and do our best to help.


    Sincerely yours,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top