199 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 11
Winning the IBM Collaboration Solutions Developer Competition 2016
Mon, Oct 3rd 2016 10
Creating ICS Calendar Feeds with XPages
Tue, Apr 12th 2016 12
3 XPages hints #3: Homepage and Performance improvements
Mon, Feb 29th 2016 10
Travelling 2.0: How your smartphone can assist you travelling easier and cheaper
Fri, Jan 15th 2016 10
Leaving the yellow bubble for a while
Sun, Jun 7th 2015 9
Simple way to make certain elements sticky in your web application (XPages example using OneUI)
Sun, Apr 19th 2015 8
Top 10
Creating ICS Calendar Feeds with XPages
Tue, Apr 12th 2016 12
Tipps and Tricks for the Java SE 8 Programmer Exam
Sun, Dec 11th 2016 11
How to use the OneUI V2.1 Framework without ExtensionLibrary
Thu, Apr 5th 2012 10
XPages: Handling disabled Checkboxes
Thu, Mar 26th 2015 10
Travelling 2.0: How your smartphone can assist you travelling easier and cheaper
Fri, Jan 15th 2016 10
3 XPages hints #3: Homepage and Performance improvements
Mon, Feb 29th 2016 10
Winning the IBM Collaboration Solutions Developer Competition 2016
Mon, Oct 3rd 2016 10
3 XPages hints #2
Wed, Apr 30th 2014 9
Leaving the yellow bubble for a while
Sun, Jun 7th 2015 9
My top 5 wishlist for IBM Notes / IBM Domino Designer, which ones are yours?
Wed, Aug 6th 2014 8


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
7 hits



Recent Blog Posts
11
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 […]
10
Winning the IBM Collaboration Solutions Developer Competition 2016
Mon, Oct 3rd 2016 12:23p   Frederic Dehedin
Just yesterday we came back to Switzerland after our 3 Weeks holidays in Indonesia. We were in Bali, Nusa Lembongan (Island next to Bali) and Rote Island (Timor). So on the 16. September 2016, after a beautiful day on the boat diving with Manta Rays, i was eager to check the contest results and received […]




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