VBinary improvement for swing client + bugfix in GridTable

Description

The binary datatype in the swing client is very limited. This can be seen in the System Image window. Once you load an image and save it, the field only allows you to save the image back instead of loading another image. If you accidentally saved a wrong image you are not able to correct it.
I made some little changes to VBinary.java and GridTable.java to solve this problem. The binary datatype now consists of two buttons, an open and a save button.

If no binary is stored, only the open button is active. After a file is opened, the save button becomes active. Now the user can either open another file or save back the stored file to the file system. To delete a file, click the open button and cancel the FileChooser.

Another thing is the bug in GridTable. About line 2110 in the method dataSavePO(int Record_ID) there is an if-statement where a POs value is compared agains the database. The comparison only consists of "==" and ".equals()" but if we have a binary datatype our value is a byte arra (byte[]) which fails if we try to compare it with == or equals. So i added another two or-clauses to the if statement which checks the value class and compares byte arrays with Array.equals(). This change is also necessary for https://idempiere.atlassian.net/browse/IDEMPIERE-612 because otherwise we wouldn't be able to change icons more often than once.

Environment

all

Activity

Show:
Carlos Ruiz
February 19, 2013, 12:25 AM

https://bitbucket.org/idempiere/idempiere/commits/c2c5dbd

Hi, I committed a slightly modified change for GridTable.java

  • added validations to avoid NPE

  • changed the order of datarefresh to show the error to the user

Please check the swing part with Thomas.

Regards,

Carlos Ruiz

Thomas Bayen
February 20, 2013, 6:09 AM

Carlos committed only the bugfixing part outside of the swing directory to trunk. This changeset contains the same code as my other but only the part in the swing directory:

https://bitbucket.org/tbayen/idempiere/commits/6c51f73c85584d598f303189aa8ca6d4f7545017

I will insert it into the swing branch for review.

Thomas Bayen
December 30, 2013, 1:54 PM

While doing Bug Triage I reviewed this issue. I changed some minor things and did a new patch that works with the actual version. The given patch is to be be reviewed by all interested people and this should be included into trunk soon.

Carlos Ruiz
March 5, 2014, 2:24 PM

, can your patch be integrated alone? or does it require the change to GridTable?

Carlos Ruiz
July 11, 2018, 1:11 PM

Closing this because of lack of maintainer for swing as plugin.
Labeled to keep it in mind in case a maintainer wants to review.

Assignee

Thomas Bayen

Reporter

Jan Thielemann

Tested By

None

Components

Affects versions

Priority

Major
Configure