Rank: Newbie
Groups: Registered
Joined: 9/12/2017(UTC) Posts: 2  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?
|
|
|
|
Rank: Administration
Groups: Registered, Administrators Joined: 9/15/2014(UTC) Posts: 140  Was thanked: 18 time(s) in 18 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
|
 1 user thanked AFC for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 9/12/2017(UTC) Posts: 2  Thanks: 1 times
|
That does the trick! Thank you for the fast reply.
|
|
|
|
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.