cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Evans <jon.ev...@misgl.com>
Subject CForms in a coplet
Date Wed, 24 Mar 2004 16:40:41 GMT
Hi,

For any form to work properly in a CachingURICoplet, you need to 
transform the coplet through the HTMLEventLinkTransformer, to convert 
the action parameter of the form tag to an event.

For this to work with cocoon forms, you need to have first transformed 
using forms-samples-styling.xsl or equivalent, to convert the cforms 
markup to an actual HTML form.

This works fine.

One of the other things that cforms does is create javascript alert 
links, e.g. alert("This field is required"). Unfortunately the 
HTMLEventLinkTransformer wipes out these anchor tags, and replaces them 
with <a href="some-useless-event"...


I can see two ways around this.

1) Split out the forms-samples-styling.xsl stuff, so that it is done in 
two stages so we can insert an HTMLEventLinkTransformer stage in the 
middle:

<map:transform src="cforms-pre-styling.xsl"/>
<!-- now we have the form element etc. in place -->
<map:transform type="portal-html-eventlink"/>
<map:transform src="cforms-post-styling.xsl"/>
<!-- now we have other elements, like forms-validation-messaage links 
-->


2) Modify HTMLEventLinkTransformer so that it ignores certain anchor 
link classes:

<map:transform type="portal-html-eventlink">
   <map:parameter name="ignore-link-classes" 
value="forms-validation-message"/>
</map:transform>

(the popup links have their own class, forms-validation-message).

I can code up either solution - I need it anyway for my own code.  What 
do you think?  Or is there another way?

Jon


Mime
View raw message