Niall ,
Thank you for your help,
I already did such a tag....
I wanted to do a struts tag because I wanted to retrive the value from the formbean, instead of having to pass as a different page attribute or computing it on the page.


Now I do this:

<%

InfoPageForm ipf = (InfoPageForm) request.getAttribute("infoPageForm");

String HTMLCodeValue=ipf.getHTMLCode();

%>

<FCK:editor id="HTMLCode"><%=HTMLCodeValue%></FCK:editor>

but I 'd like to have the tag retrive the value directrly knowing the property name of the required field in the formbean referneced byt the html:form tag.

This will be really an interesting thing-

For those interested the code I wrote is available for download on my website (the page is in italian... but the code is obvious :-)

http://www.piyosailing.com/S/programming-opensource.jsp

Niall Pemberton wrote:

Simone,

The problem with Struts tags is that they are depandant on a number of
classes internal to Struts or to other Jakarta components such as BeanUtils.
I imagine that it would be better if your tag for FCKeditor was independant
of these and so its difficult to pick a struts tag which is a good example.

I have put together "sample" or "demo" tag for FCKeditor which you are
welcome to use. As per your requirements it outputs the javascript for the
editor and a <input type="hidden"> field containing the initial value. The
initial value it gets from the "body" of the tag and the name of the
"hidden" field can be specified on the tag.

You will probably need to adjust it to meet your needs and add more
attributes - but it gives you a starting point. I have loaded onto my web
page where you can download it from:

http://www.niallp.pwp.blueyonder.co.uk/#fckeditortag

Included in the zip file is the java source, compiled class, tld and a
sample jsp page (same as the "test.html" supplied with FCKeditor).

HTH

Niall

----- Original Message ----- From: "Simone - Dev" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 06, 2004 11:54 PM
Subject: Extending html tag: how to do it?





Hello all,
I'm in a team of open source developer for an HTML editing control to be
included in web pages to enable the posting of rich formatted text using
a visual approach (instead of typing HTML in a textarea)
The project is http://www.fredck.com/fckeditor/ and u can see a working
demo (works for the moment just on IE 5+ and windows) here
http://www.fredck.com/fckeditor/Demo/


What I'm writing here becase I've just developed (and will be released in the next version of the editor, hopefully next weekend) a taglib to include this control in a JSP page with a simple <FCK:editor id="bodyNews" >Text of the news </FCK:editor> instead of writing all the complex javascript code required to the make the html editor start.

But in the next version I want to go further, and have the editor get
it's initial value from the FormBean connected with the form and then
set it so that the following action can retrieve it inside the FormBean
passed by the page.

Basically the editor store the text to edit (and then to be sent in the
post method) in an hidden field, and one of the things that my taglib
does is also to write this hidden field with the "starting" value.

But I never extended an HTML taglib, and never found on the archive nor
other websites some info on how to do it.
Thank you for ur help.

Simone

-------------------------
Simone Chiaretta
<http://www.piyosailing.com/S> www.piyosailing.com/S
Any sufficiently advanced technology is indistinguishable from magic
"Life is short, play hard"












Reply via email to