Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Turning a pop-up menu into enter mode?


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

Recommended Posts

Posted

I have 2 pop-up menus with that are non-enterable in browse mode. Is there a sciprting function I can use to turn these to enterable after the user clicks a button. Basically want to be able to set Field Behavior:Allow user to enter:in browse mode = true. Is this possible?

Thanks,

-G

Posted

I wouldn't create another layout just because of this need. If you change one layout, you'll always be having to change the 'shadow' layout also. And, so Users can't tell you have switched them, you must make sure that if you move something on one layout you duplicate precisely the move on the other layout also. It's a pain in the neck.

You might instead consider: Create a global number field (gToggle) and attach a script-step to it of: Set Field [ gToggle; Abs(gToggle) < 1 ]

Then attach following script to popup1:

If [gToggle] or Get(WindowMode)

Go To Field [popup1]

End If

Repeat with your second popup. Click toggle, both popups can be entered in Browse even if Field Behavior is set to not allow entry. Click button again and they can't be entered. But they can be entered in Find Mode whether the toggle is on or off. And it will apply to all records until the toggle is again clicked off. You can get fancy and place a text calculation (set to not allow entry) on top of the toggle button showing the state of popup entry, such as:

If(gToggle; "On"; "Off")

This same toggle can be used in Access Privileges if you wish; or the toggle button can be on another layout, or restricted on who can toggle it and it can even be based upon other calculations or field conditions. If you want the toggle to only apply to one specific record, instead of releasing popups for all records for that User session, use a standard number field instead of a global for the toggle.

Posted

Thank you MoonShadow!! I have already run into the problem of the menus not lining up...kinda frustrating. I will try your method. Seems like it may take me a while to figure out though. I'll get back to you.

Posted

I just noticed you are Mac. Popup menus may not perform the same when scripts are attached for your OS. You may want to consider a popup list instead if you run into problems, ie, the popup menu won't stay open, etc. I've never used Mac.

Posted

This isn't gonna work; I don't even know how to attach a script-step to my global field.

Don't let it discourage you, we'll get through it. smile.gif

You don't attach the script directly to the global field, sorry I wasn't clear enough. When I said 'attach a script-step to it' I mean the button. You attach the gToggle script to the button itself which (behind the scenes) sets your gToggle global field. I can provide a simple demo file if you wish - just say the word. smile.gif Once you see it in action, it'll all become clear for you.

Posted

OK, I setup the button as follows:

Set Field [ Global::_gToggle; Abs(Global::_gToggle) < 1 ]

How do I set a script to my pop-up menu. Would I have to do that on the layout load from the previous layout or put it in the auto-enter calculation maybe?

Thanks for all your help!

Posted

You just attach the popup script directly to the popup. Right-Click and select Specify Button and Perform Script > attach your popup script there. And be sure Field Behavior on the popups don't allow entry. That will happen (and be allowed) when the User clicks the popup. Your script will take over and let them in if 1) Your button toggle is set to 1 or 2) They are in Find Mode when they try to pop it.

Posted

Ah I see know. I still cannot get it to work but that is OK. I went with the duplicate layout instead because I actually don't want the pop-up menus to even be seen. Cause if click on the pop-up menu without entry allow selected you still get an error dialog stating that there are no records available. So I think the duplicate layout is what I want unless there is a function to hide pop-up menus?

Thanks a mil!

Posted

I'm actually going to try doing this. I was told that you can hide and show pop-up menus within a Portal. I will try this and let you know how it ends up. Please anyone let me know if you have any ideas for this. Thanks!

Posted

Cause if click on the pop-up menu without entry allow selected you still get an error dialog stating that there are no records available.

You mean when you are finding? You need Set Error Capture [On] and include a script-step to handle it, if no records are found. The process I outlined for that popup does indeed work so if it isn't working, something else must be going on. You indicate the global with :: ... what kind of relationship are you working with?

