Jump to content

Scripts and Pull Down Menus


This topic is 6602 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I did see reference some while ago to a technique that used a global a pause and a loop.

If I remember rightly (risky!!) A script was triggered on entry to the field which first stored the current contents of the field that holds the drop down menu into the global, then pauses for a short duration then checks if the global still matches the contents of the field. It keeps looping round until the contents of the field no longer match the contents of the global indicating that the user had made a new choice. It then exits the loop and does whatever was wanted.

Quite what it did if the field did not change I cannot remember but I mention all of this only because I think that maybe one can come out of a value list and trigger an event

When I looked at the sample file it worked but was very 'flashy' and a bit too distracting to be worth considering

I think this thread was in the FM Cafe

Sorry I cannot be more specific.

Phil

Link to comment
Share on other sites

To loop a script is not an elegant solution and totally not idiot proof.

You should need an errorCapture and userAbortOption while you

are not in a dialoge-window.

It requires to loop the script in the userinterface when idle ?

Meanwhile other solutions in fmpro wil slow down, if they wil work at all.

Therefore I prefere my second option.

Still working my way throug the plugin, wich seems to do just fine.

Although the plugin is Free, the documentation is quite summier.

You have to figure out how it works working your way through the

samplefile(s)

Quint

Link to comment
Share on other sites

On Windows, you can do exactly what you want without a plugin. I use this technique all the time with no adverse consequences. Make sure the field does not allow entry. The field must be formatted as a Popup Menu, not a Drop-down list!

AllowUserAbort(Off)

GoToField (fieldwithpopup)

Pause/Resume(1 sec)

Commit Record/Request

rest of script

The 1 second pause is necessary to cause the list to open.

Steve

Link to comment
Share on other sites

I use (used) it also. But attaching a script to popup menu can crash client in 8.0v1 so be sure you're on 8.0v2. We dropped back to 8.0v1 because of the regression issue and all my scripted popups began to crash us. The bug is documented in Tech Info.

But I love the technique and, being on windows, it DOES work a treat. BTW, I've tested in 8.0v2 and it works wonderfully again. I can't wait to move us forward again. In the meantime, I've had to switch to event triggers to fire them. :wink2:

Link to comment
Share on other sites

this looks great,

It does require a script to start in the first place ?

somethings puzzles me, For what purpose would you use this ?

For validation or a real action (complete script) after this field has been entered.

At first I thougt it would be for navigation purpose or something.

But I understand it is not 'just' a given field waiting to be entered?

Link to comment
Share on other sites

"It does require a script to start in the first place ?"

Since your turn off 'Allow Entry' to field, it must be clicked which activates the attached script. The script takes it from there, pausing for input, then finishing the script.

Example of its use: Every time someone changes data in a certain text field (the popup), I want to generate a new record (creating an activity for that person to do certain work), depending upon their choice. Script can have script parameter attached to grab the original value. After selection is made, script tests: If [ popupField = Script(Parameter), Commit and Halt, Else (do your new record stuff).

UPDATE: This ALSO works great with Go To Layout[] etc so can be used (and I've used it this way in vs. 6) for navigation. Just attach it to global text.

Edited by Guest
Added Update
Link to comment
Share on other sites

Thanks miss LaRetta,

With this info I could think of some purposes and maybe I will implement it

sometimes but for now I don't think I would use this technique.

I use zipscript to update a highlight in listview and watch a global-searchfield

When something entered in 'search', when exit the field auto search is

initiated.

The pulldown should work for me for navigation so I will keep it

in mind.

still curious where joseph will use this for.

Quint

btw, working on a mac, Will this work on mac also ??

or I could simply try it..... }:(

Edited by Guest
Link to comment
Share on other sites

Oh. No. Sorry Quint. For once, this is a Windows bonus. It would help if you updated your profile so everyone knows your OS and FM version. I would have responded differently knowing you were Mac. Well then, it's a good thing you probably wouldn't use it anyway. But you can use event triggers - you still have the script but you just wouldn't fire it from the popup itself.

I don't yet have a Mac so I haven't tested scripting on them with vs. 7 or 8.

LaRetta :wink2:

Link to comment
Share on other sites

It's also useful in a portal when you have a popup menu. Sometimes I'll use it only to cause the portal to refresh. In other cases, values that the user selected in the popup would cause me to chnage other fields. For example I have a Status Field and a Date Completed Field. When the user changes the Status to 'Completed', I automatically fill in the Date Field with the current date.

To make it work, attach the script directly to the field that's formatted with the popup.

Steve

Edited by Guest
Link to comment
Share on other sites

Well, I just tested it and indeed it didn't work as expected.

However a pause indevenetely will do but an physical enter has to be made

to resume the script.

Quint

/*I updated my profile as requested, love/*

Link to comment
Share on other sites

This topic is 6602 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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