358 Lotus blogs updated hourly. Who will post next? Home | Downloads | Events | Pods | Blogs | Search | myPL | About 
 
Sorry, no records were found!
Latest 7 Posts
"Do I Need to Learn Java?": a brief conversation with a composite character
Wed, Mar 26th 2014 180
workaround for severe screen sharing bug in Mavericks
Tue, Feb 4th 2014 97
the more essential it is, the less passionate we are
Sun, Feb 2nd 2014 82
imagine
Sun, Feb 2nd 2014 77
Beyond Documents, part 2: a futuristic example
Wed, Dec 18th 2013 80
an easy way to give Domino Designer a ridiculous performance boost
Wed, Dec 4th 2013 71
they told me I could be anything
Sat, Oct 26th 2013 93
Top 10


quick tip: stripping HTML tags from string content in XPages
Tim Tripcony    

I was asked today how to remove HTML tags from a String in SSJS. My recommendation was to use the ACF API that is built in to XPages.

Editable input controls, such as inputText, inputTextarea, and inputRichText, support properties of htmlFilter and htmlFilterIn. These properties allow you to select a content filter option to automatically clean the submitted value. As far as I can tell, the only option that actually does anything useful is "striptags", which does exactly that: it just removes any HTML markup from the value, leaving the rest of the content intact.

Behind the scenes, this simply calls:

StripTagsProcessor.instance().processMarkup(paramString)


This makes it very easy to use the same approach to filtering String data even when it's not necessarily data being submitted via an input control. For example, in SSJS the syntax would be:

var filtered = 
com.ibm.xsp.acf.StripTagsProcessor.instance().processMarkup(original);




---------------------
http://xmage.gbs.com/blog.nsf/d6plinks/TTRY-8RRP5X
Feb 23, 2012
42 hits



Sorry, no records were found!
Recent Blog Posts




Created and Maintained by Yancy Lent - About - Blog Submission - Suggestions - Change Log - Blog Widget - Advertising - Mobile Edition