Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

fmpro.performScript does not work

Featured Replies

Hi,

I like to call call the "actionPerformed" of the button a FileMaker script in the following code

This does not work!

What am I doing wrong?

Thanks for your help

CODE:

import javax.swing.*;

import java.awt.event.*;

new FensterWegImplementsAll();

class FensterWegImplementsAll extends JFrame implements WindowListener, ActionListener

{

public FensterWegImplementsAll()

{

setLayout(null);

setSize( 400, 400 );

addWindowListener( this );

setVisible( true );

JButton btn_1 = new JButton("TOC");

btn_1.setBounds(10,10,100,25);

btn_1.addActionListener(this);

add(btn_1);

}

public void windowClosing( WindowEvent event ) {

dispose();

}

public void windowClosed( WindowEvent event ) {}

public void windowDeiconified( WindowEvent event ) {}

public void windowIconified( WindowEvent event ) {}

public void windowActivated( WindowEvent event ) {}

public void windowDeactivated( WindowEvent event ) {}

public void windowOpened( WindowEvent event ) {}

public void actionPerformed(ActionEvent event)

{

fmpro.performScript("ScriptMaster","TOC","");

}

}

I believe your problem is the fmpro object does not exist in the scope of your class.

You can pass the fmpro object to your FensterWegImplementsAll object when you create it; then the actionPerformed method needs to use the fmpro object that was passed into your class.

  • Author

I believe your problem is the fmpro object does not exist in the scope of your class.

You can pass the fmpro object to your FensterWegImplementsAll object when you create it; then the actionPerformed method needs to use the fmpro object that was passed into your class.

Thanks it functions. But now i have the same problem like in this Thread:

http://fmforums.com/forum/topic/74209-fmpro-object-taking-a-long-time-to-respond/

The fmpro Objekt d'ont respond regulary!

Did you have a solution for this problem?

Thank you very much!

I am using the fmpro object similar to how I suggested in my last post, except that I compiled my code into a jar file. I haven't had any problems like mentioned in the post you linked to.

  • Author

Hello dansmith65,

thanks for your answer.

I compilet my code / class in a Jar-File as you sad.

In Filemaker i just use the following call to make an instanse of my class:

CFMMenue fen = new CFMMenue(fmpro);

and i have the same problem! Filemaker d'ont respond sometimes and sometimes takes a lot of time bevore executing the called Filemaker-Script.

Did you an idea about this problem? or another solution?

The background is to make a bether dynamic navigation of our filemaker solution (f.e.: with JTree).

Thanks for your help !

I hadn't connected it before, but I think I actually did experience a similar issue. I was able to resolve it by setting thread priority: http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Thread.html

With default priority (6), the process I was running could be delayed by a half hour or more when FileMaker was not the active window. When FileMaker was active, it typically responded with little delay.

Try setting it to 9 and see if that works for you.

  • Author

I hadn't connected it before, but I think I actually did experience a similar issue. I was able to resolve it by setting thread priority: http://download.oracle.com/javase/1.4.2/docs/api/java/lang/Thread.html

With default priority (6), the process I was running could be delayed by a half hour or more when FileMaker was not the active window. When FileMaker was active, it typically responded with little delay.

Try setting it to 9 and see if that works for you.

I used a Thread und set the priority with different values.

But i habe always the same problem :(

another idea ?

thanks!

Sorry, that's the last trick up my sleeve.

Have you tried Filemaker 11 ?. Maybe it works properly in that.

Or maybe try not invoking from the EDT, so run it from a new Thread?

I dunno, I haven't solved it yet. I reckon what would be super cool too would be if you embed your JTree into a filemaker container rather than as a separate window...

  • 2 weeks later...
  • Author

Have you tried Filemaker 11 ?. Maybe it works properly in that.

Or maybe try not invoking from the EDT, so run it from a new Thread?

I dunno, I haven't solved it yet. I reckon what would be super cool too would be if you embed your JTree into a filemaker container rather than as a separate window...

i tried with Filemaker 11 and had the same problem.

But now i know the problem :-)

I was working with a Window 64 Bit version and that was the problem!

With Windows 32 Bit it is working just fine :-)

Your idea with the FM container is nice too, i will try it.

Thansks!

I reckon what would be super cool too would be if you embed your JTree into a filemaker container rather than as a separate window...

Did someone succeed in this?

As I can see from the documentation of ScriptMaster this would mean we would need to create some kind of FM Object or a File, all the other types would return or a simple String, Image or Number.

Did someone succeed in this?

As I can see from the documentation of ScriptMaster this would mean we would need to create some kind of FM Object or a File, all the other types would return or a simple String, Image or Number.

It isn't possible as far as I know... but it would be cool if it was possible :).

The only way I thought of doing it was loading an applet in a web viewer... but then there are probably a million problems with that :). I've tried tracking the windows in filemaker and then rendering a frameless window over the top, but that also proved too complicated :).

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.