TooltipManager Pass values back and forth onAjaxUpdate

4 posts, 0 answers
  1. Sharbel Lutfallah
    Sharbel Lutfallah avatar
    26 posts
    Member since:
    Feb 2006

    Posted 02 Dec 2007 Link to this post

    What is the best way to pass values back and forth to onAjax update when using a ToolTipManager?  For example, in this sample : http://www.telerik.com/DEMOS/ASPNET/Prometheus/ToolTip/Examples/LoadOnDemand/DefaultCS.aspx the product data is loaded from what I can see as the index of the repeater/grid which might work for this example, but really wouldnt work for a real-world example.

    In my last task, the requirements were similar to the above, and I had a hidden field that I would update with the ProductID on click which woudl then be retrieved in the onAjaxUpdate event of the ToolTipManager.  It doesnt strike me as the best solution, but it does work.

    Question:  in the AjaxUpdate event, we can get the targetControlID which is the clientID but can get an actual reference to the control somehow?  My initial thoughts are to have the productID databound in each image button as the CommandArguement, so I would like to get a reference to the Image Button that triggered the window opening, grab the command arguement and populate the tooltip with the Usercontrol as per the sample.

    Any insight on how best to pass values or get references to controls inside the grids would be appreciated.
  2. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 06 Dec 2007 Link to this post

    Hi Sharbel Lutfallah,
    Actually, in the example you refer to, we set the ID of the images to the productID of the products. Thus, in the AjaxUpdate handler, we can use the ClientID of the images (e.TargetControlID) to get their ID, which is the productID. This approach should work in your case as well.

    I have attached a simple project, demonstrating how you can get a reference to an imagebutton (in a DataList) in the AjaxUpdate handler of the RadToolTIpManager. The basic idea is to use the ClientID of the imagebutton to find the index of the item, holding our target control, and then use the FindControl method for that item to get a reference to the imagebutton.

    I understand that having to make such calculations is not very intuitive, but we have on our TODO list the idea to add another overload of the Add method for the TargetControls collection that will receive a third parameter. This third parameter will then be available in the AjaxUpdate handler as another argument. Once we implement this, you will be able to pass the productID directly as an argument to the AjaxUpdate handler.

    Sincerely yours,
    Tsvetie
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Oliver
    Oliver avatar
    14 posts
    Member since:
    Nov 2007

    Posted 02 Feb 2008 Link to this post

    Hi Tsvetie,

    Was this TODO implemented?  I have the latest version of Prometheus, but I cannot see this additional parameter.

    Kind regards,

    Oliver
  4. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 04 Feb 2008 Link to this post

    Hi Oliver,
    No, this is not implemented in the current official version of the Prometheus suite. The feature is on the TODO list for Q1, scheduled for the middle of April.

    Greetings,
    Tsvetie
    the Telerik team

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