[SOLVED] Web service Ajax Methods
New Community Forums available at http://forums.ext.net
 

Coolite Forums

Welcome Guest ( Login | Register )
 
[SOLVED] Web service Ajax Methods
Subscribe
Last Login: 7/5/2010 10:14:37 AM
Posts: 260,
Posted 7/3/2009 2:48:16 AM

Group: Coolite Premium Member & Early Adopter
 Hello,

I try to achieve something like in your example Coolite.Sandbox/WebMethod/WebMethodVSAjaxMethod.aspx (buttons AjaxMethod public and static), but it doesn't work. Actually it doesn't work even in this example, so I just wanted to ask if this functionality is supported.

Regards,
Tadeusz
Last Login: 7/8/2010 1:50:34 AM
Posts: 4,722,
Posted 7/3/2009 2:54:50 AM

Group: Core Development Team
Hi Tadeusz,

The sandbox project is just a dumping ground for us to experiment in. I would suspect most of the samples in there may not work.

I think there's a sample in the Example Explorer which demonstrates using an AjaxEvent (or maybe AjaxMethod) in conjunction with a web service endpoint. 

--
Geoffrey McGill
Coolite Inc.
Development Team
Skype : geoffrey.mcgill
Forum Guidelines | Coolite Examples | Coolite API Docs | ExtJS API Docs | Twitter
Last Login: 7/5/2010 10:10:13 AM
Posts: 7,853,
Posted 7/3/2009 8:21:13 AM

Group: Core Development Team
Hi,

Yes, we have an example which shows AjaxEvent and WebService. I think we can easly add such example for AjaxMethod (just need to add ability specify url and CleanRequest option). Please note that for such AjaxMethod we can't create proxy in javascript like for classic AjaxMethods. I investigate it on weekend and let you know

--
Vladimir Shcheglov
Coolite Inc.
Development Team
Forum Guidelines | Coolite Examples | Coolite API Docs | ExtJS API Docs | Twitter
Last Login: 7/5/2010 10:14:37 AM
Posts: 260,
Posted 7/3/2009 2:08:14 PM

Group: Coolite Premium Member & Early Adopter
Hi,

That would be great to have such the possibility with AjaxMethod. Actually it is fine not to have the JavaScript proxy, because in our case we create url dynamically depending on situation.

Tadeusz

Last Login: 7/5/2010 10:10:13 AM
Posts: 7,853,
Posted 7/4/2009 8:00:00 PM

Group: Core Development Team
Hi,

Please update from SVN.
See  Coolite.Examples\Examples\Events\AjaxMethods\WebService\

Here is js part of that example

<script type="text/javascript">
        var callXmlWebMethod = function (name) {
            Coolite.AjaxMethod.request({
                url: "TestXmlService.asmx/SayHello",
                cleanRequest: true,
                params:{
                    name: name
                },
                success: function(result){
                    //alert(result.text);
                    alert(Ext.DomQuery.selectValue("string", result, ""));
                }
            });
        }
       
        var callJsonWebMethod = function (name) {
            Coolite.AjaxMethod.request({
                url: "TestJsonService.asmx/SayHello",
                cleanRequest: true,
                json: true,
                params:{
                    name: name
                },
                success: function(result){
                    alert(result);
                }
            });
        }
    </script>


--
Vladimir Shcheglov
Coolite Inc.
Development Team
Forum Guidelines | Coolite Examples | Coolite API Docs | ExtJS API Docs | Twitter
Last Login: 7/5/2010 10:14:37 AM
Posts: 260,
Posted 7/7/2009 12:13:01 AM

Group: Coolite Premium Member & Early Adopter
Hi,

Awesome, thank you. I have one more question: is it possible to use DateTime as a parameter somehow? If I add DateTime parameter to the JSON service and use e.g. "new Date()" in JavaScript as the value for that parameter, I receive an exception: {"Message":"\"2009-07-07T09:05:56\" is not a valid value for DateTime."

Regards,
Tadeusz
Last Login: 7/5/2010 10:10:13 AM
Posts: 7,853,
Posted 7/7/2009 2:03:49 AM

Group: Core Development Team
Hi,

I am not sure about that possibility. Do you know what date format a webservice expects? Try to define string parameter in webmethod and convert string to the date inside webmethod

--
Vladimir Shcheglov
Coolite Inc.
Development Team
Forum Guidelines | Coolite Examples | Coolite API Docs | ExtJS API Docs | Twitter
Last Login: 7/5/2010 10:14:37 AM
Posts: 260,
Posted 7/7/2009 2:32:36 AM

Group: Coolite Premium Member & Early Adopter
 Hi,

I think it needs miliseconds part, like: 2009-07-07T09:05:56.034. With the string parameter it is working fine.

Regards,
Tadeusz
Last Login: 7/5/2010 10:10:13 AM
Posts: 7,853,
Posted 7/15/2009 12:58:56 AM

Group: Core Development Team
Hi,

May be this post can help you to solve date issue



--
Vladimir Shcheglov
Coolite Inc.
Development Team
Forum Guidelines | Coolite Examples | Coolite API Docs | ExtJS API Docs | Twitter
Last Login: 7/5/2010 10:14:37 AM
Posts: 260,
Posted 7/15/2009 4:34:15 AM

Group: Coolite Premium Member & Early Adopter
 Hi,

Thanks, the following works perfect for me:


date: dt.format('yyyy-MM-dd\\T00:00:00.000')


Tadeusz
« Prev Topic | Next Topic »
Reading This Topic
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.
All times are GMT -5:00, Time now is 4:43pm