This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Mar 21, 2012, 4:12 PM
12 Posts
topic has been resolvedResolved

Stop Xpages closing html tags automatically?

  • Category: Other
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: Automatic,html tags,prevention
  • Replies: 2
 Hello,
 
I'm looking for a way that I can stop XPages from automatically closing html tags that I add.  I know this sounds strange, but there's a reason for this and I won't go into that for the moment in the interests of trying to keep the post shorter, simpler and to the point.
  
What I would like is to do is have a computed text field output the following html markup:
<div id='1'>
          <div id='2'>"
 
The computed field escape property is set to "false" (this way it renders the "<" and ">" correctly instead of making the "&gt" or "&lt" by wrapping everything in a span).
 
When this page is rendered to the browser, XPages automatically closes the tags even though I haven't typed them.  So in the web browser it will render:-
<div id='1'>
          <div id='2'>"
          </div>
</div> 
 
Is there anyway I can prevent the XPages from closing the tags automatically or is there anyway I can write my own html and XPages will not do anything other than sending it to the browser (effectively pass-thru)?

I have tried disabling the theme and removing the ID of the computed field as some posts have suggested, but this hasn't prevented XPages from automatically closing those tags. 
 
Thanks in advance as always, I really appreciate anyone's input in on this.  
 
 
 
 
 
 
Mar 21, 2012, 7:02 PM
10 Posts
Re: Stop Xpages closing html tags automatically?
The Computed Field control will not automatically close tags. It will output exactly what you tell it to so I think you are doing something wrong.
 
The following will produce exactly what you want (with no closing div tags): 

<xp:text escape="false" disableTheme="true">

<xp:this.value><![CDATA[#{javascript:

var html = "<div id='1'>\n"

html = html + "<div id='2'>";

return html;}]]></xp:this.value>

</xp:text> 
Mar 26, 2012, 9:40 AM
12 Posts
Re: Stop Xpages closing html tags automatically?
Thanks for the reply.  You're quite right and I've found the source of my confusion.  It looks like when you use the "inspect element" tool in Google Chrome, it automatically closes off tags if they're not already done so.  If I look in source, things are how they should be.
 
Now if only I can figure out how to stop xpages adding extra divs when I use custom controls or xp:include.
 



This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal