Support Forum

Ask questions and get help from MobileTogether experts.
MobileTogether Product Information
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
mst  
#1 Posted : Tuesday, September 12, 2017 12:33:48 PM(UTC)
mst

Rank: Newbie

Groups: Registered
Joined: 9/12/2017(UTC)
Posts: 2
Denmark

Thanks: 1 times
I'm trying to create an app simulating a roll of a gaming dice. Basically on a button click an action generates a random number from a set range and stores it into a page source node which is displayed on a page in a label.

I found a random number can be generated using an xpath statement like this:
Quote:
fn:random-number-generator()?permute(1 to 6)[1]

The problem is that it seems to be working just once. Once the number is generated it doesn't change with the further button clicks. The same number is generated over and over again.

How could I achieve that a new number is generated every time?
AFC  
#2 Posted : Wednesday, September 13, 2017 6:48:08 AM(UTC)
AFC

Rank: Administration

Groups: Registered, Administrators
Joined: 9/15/2014(UTC)
Posts: 28
Austria

Was thanked: 3 time(s) in 3 post(s)
Hi mst,

Sorry, this is a bug, which will be fixed in the next version.
In the meantime and as workaround, you can use:
Quote:
fn:random-number-generator(fn:current-dateTime())?permute(1 to 6)[1]

Sorry for the inconvenience!


Altova MobileTogether Experts
thanks 1 user thanked AFC for this useful post.
mst on 9/13/2017(UTC)
mst  
#3 Posted : Wednesday, September 13, 2017 8:17:56 AM(UTC)
mst

Rank: Newbie

Groups: Registered
Joined: 9/12/2017(UTC)
Posts: 2
Denmark

Thanks: 1 times
That does the trick!
Thank you for the fast reply.
Users browsing this topic
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.