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

How do I pass values to the service?

9 Answers 98 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
sitefinitysteve asked on 20 Sep 2010, 02:59 PM
I want to have a toggle button decide which rotator items get sent into the control...

Now looking at the clientside functions I think I could do it manually by adding items, but since it's already got the service functionality built in I'd love to just leverage that...

Steve

9 Answers, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 23 Sep 2010, 01:10 PM
Hi Steve,

As I have already answered your support ticket, the only solution is to use a Session variable in order to pass additional values to the WebService's method. This solution, however, will not work if the RadRotator control is declared in the ItemTemplate of a databound control.

Sincerely yours,
Fiko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 23 Sep 2010, 01:48 PM
Hmmm, I don't seem to have any tickets that mention this :)

Session won't work as the buttons are clientside and the Rotator is set to WebService binding.  There are other controls like the scheduler which allow me to PASS values into the service to use, but I dont see anything in the rotator that will let me attach clientside parameters to consume with the service.

Therefore the only thing I can think of is to use a RadXmlHttpPanel, then manually populate the rotator (which is not only a pain, but adds an extra control when I'm trying to keep the page lean).
0
Fiko
Telerik team
answered on 28 Sep 2010, 01:08 PM
Hi Steve,

"Hmmm, I don't seem to have any tickets that mention this :)"
I apologize, this was my mistake :).


In reference to your question:
Unfortunately, the requested client-side functionality does not exist and for the time being you can change the service only on the server. to do that, I recommend you to wrap the control and the buttons in an RadAjaxPanel (or use a RadAjaxManager in order to implement your scenario) and then change the RadRotator's WebService settings in the Button's Click server-side event. In this case you can assign a Session value and then use that value in the WebService method.

I hope this helps.

All the best,
Fiko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 28 Sep 2010, 01:41 PM
Hmmm I need the type of clientside performance that msajax just cannot provide :/

Okay, I guess I'll go about manually building the rotator items after a callback.  OR (what about this)...on click of the button add in a dummy clientside rotator item which will instruct the service to do X when it sees it in the collection.  Then perhaps on the serverside REMOVE that temporary item.

Most of the telerik control which do webservice binding provide the ability to pass values back to the services...if it wont get Q3 2010, can I get it added to PITS please?
0
Fiko
Telerik team
answered on 01 Oct 2010, 10:29 AM
Hi Steve,

It is already added in our PITS and you can check it by following this link.

Sincerely yours,
Fiko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 30 Nov 2010, 01:22 AM
I see this in the latest internal build :)

Thank you so much!
0
Fiko
Telerik team
answered on 03 Dec 2010, 05:17 PM
Hello Steve,

Yes the change is included in the latest internal build. You can pass parameters to the server using this approach:
  • Attach a handler to the OnClientItemsRequesting
  • Implement the handler as shown bellow:
    <script type="text/javascript">
        function OnClientItemsRequesting(oRotator, args)
        {
            args.set_argument("a string value");
        }
    </script>
  • Then get the value in the web service as shown bellow:
    [WebMethod]
    public RadRotatorItemData[] GetRotatorData(int itemIndex, string argument)
    {
        if (itemIndex >= maxItemsCount) return null;
        List<RadRotatorItemData> result = new List<RadRotatorItemData>();
     
        for (int i = itemIndex; i < itemIndex + itemCount; i++)
        {
            RadRotatorItemData item = new RadRotatorItemData();
            item.Html = this.GetRadioButtonList();
            result.Add(item);
        }
     
        return result.ToArray();
    }

    Please note that the name of the argument is important

Regards,
Fiko
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 03 Dec 2010, 05:20 PM
Fantastic!

SP1 wouldn't be coming IN december by any chance would it?
0
Fiko
Telerik team
answered on 09 Dec 2010, 11:47 AM
Hi Steve,

Yes, the Q3 2010 SP1 release is scheduled for the middle of this month.

Greetings,
Fiko
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Rotator
Asked by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Answers by
Fiko
Telerik team
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Share this question
or