Dajax isn't working

2010-09-25 Thread Daniel França
Hi all,
I just start to use Dajax with my Pinax based project
I followed the installation steps

and it's almost working :P

I tried to do a test just copying the following code from Dajax examplex:
http://www.dajaxproject.com/random/
I'ts calling the randomize function correctly (and I can debug it), but it's
not updating the field with the value.

I understood that there's no need to write any js code, right?

I just created my ajax.py and write this:

*import random
from dajax.core import Dajax
from dajaxice.core import dajaxice_functions

def randomize(request):
dajax = Dajax()
dajax.assign('#result','value',random.randint(1, 10))
return dajax.json()

dajaxice_functions.register(randomize)*


and added to my html code:






Just changed the "examples" name to my app name.

It's calling the function, I can debug it, but nothing change in my page.

What am I doing wrong?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Dajax isn't working

2010-09-25 Thread Daniel França
some extra informations:
I'm adding this lines to my base html:

{% dajaxice_js_import %}

The response has the value(seems right):
Dajax.process([{"cmd": "as", "id": "#result", "val": "5", "prop": "value"}])

and my js raise this error:
Uncaught ReferenceError: Dajax is not defined

but these error is not in my function randomize, this function has the Dajax
import and it's working
debuging it seems to be here that it's raising this error:
self.shutdown_request(request)


2010/9/25 Daniel França 

> Hi all,
> I just start to use Dajax with my Pinax based project
> I followed the installation steps
>
> and it's almost working :P
>
> I tried to do a test just copying the following code from Dajax examplex:
> http://www.dajaxproject.com/random/
> I'ts calling the randomize function correctly (and I can debug it), but
> it's not updating the field with the value.
>
> I understood that there's no need to write any js code, right?
>
> I just created my ajax.py and write this:
>
> *import random
> from dajax.core import Dajax
> from dajaxice.core import dajaxice_functions
>
> def randomize(request):
> dajax = Dajax()
> dajax.assign('#result','value',random.randint(1, 10))
> return dajax.json()
>
> dajaxice_functions.register(randomize)*
>
>
> and added to my html code:
>
>
> 
>  onclick="Dajaxice.examples.randomize('Dajax.process')">
>
> Just changed the "examples" name to my app name.
>
> It's calling the function, I can debug it, but nothing change in my page.
>
> What am I doing wrong?
>
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Dajax isn't working

2010-09-25 Thread Daniel França
It's working now.. I was referencing another jquery file

2010/9/25 Daniel França 

> some extra informations:
> I'm adding this lines to my base html:
>  type="text/javascript">
> {% dajaxice_js_import %}
>
> The response has the value(seems right):
> Dajax.process([{"cmd": "as", "id": "#result", "val": "5", "prop":
> "value"}])
>
> and my js raise this error:
> Uncaught ReferenceError: Dajax is not defined
>
> but these error is not in my function randomize, this function has the
> Dajax import and it's working
> debuging it seems to be here that it's raising this error:
> self.shutdown_request(request)
>
>
> 2010/9/25 Daniel França 
>
> Hi all,
>> I just start to use Dajax with my Pinax based project
>> I followed the installation steps
>>
>> and it's almost working :P
>>
>> I tried to do a test just copying the following code from Dajax examplex:
>> http://www.dajaxproject.com/random/
>> I'ts calling the randomize function correctly (and I can debug it), but
>> it's not updating the field with the value.
>>
>> I understood that there's no need to write any js code, right?
>>
>> I just created my ajax.py and write this:
>>
>> *import random
>> from dajax.core import Dajax
>> from dajaxice.core import dajaxice_functions
>>
>> def randomize(request):
>> dajax = Dajax()
>> dajax.assign('#result','value',random.randint(1, 10))
>> return dajax.json()
>>
>> dajaxice_functions.register(randomize)*
>>
>>
>> and added to my html code:
>>
>>
>> 
>> > onclick="Dajaxice.examples.randomize('Dajax.process')">
>>
>> Just changed the "examples" name to my app name.
>>
>> It's calling the function, I can debug it, but nothing change in my page.
>>
>> What am I doing wrong?
>>
>>
>>
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.