The entity "rsquo" was referenced, but not declared.

alexcharleswort
Tera Expert

Hey all!

I seem to be having an issue pushing verbiage from an HTML field to a UI Page. Basically what I want is to be able to copy and paste company agreements into this HTML field and then when I click the 'Sign Form' UI Action, I want it to display what's in that HTML field on that UI Page.

I keep getting the following errors depending on what is in the HTML field: 

The entity "ldquo" was referenced, but not declared

The entity "rsquo" was referenced, but not declared

The entity "&nbsp" was referenced, but not declared

So... it is having issues with spaces, apostrophes and quotation marks. The point is for this ui page to be dynamic, so going into the ui page and manually changing each &nbsp to <br> is not an option. I need to somehow declare this in my ui page script so that it can read/translate these values but I have no idea how to do this.

Any help would be appreciated. Below is my ui page script (right now I am just referencing a static record for testing purposes).

 

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
	

	<j:if test="$[jvar_isMSIE8 || jvar_isMSIE7]">
		<g:requires name="scripts/flashcanvas.jsx" includes="true"/>
	</j:if>
	<j:if test="${GlideMobileExtensions.getDeviceType() != 'doctype'}">
		<g:requires name="scripts/lib/jquery_includes.jsx" includes="true" />
	</j:if>
	<g:requires name="scripts/jquery.signaturepad.min.jsx" includes="true" />
	<g:requires name="scripts/signature_pad.jsx" includes="true" />
	<g:requires name="scripts/json2.jsx" includes="true" />
	<g:requires name="styles/jquery.signaturepad.cssx" includes="true" />
	<g:requires name="styles/heisenberg/heisenberg_all.cssx" includes="true" />
	<g:requires name="scripts/classes/ajax/GlideAjax.jsx" includes="true" />

	
	<p>
	<g:evaluate>
		var pa = new GlideRecord('u_hr_forms'); 
		pa.get('b76a050f4f5423007dc7ea7d0210c720');
		
	</g:evaluate>
			
		  



			
		</p>
 <g:no_escape>${HTML:pa.u_body.getDisplayValue()}</g:no_escape>
	
<p></p>
<p><strong>Staff Member's Signature</strong></p>

 
	<g:ui_form>
		<input type="hidden" id="sysparm_retrieve_signature" value="$[gs.getProperty('com.snc.signaturepad.retrieveSignature')]" />
		
		<input type="hidden" id="sysparm_draw_only" value="$[sysparm_draw_only]" />
		<input type="hidden" id="document_id" name="document_id" value="${sysparm_document_id}"></input>
		<input type="hidden" id="signature_redirect_url" name="signature_redirect_url" value="$[sysparm_redirect_url]"/>
		<input type="hidden" id="table_name" name="table_name" value="${sysparm_table_name}"></input>
		<input type="hidden" name="u_party" value="${sysparm_string}"></input>
	
		
		<div class="sigPad">
			<j:if test="${sysparm_draw_only != 'true'}">
				<div class="typeItDesc">
					<label for="name">${gs.getMessage('Print your name')}</label>
					<input type="text" name="signed_name" id="signed_name" class="signed_name" />
				</div>
				<p class="typeItDesc">${gs.getMessage('Review your signature')}</p>
				<p class="drawItDesc">${gs.getMessage('Draw your signature')}</p>
				<ul class="nav nav-tabs sn-tabs-basic sigNav">
					<li class="typeIt"><a href="#type-it" id='typeItLink'>${gs.getMessage('Type it')}</a></li>
					<li class="drawIt"><a href="#draw-it" id='drawItLink'>${gs.getMessage('Draw it')}</a></li>
					<a class="clearButton" href="#clear">${gs.getMessage('Clear')}</a>
				</ul>
			</j:if>
			<j:if test="${sysparm_draw_only == 'true'}">
				<p class="drawItDesc">${gs.getMessage('Draw your signature')}</p>
				<div class="sigNav">
					<a class="clearButton" href="#clear">${gs.getMessage('Clear')}</a>
				</div>
			</j:if>
			<div class="sig sigWrapper">
				<div class="typed"></div>
				<canvas class="pad" width="400" height="150"></canvas>
				<input type="hidden" name="output" class="output"/>
			</div>
			<p/>
			${gs.getMessage('Filling in the following information will constitute your eSignature and will have the same legal impact as signing a printed version of this document.')}
			<div style="float:right">
				<button id='cancelSignature' data-dismiss="GlideModal" onclick="return onCancelSignature();" class="btn btn-default" style="margin-right:10px;">${gs.getMessage('Cancel')}</button>
			<button id='acceptSignature' onclick="return onAcceptSignature();" class="btn btn-primary">${gs.getMessage('Accept')}</button>
				<input type="hidden" id="btn_clicked" name="btn_clicked" value="none"></input>
			</div>
		</div>		
		
	</g:ui_form>

</j:jelly>
2 REPLIES 2

Chuck Tomasi
Tera Patron

The short answer is that the & character is messing you up. It's a special character in Jelly. You'll need to escape it to make it "safe". In phase processing, this is done with ${amp} and in phase 2, $[amp]

In invite you to review the videos we did on Jelly in TechNow episodes 1, 2, and 3.

TechNow Episode List

alexcharleswort
Tera Expert

Hey Chuck! Thanks for your response. I'm definitely going to go through those video (already most of the way through the first one).

I get what you're saying and I tinkered around with it a little more and found something that is a little odd to me.

In my code above I already have it escaped with <g:no_escape> and I have a win lose situation going on depending how I generate this ui page.

 

IF I AM IN THE UI PAGE EDITOR:

    If I leave it as <g:no_escape>${HTML:pa.u_body.getDisplayValue()}</g:no_escape> it gives me the error.

    If I change it to <g2:no_escape>${HTML:pa.u_body.getDisplayValue()}</g2:no_escape> it shows me the document exactly how I copy and pasted it, which is excellent and I thought my problem was solved.

 

BUT!!!!

 

IF I AM CALLING THIS UI PAGE FROM A UI ACTION (the end goal):

   If I leave it as <g:no_escape>${HTML:pa.u_body.getDisplayValue()}</g:no_escape> it shows me the error in the pop up.

   If I change it to <g2:no_escape>${HTML:pa.u_body.getDisplayValue()}</g2:no_escape> it shows me the html with all the tags in it.

 

So... I can't get it to work with the ui action unless I go in and replace all the (')s, (")'s and breaks...