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.
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.
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:
I will insert it into the swing branch for review.
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.
, can your patch be integrated alone? or does it require the change to GridTable?
Closing this because of lack of maintainer for swing as plugin.
Labeled to keep it in mind in case a maintainer wants to review.