April 22, 200916 yr Hello, Last summer at the DEVCON, I was pleased to be introduced to ScriptMaster plugin. I've recently been testing it in order to use it in a production environment. All works as expected on OSX 10.5.6. The problem arises on the Windows platform. None of the examples that require user interface windows (dialog boxes, file chooser dialog, color picker dialog, JDialog objects, etc.) will work as expected. The main problem is the fact that the modal state is not preserved on Windows. Well it actually is preserved regarding the user's input, but the modal windows/dialogs shift to the background if the user clicks on FileMaker. Then the user is lost, FileMaker waiting for a validation of the dialog box, and the user not seeing the dialog box... Am I missing something here ? I didn't find any details on this topic on the forum. Configurations tested FileMaker Pro 9 and 10 Java version 1.6.0_13 Windows XP SP2 and SP3 This issue is important, as all Swing modal dialogs aren't usable on Windows platform. Thank you for your reply, Francis
April 28, 200916 yr Bonjour Francis We have the exact same problem and never got it to work. I posted the question but no one answered. http://fmforums.com/forum/showtopic.php?tid/197654/
July 31, 200916 yr Turn your frown upside down. After beating my head against this problem on Vista, I found a following workaround to get the modal dialogs based on JOptionPane (FileDialog, etc.) to display. Unfortunately this workaround breaks the Macintosh version so you need to code differently on each platform. (So much for Java's portability.) The key is to use FileDialog(JOptionPane.getRootFrame(),title); on Macintosh. This is what is normally recommended. And use FileDialog((Frame)null, title); on Windows. In my tests using Java 6 Standard Edition on Vista (build 1.6.0_14-b08), this reliably brought up the modal dialog on top of the FileMaker window instead of being hidden behind. This code causes an error on a Mac running Mac OS X with all the updates. (I think the latest is Java 5.) This may be the difference between Java 6 and Java 5 or differences between the Windows and Mac builds of Java or ScriptMaster for some reason. I dunno. I'm just pleased to get something working. In the case of the File Chooser Dialog, I coded it with an additional parameter "isWindows". Choose File (isWindows) // use "true" or 1 or something when Windows and leave blank otherwise import java.awt.*; import javax.swing.JOptionPane; FileDialog dialog; String title = "Example File Chooser"; if (isWindows == null) { dialog = new FileDialog(JOptionPane.getRootFrame(),title); } else { dialog = new FileDialog((Frame)null, title); } dialog.show(); if (dialog.getFile() != null) { return dialog.getDirectory() + dialog.getFile(); } else { return 0; } Edited July 31, 200916 yr by Guest Added code sample
September 25, 200916 yr I tried TheTominator's workaround for Win XP: dialog = new FileDialog((Frame)null, title); Sorry, but it doesn't work for me. I'm using FM 10 Advanced on Win XP SP3 and as far as I can tell, even with the workaround, ALL of the modal dialog functions like SelectFile or FormattedDialogWithDynamicButtons just crash FM if the user clicks on the FM app anywhere outside the modal dialogs. The program just freezes. Scriptmaster seems like a pretty cool idea, and apparently work fines on a Mac, but these guys don't seem to be doing much testing on Windows machines. Too bad.
September 28, 200916 yr I've been testing the Select File script on XP, Vista, and Windows 7 without any trouble. I will pass this information on to the developers for them to look at as well. Are you all using the most up-to-date version of java? My machines are all updated though windows update and using Java 6.
November 15, 200916 yr The problem appears to be when you have the database window maximized. If I have the window maximized then the script master modal dialogs (like the file chooser) show up behind the filemaker windows. If the database window is not maximized then it appears to behave normally. I agree that this is pretty useless on windows. Anyone have any suggestions?
November 16, 200916 yr I have been able to reproduce the pop up behind issue issue with the "Select File" module. The "Choose Folder" module does not have this issue as it uses a different java class to generate a prompt, so it seems to be specific to that class. Choose Folder can be used to select files by changing the "JFileChooser.DIRECTORIES_ONLY" parameter to "JFileChooser.FILES_ONLY" or "JFileChooser.FILES_AND_DIRECTORIES" on line four of the module. I hope this solution will work for you. Edited November 16, 200916 yr by Guest
November 17, 200916 yr It looks like that is going to work great. The behavior of the choose directory on the mac is not very good but I can use this to get around the issue on the PC and if it is on a mac still use the choose file command. Thanks for your help!
February 5, 201015 yr Hey, I know this is an old thread but this is now fixed in ScriptMaster version 3.31.
September 28, 20169 yr Hello I just tested the follwoing snippet I found somewhere on the internet. I am on windows 7. The gui opens in the background. I'd like to understand why Please I tested Scriptmaster 4.205 Is there a way to make it stick to the foreground? import groovy.swing.SwingBuilder; import java.awt.FlowLayout; swing = new SwingBuilder(); gui = swing.frame(title:'Test 2', size:[400,200]) { panel(layout:new FlowLayout()) { panel(layout:new FlowLayout()) { for (name in ["Tom", "Dick", "Harry", "Bill"]) { checkBox(text:name); } } panel(layout:new FlowLayout()) { comboBox(items:["Red", "Green", "Blue", "Orange"], selectedIndex:2); } } } gui.show(); Edited September 28, 20169 yr by Electric_Soul
Create an account or sign in to comment