You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Derek Hohls <DH...@csir.co.za> on 2009/01/26 11:54:05 UTC

Cocoon 2.1.8 Forms + AJAX : "cocoon is not defined"

With respect to the previous thread:
http://marc.info/?l=xml-cocoon-users&m=123243320521118&w=2

I took the approach I planned; i.e. start with a working version from the
sample and gradually add in my changes until done.  Now I have a 
working sample in a test directory of my Cocoon instance (2.18.)

However, when I copy all the files over into my working application
directory (*same* Cocoon instance), I now get an error, shown 
with Firebug as:

"cocoon is not defined" with a pointer to the 
<script>cocoon.forms.ajax = true;</script>
tag that appears near the top of the form.

(In the original working version, this error does not appear)

This does not appear to prevent the AJAX aspect of the form working
properly in Firefox - though the page will load but not display at all in
IE - and I also get a "onsubmit was called twice" when I click on the OK.

Does anyone have an idea what the specific cause of this problem
could be - i.e. where the script is looking for the definition, given that
I have tried to keep everything "equivalent" (i.e. a line-by-line compare
of the HTML source shows the files are the same, apart from directory
name differences, and the resource & stylesheets directories/files are 
the same).

Thanks
Derek


-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Cocoon 2.1.8 Forms + AJAX : "cocoon is not defined" [SOLVED]

Posted by Derek Hohls <DH...@csir.co.za>.
Solved!

The forms usage in the working application was in a nested pipeline
because of authorisation requirements:

<map:match pattern="foo/**">
...
   <map:match pattern="foo/forms/*">
etc.

But my resources link was located outside of this nested pipe:

     <map:match pattern="resources/*/**">
       <map:read
src="resource://org/apache/cocoon/{1}/resources/{2}"/>
     </map:match>

and as soon as I added them back in:

     <map:match pattern="foo/resources/*/**">
       <map:read
src="resource://org/apache/cocoon/{1}/resources/{2}"/>
     </map:match>

things worked just fine.

In retrospect, André had pointed out something like this a while back:
http://marc.info/?l=xml-cocoon-users&m=122405789617000&w=2

but somehow I did not connect my error message with his response.

Oh well, this post may help someone else at sometime!

Derek

>>> On 2009/01/26 at 12:54, in message
<49...@csir.co.za>, "Derek Hohls"
<DH...@csir.co.za> wrote:
With respect to the previous thread:
http://marc.info/?l=xml-cocoon-users&m=123243320521118&w=2 

I took the approach I planned; i.e. start with a working version from
the
sample and gradually add in my changes until done.  Now I have a 
working sample in a test directory of my Cocoon instance (2.18.)

However, when I copy all the files over into my working application
directory (*same* Cocoon instance), I now get an error, shown 
with Firebug as:

"cocoon is not defined" with a pointer to the 
<script>cocoon.forms.ajax = true;</script>
tag that appears near the top of the form.

(In the original working version, this error does not appear)

This does not appear to prevent the AJAX aspect of the form working
properly in Firefox - though the page will load but not display at all
in
IE - and I also get a "onsubmit was called twice" when I click on the
OK.

Does anyone have an idea what the specific cause of this problem
could be - i.e. where the script is looking for the definition, given
that
I have tried to keep everything "equivalent" (i.e. a line-by-line
compare
of the HTML source shows the files are the same, apart from directory
name differences, and the resource & stylesheets directories/files are

the same).

Thanks
Derek



-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org