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



Jul 26, 2011, 8:33 PM
14 Posts

Re: My last post on this issue ...

  • Category: Other
  • Platform: Not Applicable
  • Release: 8.5.2
  • Role: Developer
  • Tags: formatted text string new line wrapping
  • Replies: 17
Thanks so much for everyone's help!
 
I tried storing the formatted text in a Rich Text field.  The carriage returns displayed on the web, but spaces and bolding were added randomly.
 
So my final solution was:
 
1) In the Notes form, added Input Translation to the text field that replaced @NewLine with "<BR>" and blank spaces with "^"
 
2) In the Xpage, used a Computed Field (HTML) that replaced the "^" with a blank space.
 
var temp=AnalysisDoc.getItemValueString("Representation");
temp.replace("^", " ");
 
The formatting comes across perfectly now.
Jul 27, 2011, 7:38 AM
261 Posts
Re: My last post on this issue ...
Hello Sally,
 
It's good to read you found a solution that works for you, although I can imagine that changing the data itself isn't what you really want.
 
I just wanted to see for myself how this worked so I created a (Notes) form with a single text field (not multi-value), added some text with line breaks and displayed it in a computed field on an XPage (added the document as a data source and used doc.getItemValue to read the data in the computed field).
 
The solution you described in your fist post worked for me: there were no &nbsp; added at all and the line breaks were displayed correctly. Here's the code I've used:

    <xp:text escape="false">
        <xp:this.converter>
            <xp:customConverter>
                <xp:this.getAsString><![CDATA[#{javascript:@ReplaceSubstring(value, "\n", "<br />")}]]></xp:this.getAsString>
                <xp:this.getAsObject><![CDATA[#{javascript:@ReplaceSubstring(value, "\n", "<br />")}]]></xp:this.getAsObject>
            </xp:customConverter>
        </xp:this.converter>
        <xp:this.value><![CDATA[#{javascript:document1.getItemValue("name")}]]></xp:this.value>
    </xp:text>

 
 Mark
 
(BTW: I've used Domino/Notes 8.5.2FP3)
Aug 2, 2011, 6:15 PM
14 Posts
Mark's solution
Thanks, Mark!  When I saw your post I thought, "Haven't I already tried that combination?", but then tried it again, and it worked perfectly.
 
I'm new to Xpages, and think I lost confidence and started flailing around early instead of just calming down and figuring out the elements.
 
SO MUCH BETTER than messing with the data... thanx mucho mucho for taking the time to work through it and respond.
 
Sally

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