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

livetile.set_value function does not work

2 Answers 47 Views
TileList
This is a migrated thread and some comments may be shown as answers.
Hans-Jürgen
Top achievements
Rank 1
Hans-Jürgen asked on 10 Oct 2014, 03:57 PM
HI,

I try to get the 'Standalone Tiles' example from your demo Website ( http://demos.telerik.com/aspnet-ajax/tilelist/examples/standalonetiles/defaultcs.aspx )
to run on my System.

In the mentioned example you have the following JavaScript code:

function liveTileOnClientTemplateDataBound(sender, args) {            var index = args.get_dataItem().index + 1;            if (index > 2) {                index = 0;            }            sender.set_value(index.toString());        }

Inside the code you use a function with Name set_value().
I assume what this function should do is to set the 'Value' property of the live tile.
Unfortunately there is no place in the online doc to a 'set_value()' function, at least I did not find it. Also no mentioning in the Forum.

What I THOUGHT I can do with this function is to set the value of the 'context' object Parameter to Server side pagemethod specified in the WebServiceSettings tag of the live tile.

But to what ever I set the value in set_value() it has no influence to the context object in the pagemethod.

Since set_value is not documented- Is this function really doing something or is the code in the demo wrong ?

I really WOULD like to set the value of the context object of the pagemethod.
How can I do this (if set_value is NOT the way to do it) ????

Hope that someone knows an answer.
Best regards
Hans-Juergen















 

2 Answers, 1 is accepted

Sort by
0
Hans-Jürgen
Top achievements
Rank 1
answered on 10 Oct 2014, 05:59 PM
Hi,

false Alarm, set_value IS working, the function is just not referenced in the Client-side programming Folder of the live tile object.

The page 'pass data to the webservice'
http://www.telerik.com/help/aspnet-ajax/tilelist-tiles-livetile-pass-data-to-web-service.html
explains how to use  set_value.

I still believe the 'Standalone Tiles' example is  wrong. The only place where it makes sense to use set_value is the OnClientDataLoading Event. Using set_value in the OnClientTemplateDataBound Event will have no effect on the Parameter of the Pagemethod. 

Anyhow- My post is answered and everything works as documented.

Cheers
Hans-Juergen


0
Marin Bratanov
Telerik team
answered on 13 Oct 2014, 01:11 PM

Hello Hans-Juergen,

What the demo does is to increment the Value property when the response is received, depending on the response. Thus, the next request will use the value we just set. This is one way to do this, and using the DataLoading event is another.

As for the get/set_value() methods - indeed, they were missing from the LiveTIle clients-side API reference (http://www.telerik.com/help/aspnet-ajax/tilelist-client-side-livetile-api.html) and they will be added with our next documentation upload.


Regards,

Marin Bratanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
TileList
Asked by
Hans-Jürgen
Top achievements
Rank 1
Answers by
Hans-Jürgen
Top achievements
Rank 1
Marin Bratanov
Telerik team
Share this question
or