Page 2 of 2

Re: Servoy 6.1 rc 3

PostPosted: Fri Jun 15, 2012 2:45 am
by john.allen
Hi
I'm working on updating a solution from 5.2 to 6.1. I am using login/authentication which works fine in 5.2. However in 6.1 I have a problem with constructing a custom valuelist from a JSDataSet on authentication. The outputs from both are identical but when I use that dataset to construct my valuelist I'm getting a 'java.lang.NumberFormatException'. It seems it is expecting a number in 6.1 whereas in 5.2 it works fine.
Code: Select all
function RemoteWebClientDeveloper(remoteUser) {
   /** @type {JSDataSet} disease_groups*/
   var disease_groups =  security.authenticate('CCDB_AuthSolution', 'GetDiseaseGroupsForUser', [remoteUser])
   application.output(disease_groups);
   if(disease_groups) {
      application.setValueListItems('cvl_login_dis_grps',disease_groups);
      application.output(application.getValueListArray('cvl_login_dis_grps'))

The application.output for disease_groups is the same for 5.2 and 6.1, namely:
BufferedDataSet {Columnnames[DISEASE_GROUP_NAME, DISEASE_GROUP_ID, DEPARTMENT_ID, USER_ID]}
row_1[BLADDER, 1, 22, 1]
row_2[KIDNEY, 2, 22, 1]

The error I get in 6.1 when setting the valuelist is:
For input string: "BLADDER"
Wrapped java.lang.NumberFormatException: For input string: "BLADDER" (/Users/John/servoy_workspace6.1Oncology/CCDB_Login/globals.js#101)
at /Users/John/servoy_workspace6.1Oncology/CCDB_Login/globals.js:101 (RemoteWebClientDeveloper)

The form variable where the valuelist is used is a Number (1,2 in this example) but should display the text (BLADDER, KIDNEY). Again all works fine in 5.2 but not in 6.1
Has something changed with how custom valuelists are constructed or ordered in 6.1?

Re: Servoy 6.1 rc 3

PostPosted: Fri Jun 15, 2012 9:05 am
by sambit_cetmca07
Hi john,

/** @type {JSDataSet} disease_groups*/
var disease_groups = security.authenticate('CCDB_AuthSolution', 'GetDiseaseGroupsForUser', [remoteUser])


In your code you are expecting a "JSDataset" object in return, but in servoy 6.1 beta "authenticate" method returns a boolean value instead of any type object.

Re: Servoy 6.1 rc 3

PostPosted: Fri Jun 15, 2012 9:16 am
by Jan Blok
john.allen wrote:Wrapped java.lang.NumberFormatException: For input string: "BLADDER" (/Users/John/servoy_workspace6.1Oncology/CCDB_Login/globals.js#101)

Sounds like an issue, could you please file a case?

Re: Servoy 6.1 rc 3

PostPosted: Fri Jun 15, 2012 5:19 pm
by john.allen
Thanks Jan. I logged it (https://support.servoy.com/browse/SVY-2465).

It has to do with how 6.1 is handling JSDataSets in conjunction with setValueListItems. Extracting the JSDataSet columns as arrays and using those to populate the valuelist works. So in my case...
Code: Select all
application.setValueListItems('cvl_login_dis_grps',disease_groups.getColumnAsArray(1),disease_groups.getColumnAsArray(2))

works fine.