I have some groovy code and in it I am grabbing the value from a field and storing it in an object. When the value has spaces, it is encoded with " ". Is there a way to remove HTML encoding from a string? I looked in Util and didn't see anything.
On Fri, Mar 28, 2014 at 10:01 PM, DeHaynes <[hidden email]> wrote:
> I have some groovy code and in it I am grabbing the value from a field and
> storing it in an object. When the value has spaces, it is encoded with
> " ". Is there a way to remove HTML encoding from a string? I looked
> in Util and didn't see anything.
What type of field are you referring to? HTML input field? Is it a
text area or an input with type=text? How do you get the value from
If the value contains then it's probably HTML so removing the
HTML encoding will break the HTML as you can also have > or <
before <em> 1 < 2</em> after
I guess what you are trying to achieve is to get the plain text from
an HTML content.
I am using a String input field to hold the name of the document and it's title. It works fine for the document name, but not the document Title. If there is more than one space between words in the title, it inserts a " " for each additional space beyond the first one.
This is in groovy. I get the value from the field like this
// I use this to pull by Class document from the form document.
def myObject = source.getObject(Globals.fullClassSpace);
// I use this to get the value of the field.
def NewDocumentName = myObject.get(Globals.titleFieldName).value
// I use this to set the title of the document.