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



Recent Blog Posts
8
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 […]
8
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 […]
9
Creating ICS Calendar Feeds with XPages
Tue, Apr 12th 2016 8:52a   Frederic Dehedin
An ICS Calendar feed can be used to exchange calendar data over the internet. It’s also known as iCalendar feed. ICS Calendar Feeds are supported by a vast amount of calendar clients such as Google Kalender / Android Kalender, Microsoft Outlook.. and of course IBM Notes. The main benefit is to provide calendar data in an open standard format, […]




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