You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Josh2007 <jo...@gmail.com> on 2007/08/27 18:31:25 UTC

Dojo and Cocoon Ajax libraries don't load when in use with Chiba XForms filter

Hi all,

I've set up my Cocoon servlet with Chiba-web XForms as a filter and I'm
using Ajax block to perform asynchronous requests.

Everything works fine as long as I don't mix in the same document Ajax
features from Cocoon and XForms (from Chiba).
If I do so, Dojo and Cocoon Ajax libraries implemented in Cocoon servlet
don't load and I get an error in my error console:

"Erreur : Could not load 'cocoon.ajax.PartialLink'; last tried
'__package__.js' 

I found the explanation but not the solution:

Chiba-web filter needs an xml or xhtml document to transform it into html
(this makes sense).
The problem is that, in order to perform Ajax processing, Cocoon needs to
serialize the document into html first, so it can load the jar files
containing Dojo and Cocoon.ajax libraries.

It's kind of tricky:
If I serialize my document into html, I get an error from Chiba-web filter
which needs xml or xhtml document to perform.

If I serialize my document into xml or xhtml, it's ok for Chiba-web filter,
but Cocoon cannot load the jar files for Ajax implementation (javascript)
and no ajax features are available.

Does anyone know what could be done to solve this problem?

Thanks,

Josh 
-- 
View this message in context: http://www.nabble.com/Dojo-and-Cocoon-Ajax-libraries-don%27t-load-when-in-use-with-Chiba-XForms-filter-tf4336782.html#a12352715
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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


Re: Dojo and Cocoon Ajax libraries don't load when in use with Chiba XForms filter

Posted by Josh2007 <jo...@gmail.com>.
I finally found the solution. It was not a big deal actually.

I just modified Chiba default stylesheet html4.xsl.

Instead of loading Dojo resource from Chiba, I load Dojo resource from
Cocoon by switching from:
<script type="text/javascript"
src="{concat($contextroot,$scriptPath,'dojo-0.4/dojo.js')}">&#160;</script>
to:
<script type="text/javascript"
src="{concat($contextroot,'/_cocoon/resources/dojo/dojo.js')}">&#160;</script>

Josh



Josh2007 wrote:
> 
> Hi all,
> 
> I've set up my Cocoon servlet with Chiba-web XForms as a filter and I'm
> using Ajax block to perform asynchronous requests.
> 
> Everything works fine as long as I don't mix in the same document Ajax
> features from Cocoon and XForms (from Chiba).
> If I do so, Dojo and Cocoon Ajax libraries implemented in Cocoon servlet
> don't load and I get an error in my error console:
> 
> "Erreur : Could not load 'cocoon.ajax.PartialLink'; last tried
> '__package__.js' 
> 
> I found the explanation but not the solution:
> 
> Chiba-web filter needs an xml or xhtml document to transform it into html
> (this makes sense).
> The problem is that, in order to perform Ajax processing, Cocoon needs to
> serialize the document into html first, so it can load the jar files
> containing Dojo and Cocoon.ajax libraries.
> 
> It's kind of tricky:
> If I serialize my document into html, I get an error from Chiba-web filter
> which needs xml or xhtml document to perform.
> 
> If I serialize my document into xml or xhtml, it's ok for Chiba-web
> filter, but Cocoon cannot load the jar files for Ajax implementation
> (javascript) and no ajax features are available.
> 
> Does anyone know what could be done to solve this problem?
> 
> Thanks,
> 
> Josh 
> 

-- 
View this message in context: http://www.nabble.com/Dojo-and-Cocoon-Ajax-libraries-don%27t-load-when-in-use-with-Chiba-XForms-filter-tf4336782.html#a12357553
Sent from the Cocoon - Users mailing list archive at Nabble.com.


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