Enable/disable buttons

This is probably simple to do…I am fairly new at this.

What I need to know is, how do I set a button to be disabled on one window if something is not entered in a field from another window?

For example: On one window an operator name is to be entered, if it is not, buttons on a different window need to be disabled until a name is entered.

Well, as you probably noticed, you can’t do direct databindings across windows (because, after all, you have no guarantee that both windows will be open at the same time)

I recommend creating a Client SQLTag that represents whether or not the button(s) should be enabled. Bind the enabled property of your button to this client tag.

Then use scripting in the window with the text box to update the client tag. For instance, if you wanted the bit to be enabled if there was anything (more than zero characters) entered in the textbox, you’d put a script like this on the textbox’s propertyChange script:

if event.propertyName=='text': newName = event.newValue fpmi.tag.writeToTag("[Client]ButtonsEnabled", len(newName)>0)

Hope this helps,