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

Client-side Templates with WCF binding

6 Answers 41 Views
SearchBox
This is a migrated thread and some comments may be shown as answers.
Tarek
Top achievements
Rank 1
Tarek asked on 05 Nov 2013, 04:02 PM
Dear Telerik,
I know that Client-side Templates are applicable with ODataSource bind. What is the case with WCF binding ?

Thanks in advance

6 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 07 Nov 2013, 08:18 AM
Hello,

 
Yes, client templates are working properly with WCF and WebService binding too as for example it is shown in this help article.

Regards,
Plamen
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Tarek
Top achievements
Rank 1
answered on 07 Nov 2013, 09:43 AM
Ok, it's working with Page Method and returning this json result :
{"d":[{"__type":"Telerik.Web.UI.SearchBoxItemData","Text":"","Value":"","DataItem":{"TYPE":"Account","CODE":"41|CRM_ACCOUNT|F","NAMEALPHA":"EASoft","EMAIL1":"mail@web.com","PHONE1":"1234"}}]}

but with WCF it's showing nothing because it's returning this format of json :
{"GetSearchListResult":[{"_dataItem":[{"Key":"TYPE","Value":"Account"},{"Key":"CODE","Value":"41|CRM_ACCOUNT|F"},{"Key":"NAMEALPHA","Value":"EASoft"},{"Key":"EMAIL1","Value":"mail@web.com"},{"Key":"PHONE1","Value":"1234"}],"_text":"","_value":""}]}

My WCF method is :
[OperationContract]
[WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped,
ResponseFormat = WebMessageFormat.Json)]
SearchBoxItemData[] GetSearchList(SearchBoxContext context);

the same method is used in Page Method but without these headers :
[WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped,
ResponseFormat = WebMessageFormat.Json)]

so I think here is the issue in formatting the Response


0
Plamen
Telerik team
answered on 12 Nov 2013, 11:42 AM
Hi,

 
I am attaching a sample web page where is implemented how we recommend you achieve such scenario with RadSearchBox that is bound to WCF.

Hope this will be helpful.

Regards,
Plamen
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Tarek
Top achievements
Rank 1
answered on 14 Nov 2013, 05:13 PM
Dear Plamen, this sample project is not working . It's returning a result in the attachment below
0
Accepted
Plamen
Telerik team
answered on 18 Nov 2013, 09:16 AM
Hi,

 
It looks that there is something different in the way the project is tested or in the environment because it worked correctly at my side. Here is a video of my test. Please review it and let me know what else should I do or add to observe the unusual issue described and be able to inspect it and be more helpful in solving it.

Regards,
Plamen
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Tarek
Top achievements
Rank 1
answered on 23 Nov 2013, 12:43 PM
Dear Plamen, you are right this issue was caused in version 2013 Q1, after upgrading to Q3 the demo worked well .
Thank you
Tags
SearchBox
Asked by
Tarek
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Tarek
Top achievements
Rank 1
Share this question
or