You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mark Lundquist <ml...@wrinkledog.com> on 2006/05/05 22:58:12 UTC

Re: Need help with HTMLArea in Cforms

Hi Leszek,

Well, I got your answer and then had to go work on other things 
instead!  But I'm still a little confused, see below....

On Apr 18, 2006, at 12:53 PM, Leszek Gawron wrote:

> Mark Lundquist wrote:
>> Hi folks,
>> Maybe someone can give me some ideas where to look in order to debug 
>> this problem...
>> I'm trying to integrate the CForms HTMLArea support into an existing 
>> Cocoon 2.1.8 applicaiton that uses CForms.  Really, it's just 
>> changing an existing textarea control into an "htmlarea" widget 
>> (<fi:styling type="htmlarea"/>) and fixing up everything else so that 
>> the string value gets serialized/parsed appropriately in all the 
>> right places.
>> Anyway... the HTMLArea control is displayed and appears to be work 
>> right, i.e. I can perform editing/authoring
>> operations, including adding links, making styling changes etc.
>> The problem is that when I submit the form, the new value of the 
>> widget is not submitted.  I fired up LiveHTTPHeaders in Mozilla, and 
>> I can see that it's the old value in the POST request, not the new 
>> one.  I checked it at this level just to rule out any server-side 
>> CForms botching that I may have going on.
>> The HTMLArea sample in the Cocoon distribution works fine for me.  
>> It's just in my real application that I've got something fubar.  I'm 
>> using Firefox 1.5.0.2 and Moz 1.7.11.
>> I verified that the htmlarea.js script is able to load all of its 
>> subsidiary scripts (even though HTMLArea doesn't work in Safari, I 
>> fired up the page in Safari so that I could use its very handy 
>> Activity window to make sure that everything is loading correctly).
>> Any ideas?
> cocoon uses forms_onsubmit() and handles all submits not via
> <input type="submit"/> but via <input type="button" 
> onclick="forms_onsubmit(...)"/>
>
> this does not trigger the default form's onsubmit handler which 
> htmlarea overrides.
>
> the most stupid way to fix that is:
>
> <ft:form-template action="" method="post" name="edit">
> <!-- bug workaround -->
> <script type="text/javascript">
>     var handler = new Object();
>     handler.forms_onsubmit = function() {
>         document.edit.newsText.value = 
> document.edit.newsText.htmlarea.getHTML();
>         return true;
>     }
>     forms_onsubmitHandlers.push(handler);
> </script>

OK, that all makes sense... but then why is it that the sample does not 
seem to have this problem?  The workaround you show isn't in the 
template for the
sample, yet the reply page sent upon submission of the form correctly 
shows the HTML generated by the htmlarea control...

Not Getting It, :-)
—ml—


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


Re: cForms - schemas

Posted by Antonio Gallardo <ag...@agssa.net>.
Hi Lee:

Lee Carroll escribió:
> Are their any xsd's which describe the various cform documents.
AFAIK, nope. Remember we are open for contribution. :-)

Best Regards,

Antonio Gallardo.
> Particularly model , template, template style and binding namespaces. 
> The docs and examples are great but a complete reference of
> elements, attribute and enumurations would be invaluable for some one 
> like me starting out


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


cForms - schemas

Posted by Lee Carroll <le...@pear-partnership.co.uk>.
Hi,
I've just started using cforms - very cool. Are their any xsd's which
describe the various cform documents.
Particularly model , template, template style and binding namespaces. The
docs and examples are great but a complete reference of
elements, attribute and enumurations would be invaluable for some one like
me starting out

Cheers Lee C
  -----Original Message-----
  From: Mark Lundquist [mailto:ml@wrinkledog.com]
  Sent: 05 May 2006 22:01
  To: cocoon-users@apache.org
  Subject: Re: Need help with HTMLArea in Cforms



  On May 5, 2006, at 1:58 PM, Mark Lundquist wrote:


    [...snip] Not Getting It, :-)
    —ml—


  Never mind, I do get it... :-)

  The sample doesn't use an <fd:submit> widget, it avoids the problem by
using a raw HTML <input>.

  —ml—

Re: Need help with HTMLArea in Cforms

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On May 5, 2006, at 1:58 PM, Mark Lundquist wrote:

> [...snip] Not Getting It, :-)
> —ml—

Never mind, I do get it... :-)

The sample doesn't use an <fd:submit> widget, it avoids the problem by 
using a raw HTML <input>.

—ml—