On Wed, 2004-07-07 at 09:33, Stephane Delort wrote:
> Hi,
> 
> I saw the sample with htmlarea and found it pretty and am currently working
> on adding this function into my webapp.
> 
> Though, I don't know how to specify an home-made file which could override
> default settings.
> (the way it is told in the htmlarea doc)
> 
> I pasted the code (1) from the doc into the file : "mycustomsettings.js"
> and then, modify
> "forms-htmlarea-styling.xsl"  with this <script type="text/javascript" src
> ="{$resources-uri}/htmlarea/mycustomsettings.js"></script>
> but, unfortunatly, this, does NOT work.
> 
> regards,
> Stephane
> 

As child of the fi:styling you can specify an <initFunction> element
containing the name of a function to be called to create the htmlarea.
As argument the function gets the id of the widget/textarea.

Example:

<fi:styling type="htmlarea" rows="24" cols="80" style="width:100%">
   <initFunction>initEditor</initFunction>
</fi:styling>

and the function initEditor would essentially contain the code you put
below (using the correct widget id), here's a minimal example:

function initEditor(id) {
   var editor = new HTMLArea(id);
   var cfg = editor.config;
   cfg.statusBar = false;
   editor.generate();
}

This example changes the configuration to disable the statusbar of the
editor (which, btw, breaks undo in IE).

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
[EMAIL PROTECTED]                          [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to