Hi All,
I have a text area defined as follows <xforms:textarea ref="instance('email-content')" mediatype="text/html"/> | <xforms:textarea ref="instance('email-content')"/> | I have the same instance pointing to mediatype="text/html" and no mediatype tag so that the user can either use the editor or key in direct html. I used the 1st textarea to create the following message CSS Example Styles are not getting applied. and the following code was generated in the 2nd textarea CSS Example<br clear="none"/><br clear="none"/><b>Styles are not getting applied.</b><br clear="none"/><br clear="none"/> My requirement is to grab this content as the email body and send an email. Orbeon log shows me the following code for the email body <html_body>CSS Example<br clear="none"/><br clear="none"/><b>Styles are not getting applied.</b><br clear="none"/><br clear="none"/></html_body> And the email that I received had CSS Example It basically lost the content (Styles are not getting applied.) Can anyone guide me on this. regards --SD |
Administrator
|
SD,
You don't say how you send the email, which seems to be the key here. -Erik On Thu, May 12, 2011 at 9:15 AM, SD <[hidden email]> wrote: > Hi All, > > I have a text area defined as follows > > <td> > <xforms:textarea ref="instance('email-content')" mediatype="text/html"/> > </td> > <td> > <xforms:textarea ref="instance('email-content')"/> > </td> > > I have the same instance pointing to mediatype="text/html" and no mediatype > tag so that the user can either use the editor or key in direct html. > > I used the 1st textarea to create the following message > > CSS Example > > Styles are not getting applied. > > and the following code was generated in the 2nd textarea > > > CSS Example<br clear="none"/><br clear="none"/>Styles are not getting > applied.<br clear="none"/><br clear="none"/> > > > My requirement is to grab this content as the email body and send an email. > > Orbeon log shows me the following code for the email body > > <html_body>CSS Example<br clear="none"/><br > clear="none"/><b>Styles are not getting applied.</b><br > clear="none"/><br clear="none"/></html_body> > > > And the email that I received had > > CSS Example > > It basically lost the content (Styles are not getting applied.) > > Can anyone guide me on this. > > regards > --SD > > > > > -- > View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Applying-styles-to-the-content-of-textarea-tp3518009p3518009.html > Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com. > > > -- > You receive this message as a subscriber of the [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws > > -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Erik,
I have a jar file which has classes written in JAVA that sends the email. The html body is stored in the eXist database and this JAVA code reads the html body from the database and sends email. Am I making sense? Regards --SD |
Administrator
|
Sure but it's hard to say much without knowing exactly how the data
captured by the HTML area ends up to your email library. This said, often this kind of issues comes down to setting the proper mediatype, or to escape/unescape markup. -Erik On Wed, May 18, 2011 at 7:19 AM, SD <[hidden email]> wrote: > Erik, > > I have a jar file which has classes written in JAVA that sends the email. > The html body is stored in the eXist database and this JAVA code reads the > html body from the database and sends email. > > Am I making sense? > > Regards > --SD > > -- > View this message in context: http://orbeon-forms-ops-users.24843.n4.nabble.com/Applying-styles-to-the-content-of-textarea-tp3518009p3532817.html > Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com. > > > -- > You receive this message as a subscriber of the [hidden email] mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws > > -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Hi Erik,
This is what is in the html body stored in the DB Dear __EMPLOYEE_,<br clear="none"/> <br clear="none"/> Welcome to __COMPANY_NAME__. Please fill out this stack of paperwork. I read this in Java as store it in a String object named body, then I append <html><body>+body+</body></html> tags. Then I'm unescapingHtml using StringEscapeUtils.unescapeHtml(body) and setting the content type to "text/html" I'm still lost on this. Thanks --SD |
Just guessing: what happens if you put all the content of the "simple" textarea inside a
<div>element (either by inserting it manually in the textarea or by postprocessing the textarea input)? But if the problems are actually caused by a missing root element, i would expect an error message at any point of the "processing chain"... fs |
In reply to this post by SD
another suggestion: instead of using two xforms input controls, just use an editor component that allows for editing its content directly, in raw mode. i'm not sure whether the YUI RTE has such a feature included (IIRC it has but i can't find an example at the moment), but TinyMCE offers raw mode editing anyway. HTH, florian |
Hi,
I figured out the problem, it was the Java code that was causing this I was using XMLReader which is a SAX based parser and the parser interprets < and > and truncates it. A workaround was to use the substring function. Thanks a lot Erik and Florian. regards --SD |
Free forum by Nabble | Edit this page |