R: Extending html tag: how to do it?
I cannot use the bean:write or the c:out because it espcapes html chars and then I'll see bciao/a instead of a bold ciao inside the editor Simone - Simone Chiaretta www.piyosailing.com/S Any sufficiently advanced technology is indistinguishable from magic Life is short, play hard -Messaggio originale- Da: Niall Pemberton [mailto:[EMAIL PROTECTED] Inviato: venerdì 7 maggio 2004 23.42 A: Struts Users Mailing List Oggetto: Re: Extending html tag: how to do it? You could do this differently using struts tags: FCK:editor id=HTMLCode bean:write name=infoPageForm property=HTMLCode/ /FCK:editor or even better using the java standard tag library (JSTL): FCK:editor id=HTMLCode c:out value=${infoPageForm.HTMLCode}/ /FCK:editor The only thing then is setting the hidden fields name attribute to the form name/property so that its submitted back properly. Niall - Original Message - From: Simone-dev [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, May 07, 2004 9:57 AM Subject: Re: Extending html tag: how to do it? Yes, it's a textarea with richer editing features... but the real form tag used is then the hidden field. I already did the not formbean integrated tag designing it on my own, without referring to the struts taglib. I'll try subclassing the BaseInputTag and see what's goin to happen. :-) JavaServer Faces will be a future implementation, but I never used this technology before, so I'd better start using it before thinking about extending with functionality :-) Best Regards Simone Craig McClanahan wrote: Simone - Dev wrote: 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, From a Struts perspective, what you're describing sounds pretty similar to the html:textarea tag ... it's just that the editing would be rich text instead of simple characters, right? If so, and if you wanted to be able to interoperate with Struts capabilities, you should download the source code for Struts [1], and take a look at how the corresponding tag itself is implemented (org.apache.struts.taglib.html.TextareaTag). The simplest thing to do would be cut-n-paste this into a separate tag file, instead of worrying about extending it. Most of the things you would need to change are in the renderTextareaElement() method. With regards to form bean interaction, I am assuming that the form bean would treat the content of the editing area as a String, right? If so, then BaseInputTag (which TextareaTag subclasses) does most of the work for you. Just make sure your tag includes the same kinds of attributes as html:textarea (but especially name, property, and value), plus any additional ones you need, and your renderTextareaElement() will be able to interact with the value instance variable. Craig McClanahan [1] http://jakarta.apache.org/site/sourceindex.cgi PS: In addition to interoperating with Struts, you might want to investigate creating a JavaServer Faces component around your text editor. This sounds like a very useful gadget. More info: http://java.sun.com/j2ee/javaserverfaces/ Simone - Simone Chiaretta http://www.piyosailing.com/S www.piyosailing.com/S Any sufficiently advanced technology is indistinguishable from
R: Extending html tag: how to do it?
OK, thank you... True is the defualt value for filter, so I've to set it to false if I want the raw data. Simone - Simone Chiaretta www.piyosailing.com/S Any sufficiently advanced technology is indistinguishable from magic Life is short, play hard -Messaggio originale- Da: Martin Alley [mailto:[EMAIL PROTECTED] Inviato: sabato 8 maggio 2004 18.06 A: 'Struts Users Mailing List' Oggetto: RE: Extending html tag: how to do it? Bean:write has a filter parameter: If this attribute is set to true, the rendered property value will be filtered for characters that are sensitive in HTML, and any such characters will be replaced by their entity equivalents. -Original Message- From: Simone - Dev [mailto:[EMAIL PROTECTED] Sent: 08 May 2004 09:19 To: 'Struts Users Mailing List' Subject: R: Extending html tag: how to do it? I cannot use the bean:write or the c:out because it espcapes html chars and then I'll see bciao/a instead of a bold ciao inside the editor Simone - Simone Chiaretta www.piyosailing.com/S Any sufficiently advanced technology is indistinguishable from magic Life is short, play hard -Messaggio originale- Da: Niall Pemberton [mailto:[EMAIL PROTECTED] Inviato: venerdì 7 maggio 2004 23.42 A: Struts Users Mailing List Oggetto: Re: Extending html tag: how to do it? You could do this differently using struts tags: FCK:editor id=HTMLCode bean:write name=infoPageForm property=HTMLCode/ /FCK:editor or even better using the java standard tag library (JSTL): FCK:editor id=HTMLCode c:out value=${infoPageForm.HTMLCode}/ /FCK:editor The only thing then is setting the hidden fields name attribute to the form name/property so that its submitted back properly. Niall - Original Message - From: Simone-dev [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, May 07, 2004 9:57 AM Subject: Re: Extending html tag: how to do it? Yes, it's a textarea with richer editing features... but the real form tag used is then the hidden field. I already did the not formbean integrated tag designing it on my own, without referring to the struts taglib. I'll try subclassing the BaseInputTag and see what's goin to happen. :-) JavaServer Faces will be a future implementation, but I never used this technology before, so I'd better start using it before thinking about extending with functionality :-) Best Regards Simone Craig McClanahan wrote: Simone - Dev wrote: 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, From a Struts perspective, what you're describing sounds pretty similar to the html:textarea tag ... it's just that the editing would be rich text instead of simple characters, right? If so, and if you wanted to be able to interoperate with Struts capabilities, you should download the source code for Struts [1], and take a look at how the corresponding tag itself is implemented (org.apache.struts.taglib.html.TextareaTag). The simplest thing to do would be cut-n-paste this into a separate tag file, instead of worrying about extending it. Most of the things you would need to change are in the renderTextareaElement() method. With regards to form bean interaction, I am assuming