[izpack-user] [patch] Fix for multiFile validation bug

2 views
Skip to first unread message

Bram Van Dam

unread,
Nov 3, 2009, 3:55:38 AM11/3/09
to us...@izpack.codehaus.org
Howdy,

Problem: multifile validation fails when no files are selected and
allowEmptyValue is set to true. While validateFile() was implemented
correctly, validateField() was not. It, for some reason, assumed that
when no files are selected there would still be a null/empty propert
present..

Solution: See patch against trunk below.

Also, the multifile documentation is confusing. It should be corrected
to state that, for starters, the element is called multiFile with a
capital F and that the multipleVariables (and other properties) belong
on the <spec> element and not on the <field> element.

Have a nice day,

- Bram

Index: lib/com/izforge/izpack/panels/MultipleFileInputField.java
===================================================================
--- lib/com/izforge/izpack/panels/MultipleFileInputField.java (revision
2876)
+++ lib/com/izforge/izpack/panels/MultipleFileInputField.java (working copy)
@@ -243,7 +243,11 @@
public boolean validateField(){
boolean result = false;
int fileCount = model.getSize();
-
+
+ if (fileCount == 0 && allowEmpty){
+ result = true;
+ }
+
for (int i=0; i < fileCount; i++){
result = validateFile((String) model.getElementAt(i));
if (!result){

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Julien Ponge

unread,
Nov 4, 2009, 4:01:29 AM11/4/09
to us...@izpack.codehaus.org
Thanks for posting a JIRA issue, I will handle it.

--
http://izpack.org/
http://jpz-log.info/
http://julien.ponge.info/

Bram Van Dam

unread,
Dec 3, 2009, 4:49:30 AM12/3/09
to us...@izpack.codehaus.org
Hi again,

I'm getting the impression that my bugfix has not (yet?) been included
in the latest version -- at least not in the maven plugin, haven't
tested the stand-alone version.

Are there any plans for a new release any time soon? It's a pretty
annoying bug and I'd really like to be able to use the maven version
without having to do nasty trickery.

Thanks a bunch,

- Bram

On 04/11/09 10:01, Julien Ponge wrote:
> Thanks for posting a JIRA issue, I will handle it.
>
> On Tue, Nov 3, 2009 at 9:55 AM, Bram Van Dam<bram....@cronos.be> wrote:
>> Howdy,
>>
>> Problem: multifile validation fails when no files are selected and
>> allowEmptyValue is set to true. While validateFile() was implemented
>> correctly, validateField() was not. It, for some reason, assumed that when
>> no files are selected there would still be a null/empty propert present..
>>
>> Solution: See patch against trunk below.
>>
>> Also, the multifile documentation is confusing. It should be corrected to
>> state that, for starters, the element is called multiFile with a capital F
>> and that the multipleVariables (and other properties) belong on the<spec>
>> element and not on the<field> element.
>>
>> Have a nice day,
>>
>> - Bram

---------------------------------------------------------------------

Julien Ponge

unread,
Dec 3, 2009, 1:47:46 PM12/3/09
to us...@izpack.codehaus.org
Hi,

It's in the pipe!

There will be a maintenance release before the end of the month.

Cheers

--

---------------------------------------------------------------------

Julien Ponge

unread,
Dec 3, 2009, 3:52:31 PM12/3/09
to us...@izpack.codehaus.org
Fixed!
Reply all
Reply to author
Forward
0 new messages