note on Grails-AJAX documentation

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

note on Grails-AJAX documentation

Pietro Maggi
hi,
In my test, I've reached the AJAX stuff and hitted (hard) on the error:
Grails Runtime Exception
Error Details
Message: Cannot invoke method contains() on null object
Caused by: Cannot invoke method contains() on null object

After a trip in train and the availability of an internet connection I
find this message in the mailing list that explained to me what I did
wrong:
http://article.gmane.org/gmane.comp.lang.groovy.grails.user/390/match=g+remotelink

I was missing the "<g:javascript library="prototype" />" line in my
gsp... but I still can't find any mention of this code line in the
documentation!
Can we add it to the AJAX doc page and to the single AJAX taglib so
that it's clear that this is absolutly needed?

:-)

thanks
Pietro
Reply | Threaded
Open this post in threaded view
|

Re: note on Grails-AJAX documentation

graemer
On 4/19/06, Pietro Maggi <[hidden email]> wrote:

> hi,
> In my test, I've reached the AJAX stuff and hitted (hard) on the error:
> Grails Runtime Exception
> Error Details
> Message: Cannot invoke method contains() on null object
> Caused by: Cannot invoke method contains() on null object
>
> After a trip in train and the availability of an internet connection I
> find this message in the mailing list that explained to me what I did
> wrong:
> http://article.gmane.org/gmane.comp.lang.groovy.grails.user/390/match=g+remotelink
>
> I was missing the "<g:javascript library="prototype" />" line in my
> gsp... but I still can't find any mention of this code line in the
> documentation!
> Can we add it to the AJAX doc page and to the single AJAX taglib so
> that it's clear that this is absolutly needed?
There is no need to add this to the docs as its a bug. In fact its
fixed in the latest SNAPSHOT releases.

Graeme
>
> :-)
>
> thanks
> Pietro
>
Reply | Threaded
Open this post in threaded view
|

Re: note on Grails-AJAX documentation

Pietro Maggi
Hi Graeme,

2006/4/19, Graeme Rocher <[hidden email]>:
> On 4/19/06, Pietro Maggi <[hidden email]> wrote:
> > I was missing the "<g:javascript library="prototype" />" line in my
> > gsp... but I still can't find any mention of this code line in the
> > documentation!
> > Can we add it to the AJAX doc page and to the single AJAX taglib so
> > that it's clear that this is absolutly needed?
> There is no need to add this to the docs as its a bug. In fact its
> fixed in the latest SNAPSHOT releases.
>
I've downloaded the SNAPSHOT release and done a:
grails init

in the application root directory. But I still have to add the line
"<g:javascript library="prototype" />" in some circumstances.

What I can see now is that using
<g:formRemote url="[controller:'author',action:'appendMessage']"
                       update="[update:'update',failure:'error']">
   <input type="hidden" name="id" value="${author?.id}" />
   <span style="text-align:center;">
      <p><textarea cols="68" id="message_body" name="message_body"
                          rows="22"></textarea></p>
   </span>
   <input type="submit" value="Invia" />
</g:formRemote>

I got my method called but without the parameters:
<<
[DynamicMethods] Attempting invocation of dynamic static method [get]
on target [class Author] with arguments [{<null>}]
>>

I get the exact same behaviour if I use the "<g:submitToRemote>" tag as in:

<form>
   <input type="hidden" name="id" value="${author?.id}" />
   <span style="text-align:center;">
      <p><textarea cols="68" id="message_body" name="message_body"
                          rows="22"></textarea></p>
   </span>
   <g:submitToRemote action="appendMessage"
update="[update:'message',failure:'error']" />
</form>


BTW: Using <form> as stated in the docs (<g:form> usage result in a
grails runtime error).


Probably I'm missing something I'm now downloading the prototype
library hoping to understand what's going on here.

ciao
Pietro
Reply | Threaded
Open this post in threaded view
|

Re: note on Grails-AJAX documentation

graemer
On 4/20/06, Pietro Maggi <[hidden email]> wrote:

> Hi Graeme,
>
> 2006/4/19, Graeme Rocher <[hidden email]>:
> > On 4/19/06, Pietro Maggi <[hidden email]> wrote:
> > > I was missing the "<g:javascript library="prototype" />" line in my
> > > gsp... but I still can't find any mention of this code line in the
> > > documentation!
> > > Can we add it to the AJAX doc page and to the single AJAX taglib so
> > > that it's clear that this is absolutly needed?
> > There is no need to add this to the docs as its a bug. In fact its
> > fixed in the latest SNAPSHOT releases.
> >
> I've downloaded the SNAPSHOT release and done a:
> grails init
>
> in the application root directory. But I still have to add the line
> "<g:javascript library="prototype" />" in some circumstances.
can you tell me what those circumstances are?

>
> What I can see now is that using
> <g:formRemote url="[controller:'author',action:'appendMessage']"
>                        update="[update:'update',failure:'error']">
>    <input type="hidden" name="id" value="${author?.id}" />
>    <span style="text-align:center;">
>       <p><textarea cols="68" id="message_body" name="message_body"
>                           rows="22"></textarea></p>
>    </span>
>    <input type="submit" value="Invia" />
> </g:formRemote>
>
> I got my method called but without the parameters:
> <<
> [DynamicMethods] Attempting invocation of dynamic static method [get]
> on target [class Author] with arguments [{<null>}]
> >>
>
> I get the exact same behaviour if I use the "<g:submitToRemote>" tag as in:
>
> <form>
>    <input type="hidden" name="id" value="${author?.id}" />
>    <span style="text-align:center;">
>       <p><textarea cols="68" id="message_body" name="message_body"
>                           rows="22"></textarea></p>
>    </span>
>    <g:submitToRemote action="appendMessage"
> update="[update:'message',failure:'error']" />
> </form>

This is fixed now and was reported here
http://jira.codehaus.org/browse/GRAILS-112

>
>
> BTW: Using <form> as stated in the docs (<g:form> usage result in a
> grails runtime error).
Hmm doesn't happen for me what is the error? Can you file an issue
with the error?
>
>
> Probably I'm missing something I'm now downloading the prototype
> library hoping to understand what's going on here.

Cheers
Graeme
>
> ciao
> Pietro
>