198 Lotus blogs updated hourly. Who will post next? Home | Blogs | Search | About 
 
Latest 7 Posts
Tipps and Tricks for the Java SE 8 Programmer Exam
Sun, Dec 11th 2016 6
Winning the IBM Collaboration Solutions Developer Competition 2016
Mon, Oct 3rd 2016 5
Creating ICS Calendar Feeds with XPages
Tue, Apr 12th 2016 4
3 XPages hints #3: Homepage and Performance improvements
Mon, Feb 29th 2016 3
Travelling 2.0: How your smartphone can assist you travelling easier and cheaper
Fri, Jan 15th 2016 8
Leaving the yellow bubble for a while
Sun, Jun 7th 2015 1
Simple way to make certain elements sticky in your web application (XPages example using OneUI)
Sun, Apr 19th 2015 5
Top 10
Travelling 2.0: How your smartphone can assist you travelling easier and cheaper
Fri, Jan 15th 2016 8
Get rid of the agent property “Target documents – all new & modified documents”
Tue, Jan 3rd 2012 6
Displaying fancy loading indicator while loading AJAX
Fri, Nov 11th 2011 6
XPages: Handling disabled Checkboxes
Thu, Mar 26th 2015 6
Tipps and Tricks for the Java SE 8 Programmer Exam
Sun, Dec 11th 2016 6
Resolve time difference in hours and minutes of two date/time values
Wed, Aug 17th 2011 5
Cross-wise MouseOver Highlight of table row, column and cell
Sun, Jul 31st 2011 5
Simple way to make certain elements sticky in your web application (XPages example using OneUI)
Sun, Apr 19th 2015 5
Winning the IBM Collaboration Solutions Developer Competition 2016
Mon, Oct 3rd 2016 5
Creating a test environment: the easy way
Tue, Jun 3rd 2014 4


Format a number in xp:link
Twitter Google+ Facebook LinkedIn Addthis Email Gmail Flipboard Reddit Tumblr WhatsApp StumbleUpon Yammer Evernote Delicious
Frederic dehedin    

I just came across a problem where i wanted to display formatted numbers which are links (In this case in a repeat control).
How can i format the number here? The usual way is like this: 

<xp:text escape="true" value="#{figureItem.amountRounded}">
	<xp:this.converter>
		<xp:convertNumber pattern="#,##0"></xp:convertNumber>
	</xp:this.converter>
</xp:text>

So it gives me an output like “134’222″..
When i want to do the same in clickable links (xpages xp:link tag), i tried it like this:

<xp:link escape="true" value="javascript:refreshDetails()"
	text="#{figureItem.amountRounded}">
		<xp:this.converter>
			<xp:convertNumber pattern="#,##0"></xp:convertNumber>
		</xp:this.converter>
</xp:link>

Altough Domino Designer lets me compile this, it doesn’t format the number values..

So what to do? I already posted recently a NumberConverter Function Object here: http://www.fdehedin.ch/91/convert-number-to-string-to-number
If you place that in an SSJS Library, you can format the numbers in a link like this:

<xp:link escape="true" value="javascript:refreshDetails()"
	text="#{javascript:NumberConverter.numberToString( figureItem.amountRounded, '#,##0')}">
</xp:link>


---------------------
http://www.fdehedin.ch/168/format-a-number-in-xplink
Oct 04, 2011
2 hits



Recent Blog Posts
6
Tipps and Tricks for the Java SE 8 Programmer Exam
Sun, Dec 11th 2016 4:17p   Frederic Dehedin
Recently i studied for the Java SE 8 Programmer I Exam (Java OCA for short) and was glad that i passed it on the first go. Although i’ve been practicing programming in Java several years, i decided to sustain my practical knowledge with some theoretical background and i’m happy to share my experience in this blog […]




Created and Maintained by Yancy Lent - About - Planet Lotus Blog - Advertising - Mobile Edition