This is a migrated thread and some comments may be shown as answers.

RadToolTip: code sample requested for showEvent="FromCode"

12 Answers 447 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Lina
Top achievements
Rank 1
Lina asked on 29 Jan 2008, 05:20 PM
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

12 Answers, 1 is accepted

Sort by
0
Fabio Wada
Top achievements
Rank 1
answered on 30 Jan 2008, 06:43 PM
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
0
Lina
Top achievements
Rank 1
answered on 30 Jan 2008, 08:03 PM
Hi Fabio,

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

Thanks,
Lina
0
Fabio Wada
Top achievements
Rank 1
answered on 30 Jan 2008, 08:26 PM
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.

0
Fabio Wada
Top achievements
Rank 1
answered on 30 Jan 2008, 08:26 PM
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.

0
Lina
Top achievements
Rank 1
answered on 30 Jan 2008, 09:44 PM

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

0
Accepted
Fabio Wada
Top achievements
Rank 1
answered on 31 Jan 2008, 11:46 AM
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
0
Tervel
Telerik team
answered on 31 Jan 2008, 12:27 PM
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
0
Lina
Top achievements
Rank 1
answered on 31 Jan 2008, 02:35 PM
Thanks Fabio, that worked!
0
Lina
Top achievements
Rank 1
answered on 31 Jan 2008, 02:37 PM
Hi Tervel,  looking forward to the new features and thanx for the update.
0
Mark
Top achievements
Rank 1
answered on 08 Apr 2008, 03:41 PM
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

0
Mark
Top achievements
Rank 1
answered on 08 Apr 2008, 03:55 PM
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

0
Georgi Tunev
Telerik team
answered on 10 Apr 2008, 03:23 PM
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
Tags
ToolTip
Asked by
Lina
Top achievements
Rank 1
Answers by
Fabio Wada
Top achievements
Rank 1
Lina
Top achievements
Rank 1
Tervel
Telerik team
Mark
Top achievements
Rank 1
Georgi Tunev
Telerik team
Share this question
or