You didn't say what doesn't work!? Yes, you can use invisibility to hide the popup - but how will Users use it if you hide it and how will a duplicate layout solve this problem for you? I'm afraid, unless you explain more, we can't help you with any specifics. Please remember that we can't see your solution and only know what you specifically tell us. But that's okay, as it seems you've now changed what you want to do anyway? wink.gif

Posted

Basically I am setting up conditional pop-up menus. And I want each menu to appear or hide depending upon what was selected in the previous pop-up menu. This GUI I am building is having to do with Applications. you can select applications to asign to a client. You would first select the Application name from a pop-up menu. Then the version pop-up menu only shows the verions of the application that you have selected in association to my applications database. Next you choose a serial number, and this also lets you know how many seats are left per serial number. If the serial number is an upgrade I want an upgrade version, serial number, seats, seats left, current serial number and version pop-up menus to appear. So now the user can select a serial to upgrade from. If the serial number select is new then the client will not see the upgrade pop-up menus. Everything is working but currently I am going to another layout with the added upgrade menus. I just want to be able to hide or show the upgrade menus in browse mode. Supposedly you can do it with a portal? Please let me know if you need more details or have any questions. Thank you!

Posted

Yes, you can do it with a portal. You want a calculation field of Case( {serial = upgrade}; serial ), where {serial = upgrade} is whatever test you are using to determine when it's an upgrade. Create a relationship from this calculation to the serial field. Then put a portal on your layout using this relationship and put the menu fields inside it.

Posted

There are sample files on databasepros.com. But I am unaware of any tutorials on the technique. I have learned it through trial and error.

Posted

It isn't the easiest of techniques to get one's head around. So don't beat yourself up about it. With which parts are you having difficulty?

Posted

I have looked at these examples for another 2 hours this morning. They still do not make any sense to me. I cannot find any relations between the buttons and what is being hidden or shown. The only thing I can find is the calculation ::=constant relation. And that is not even tied to the any of the buttons which preform the script or any of the fields that are being hidden or shown. So the whole thing is a confusion because I don't know where to begin. I even bought a $45 book and that has no examples either...argh!!

All I want is to be able to hide or show a pop-up menu based on another pop-up menus results.

Posted

So far I have setup:

Field = _gUpgrade

Type = Text

Options = Global, w Auto-Enter Calc

Field = _gCondCal

Type = calculation

calculation = Unstored, from Global, = Case ( _gUpgrade="upgrade" ; IsEmpty ( _gVersionUpgradeFrom ); ""; 1)

I'm not really sure what to put for a result??

I have also made a relation between these 2.

In my layout I have a portal set to this relation.

I have 5 pop-up menus with this portal. Application, Version, Serial, Upgrade, VersionToUpgradeFrom.

Based on the Upgrade pop-up menu I want the VersionToUpgradeFrom pop-up menu to hide or show: If Upgrade pop-up menu contains "upgrade"

then show VersionToUpgradeFrom pop-up menu

else

hide VersionToUpgradeFrom pop-up menu

end if

Do i need to attach anything to these pop-up menus or do I only need the realtion set in the portal?

Thank you!

Galen

Posted

I wouldn't use the constant result version. It can take long awhile to calculate when there are hundreds to thousands of records. I would use the serial result, as stated earlier. Make your non-global calc Case( _gUpgrade = "upgrade" and not IsEmpty(_gVersionUpgradeFrom); serial ) and relate this to the serial for each record. You definitely don't want it to be global or it will show the same result for all records until you modify one.

Put a portal on your layout that displays one related record, using this relationship . Anything you put in the portal will only display when the relationship is valid (your calculation returns the serial).

Posted

Neither the calculation nor the serial should be global. You want it to recalculate and be unique to each record. The calculation cannot be stored because it references globals.

Posted

I finally figured this out. I made a calculation in my global table but not a global variable of:

_gupgrade = "upgrade"

And another indexed calculation in my global table but not a global variable of:

1

Both of these calculations reside in my Global Table but they are not global fields. Only reference Global variables.

Then I made a relation from the calculation to the indexed calc and set the portal to this, added my menus, and created a new record. And it worked!!!

Thank you for all your help Queue!!

This topic is 7337 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.