Generate UUID within component server-side JS file

Forum to discuss the new web client version of Servoy.

Generate UUID within component server-side JS file

Postby steve1376656734 » Sun Sep 17, 2023 1:09 pm

Hi,

I need to be able to generate a UUID within an NG client server-side component JS file (component_server.js). I have tried using application.getUUID() but the server-side JS has no access to the application object. Does anyone know how this may be done?

Thanks
Steve
Steve
SAN Developer
There are 10 types of people in the world - those that understand binary and those that don't
steve1376656734
 
Posts: 330
Joined: Fri Aug 16, 2013 2:38 pm
Location: Ashford, UK

Re: Generate UUID within component server-side JS file

Postby steve1376656734 » Mon Sep 18, 2023 3:30 pm

After a lot of searching in the Servoy GitHub repository I found that it can be done using:

Code: Select all
java.util.UUID.randomUUID()


This replaces the application.getUUID() call.
Steve
SAN Developer
There are 10 types of people in the world - those that understand binary and those that don't
steve1376656734
 
Posts: 330
Joined: Fri Aug 16, 2013 2:38 pm
Location: Ashford, UK


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 26 guests