LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

File Dialog Issue identified in LV 2010

OK I was bitten by this apparent bug. and as far as I can search this exact issue is not discussed.

 

When using the file dialog in LV2010 on either WIn7 or XP machine to create a unique filename

the following will occur when a file is first selected then an edit is made to its name in the filename field of the dialog and then

a white area in the window is clicked..

 

If a user clicks on a white area in the window to change the focus off of the File name field and then presses OK the contents of the file name field will NOT be returned.

 

By the way It is not reasonable to assume that an end user would never do such a thing.

 

I did not catch this inconsistency and have fallen to its bite.

This particular case is not handled by the file dialog and it has brought danger and embarresmant by permitting a user to unwittingly overwrite important prior files that exist in the directory. It is my fault for not catching this but what is the work around?

 

 

To see this bug every time just wrap  a file dialog in a simple VI and connect an indicator path to the output

 

Go into any directory has some files and folders in it, yet some extra white area that could be clicked.

Select any file. It will fill the file name field.

 

Edit the file name field to make the fileneme slightly different

 

Click on the white area of the dialog window to shift the focus off of the filename field

 

Press OK and view the result. Is it what you asked for?

 

 

0 Kudos
Message 1 of 6
(2,430 Views)

Tested in 2012 and 2013 in Windows 7 and both seem to work as expected with the VI you provided.  I browsed to a folder where there was only one file, clicked the file, then changed the name in the field at the bottom to have a different name (with a "2" in it) then clicked the white space under the file name, then clicked OK.  The selected file was my renamed file name with the 2 in it.  What is the result you are seeing?

0 Kudos
Message 2 of 6
(2,421 Views)

WHat is happening (I think ) in LV2010 is that when the white area is clicked the dialog accepts a null, thus the contents of the file dialog filename field is not transferred when clicking OK.

 

Instead  the original file that was selected before the edit is transferred.

 

I have not tested in 2012 or 2013.

 

 

 

 

 

0 Kudos
Message 3 of 6
(2,413 Views)

I just tested in 2012 and it does not happen. Apparently fixed in 2012.

 

I kind of wish there was a way to mitigate this fix back into 2010. A complete upgrade to 2012 is not readily available as an option (not without a lot of headache anyway.)

 

 

0 Kudos
Message 4 of 6
(2,412 Views)

I got a chance to test it on 2011 SP1 and it works as expected.

0 Kudos
Message 5 of 6
(2,379 Views)

Thanks Hooovahh

 

 

I was hoping someone may have encountered this and make some kind of work around since it has been there since 7.1.

 

 

0 Kudos
Message 6 of 6
(2,362 Views)