You can change the appearance of an object onHover but there isn't a script trigger associated with it. You may have to trap the onEnter trigger, do your stuff, then come back to the field. Remember to setup a flag of some kind so that you don't have to repeat the onEnter loop when you return to the field. Sounds clumsy doesn't it?
a user does not "enter a portal". A user might enter a field belonging to a specific portal, and with a OnObjectEnter you might trigger a script to which you pass List( Get(ActiveFieldTableName); Get ( ActiveFieldName ); Get ( ActiveLayoutObjectName )) as a parameter, then decode it.
Do you use FireFox? I get the same "bouncing text" headache any time the text that I type gets to a certain size. Very annoying.
Since you are using two portals, have you considered bypassing the whole issue by putting the two portals inside different panels of a tab or slide control? Then the script trigger tripped by selecting a tab or slide control panel can run your script before the user actually clicks or tabs into a field in the portal.
To the main first question:
I think it is not solved and can not be solved except using workarounds. And I see no solution for now except hard-coding. Thank you very much for your help. )))
Here are my thoughts:
OnEnter trigger and value list (drop-down)
I already trap the "OnEnter* trigger and set a global variable that it is trapped and the state is known. Already did this. Yes, it what I thought. Not too clumsy. But in this case, it does not solve the problem setting up a new condition for the value list and to display the filtered list first time the user enters this field inside the portal object (clicks on it using the mouse). The script is triggered only when entering the field, yes. I am getting the Get(ActiveLayoutObjectName) where the object name, of course, is different for both portals. Now, the second time the user clicks, the value list is correct. This means the "old" value list was not removed from memory (I guess) and is still used even though it already should have been replaced with the new one. I assume there is no solution now.
Layout design consideration: More than on portal on layout and using OnEnter triggers
Putting the second portal or both portals inside different panels is an option, but actually, I found that the user is happier when everything is fast and without using additional clicks opening additional panels, popovers or whatever. I also used pick-up lists using portal rows from virtual tables and all that which requires a lot of additional scripting and putting objects together. It is simply not user-friendly enough - even if it looks pretty - and it requires additional steps to the user and the developer. The inbuilt value lists which react just tabbing into them or clicking them not changing the view of the layout and instantaneously finding the related record just typing (either numbers of letters) is what works best in my cases with my users.
Unfortunately, (at least in Windows) only the drop-down list is keyboard aware and is the only type of value list filtering while the user types. (I really would congratulate FileMaker - as a side note - if they would be spending some time improving these value lists, or pick-up lists.)
Solution is a workaround
As I wrote, instead of trying to solve what is probably not solvable (changing the value list based on the onEnter trigger first time the user enters - which is a mandatory requirement here), I will have to hard-code the drop down in both portals providing just another value list which is pre-defined. But I think it should be solved by the Filemaker team as it is required for a more dynamic behavior.
Regarding bouncing web entry form here in Filemaker.community
(unrelated to the subject of this thread)
I originally wrote: PS: When I am typing here on the community web form, the form is bouncing up and down, changing the scroll position while typing. I noticed this a number of times... It makes it very hard to type. I do not see such strange behavior in other web forms. Any other users noticed this effect?
philmodjunk (: "Do you use FireFox? I get the same "bouncing text" headache any time the text that I type gets to a certain size. Very annoying."
I am using Chrome on Windows 10. Sometimes also FireFox. The problem is when typing and not just a short sentence. You are right. The form reacts somehow reformatting itself all the time, even while I am still typing. And sometimes it continues bouncing reformatting itself even if I am just staring at the page.
Yes, I see the same: It starts when the text gets to a certain size. Since it is not just me observing, we should report it if not already reported. I will search for if there is such report.
Several different thoughts:
if you have two (apparently) side by side portals, why script this at all? I'd guess that you are using a relationship based conditional value list with a different match value in each case. If so, there are other ways to set up the conditional value lists that don't require a script. Perhaps such "hardwired" CVL's are what you want to avoid but if so, I don't see much reason to do so.
That said, consider the following approach if you still want to script this:
Put a transparent button on top of the field that first performs your script and then uses go to object to put the cursor into the field in order to deploy the value list. This would be bypassed if the user tabbed into your field, but you can also deal with that by either removing the field from the layout's tab order or by setting up a script performed by the onObjectKeystroke trigger on the preceding field to check for any key (tab, enter, return) that will exit the field. When such a key is pressed, this script would perform the same script as your button.
You indicated that filemaker value lists are too limited and I completely agree. However, a drop down list is not the only option for selecting a value from a list that can be set up to update as you type. A filtered portal located inside a popover can also be used for this purpose.
If you have 2 portals, what's wrong with having 2 different value lists (even if sometimes their values will be the same) ?
Besides that, value lists with with more than a handful of items suck. Conditional value lists suck even more.
It's important to know how people really work, not how they pretend they work (quoting Jeff Sutherland) and help them reach their goal in a faster way. And being predictable (which conditional value lists are not) is important for being faster, for obvious reasons.
Absolutely. But what I want to achieve here is that people have an easy time using value lists which allow them to select from a list of accounts which depend on WHERE they enter it, in either portal1 or portal2. The accounts are from the same table. But to restrict entry values is the objective.
Of course, I am using now two different value lists. But to allow for a dynamic behavior where such controls will work the same more or less wherever you place them depending on globals set, etc. was what I had in mind.
All is for user friendliness.
All I am saying now is that, obviously, the onObjectEnter trigger does not fire early enough. On first entry, the value list is already displayed, and it is the wrong one.
Well, I agree for huge long lists value lists are not the right choice. But these smaller ones allow a very fast entry without having to open a popover or even a separate window (which I do like to do at all).
I am not aware of a better choice.
But what I want to achieve here is that people have an easy time using value lists which allow them to select from a list of accounts which depend on WHERE they enter it, in either portal1 or portal2.
So you set up two different value lists and the job is done. It is not hard at all to set up two value lists that draw values from the same source table but list entirely different sets of values. Then no scripting or use of script triggers are needed.
See the calculation field based "hardwired conditional value list" example found in:
Adventures in FileMaking #1 - Conditional Value Lists
This method uses neither scripts nor relationships.
The file itself is a resource file that demonstrates many different variations of conditional value list techniques--each with detailed documentation. A link in this file will download Adventures in FileMaking #2. This file then goes beyond basic value list and conditional value concepts illustrating a number of other methods for getting a list of values and selecting one of them.
At this point a pic is 100 words worth. I'd be interested to see a screen shot of your situation.
I am not aware of a better choice.