Ticket #414 (closed defect: fixed)

Opened 2 months ago

Last modified 2 months ago

JavaBean Array: Multi select list (String[]) is not stored correctly

Reported by: adrian.wyssmann Owned by: yoram.shamir
Priority: major Milestone: jsystem 5.6
Component: jsystem runner Keywords:
Cc: Regression:
Known Issue: NA

Description

Multi select list parameters are not stored correctly and thus cannot be retrieved.

Explanation:
I have a custom bean which contains a multi select list as one of it's parameter:

private String[] systemAlarms;

The bean is provided as an array in the GUI. I can select the select the elemnts in it and they are shown as I expect:
Clicking on [...] shows up a dialog box where I can select the options. Assuming I have four values

[ ] val1
[ ] val2
[ ] val3
[ ] val4

and I select the first three values and click [OK] the values in the field 'systemAlarms' is shown as follows:

val1;val2;val3

which is fine. But when I click on [Okay] to save the bean array this is messed up: The properties file shows a value like

[Ljava.lang.String;@54cc4d

And if I reopen the test parameter (bean array) the value in the field 'systemAlarms' is also [Ljava.lang.String;@54cc4d

Attachments

Jsystem01.png (6.3 kB) - added by adrian.wyssmann 2 months ago.
Jsystem02.png (2.8 kB) - added by adrian.wyssmann 2 months ago.
Jsystem03.png (1.9 kB) - added by adrian.wyssmann 2 months ago.
TestBean.java (0.7 kB) - added by adrian.wyssmann 2 months ago.
TestBeanCellEditorModel.java (1.0 kB) - added by adrian.wyssmann 2 months ago.
TestBeanTest.java (1.3 kB) - added by adrian.wyssmann 2 months ago.

Change History

Changed 2 months ago by adrian.wyssmann

Changed 2 months ago by adrian.wyssmann

Changed 2 months ago by adrian.wyssmann

Changed 2 months ago by nizan.freedman

  • owner set to yoram.shamir
  • status changed from new to reviewing

Added StringUtils?.advancedToString to be used instead of regular toString which is not suit for some objects

Changed 2 months ago by yoram.shamir

  • milestone changed from Future to jsystem 5.6

Changed 2 months ago by adrian.wyssmann

Not fixed. It still saves an address instead of the list values.

Changed 2 months ago by nizan.freedman

Fixed.
The issue was already fixed before but required the user to press "enter" or select a different parameter for value to be update.
please verify.

Changed 2 months ago by adrian.wyssmann

No way, I'm not able to get the values saved correctly, neither by pressing [Enter] nor selecting another parameter value.
I've attached my test class as an example.

Changed 2 months ago by adrian.wyssmann

Changed 2 months ago by adrian.wyssmann

Changed 2 months ago by adrian.wyssmann

Changed 2 months ago by nizan.freedman

Added another fix.
please verify again.

Changed 2 months ago by adrian.wyssmann

  • status changed from reviewing to closed
  • resolution set to fixed

Fix confirmed. This works great!

Note: See TracTickets for help on using tickets.