Jump to content
Server Maintenance This Week. ×

Tabbing out of a portal row . . .


Wickerman

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

Recommended Posts

. . . and out of the Portal altogether!

I'm trying to set my Tab Order for a layout with a Portal on it that is used for record creation.

If the user creates a record in the portal and Tabs out of the final field, the portal creates a record on the new row and puts the cursor there, ready for action. This is great if you have to enter many rows of data, but not so good if you want to enter just one and then move onto other fields on the layout. Even if the user clicks out of the portal (which is a bit of a nuisance in its own right) -- you wind up with a useless blank record in the related Table.

So what's the best way to avoid this tabbing behavior? Should I put an "On Object Exit" script trigger on the last field in the portal that keeps the cursor to the desired field? Seems like overkill...

Also, what is the preferred method for policing the occasional superfluous, empty records that will inevitably appear in these kinds of record-generating portals from time to time?

Thanks for any pointers!

Link to comment
Share on other sites

Oh! Right you are -- don't know where I got that impression.

. . . but the tabbing question is still there -- how do I set the Tab Order so that tabbing from the last field in the portal row will get you out of the portal, rather than down on a fresh portal line?

Link to comment
Share on other sites

Yes - - it;s tabbing appropriately for the entry of multiple records the portal -- but I was wondering in the case where the workflow typically involves just a single record entered in a portal and then moving on to further fields on the main surface of the layout, if there was a way to tab *out* of the portal to another field rather than join to that next line.

I'm thinking now maybe I'd have to use a script trigger on that art field in the portal row -- but also thinking maybe it isn't worth the effort....

Link to comment
Share on other sites

in the case where the workflow typically involves just a single record entered in a portal

Is it entering a single additional record in the portal, or just one related record in total? In the second case, you could use a one-row portal (or no portal at all).

Link to comment
Share on other sites

No -- there needs to be rows for multiple records - but I'm dealing with reveal situations where the "typical" case is for a single entry, at least at a given sitting. This is maybe not so much even a Tabbing question as a portal behavior question. For example, in another portal that has just a single field in it with a drop-down menu, when the user makes a selection, the portal automatically goes to the second row and pops up the menu for a second selection. We would prefer that after making the selection, the cursor automatically popped over to the next field, outside the portal. The current action seem very "in your face" -- see attached picture of the result after making selection.

So . . . is there a setting governing this behavior -- or should I use a Script Trigger "On Object Modify" to "Go to Field" as desired?

post-91156-0-79572300-1332346334_thumb.j

Link to comment
Share on other sites

Hmmmm . . . I've written a simple 1-step script that has the cursor go to another object on the layout. If I assign this to the field with an "OnObjectModify" trigger, it works okay when I use a value from the drop-down menu in the field . . . but of course when you try to type in a free entry, the script boots you right out of the field.

I originally tried assigning the script to an "OnObjectExit" script trigger -- but this was not effective in keeping the cursor out of the next row of the portal. Nothing seemed to happen at all.

Is there a detail here I'm not getting?

Link to comment
Share on other sites

I meant also to mention that when I use the "OnObjectModify" trigger, in a case where I have a multiple row portal with only field, I glimpse the drop-down menu flash open briefly before the scrip send the cursor over to the other object, which makes an unfortunate glitchy impression (on my Mac, which makes me think it will look even worse on my client' PC...)

Link to comment
Share on other sites

Thanks for the demo file, but that's not quite what I'm aiming for.... in your example, what I would like to see happen is that when the cursor is in the 'Value' field, when you hit the 'Tab' key, the cursor goes immediately to the Notes field at the bottom of the layout. In your example file, the cursor goes down to the next row of the portal, which is exactly what I'm trying toy avoid.

I'm trying to allow the User to get *completely out of the portal* with a Tab keystroke executed from the last field in the portal row.

Link to comment
Share on other sites

The cursor goes immediately to the Notes field after you have created one new record. Do you want it to go the Notes field even if you have not created a new record? IOW, you will have to click inside an empty row each time you do want to create a new record?

Link to comment
Share on other sites

Oh I see now . . . yes, this would be workable... But

1) Could you explain how the "not Child::ChildID" works? I'm not sure I understand what it means to have a boolean question that is simply not:field -- does that mean the field is empty? (is it the same as IsEmpty)? I don't have the Child ID in the portal line -- but I suppose that doesn't matter -- the point is the child key field is created only after the portal row is exited, hence the script is triggered - right?

2) Could you help me understand why a simple "OnObjectExit" fails to work here? I'm trying to get the hang of Script Triggers in the process . . . .

Link to comment
Share on other sites

1. The key here is that the ChildID field is set to populate on commit. Therefore, when you exit the last field of a freshly created record it's still empty. With a Number field, the expression not Field achieves the same thing as IsEmpty ( Field), considering that zero is not used.

2. What would be a simple "OnObjectExit"? You want different behavior for different circumstances.

Link to comment
Share on other sites

1) Thanks for the clarification -- I've always used Text fields for my key fields. Is there an argument for using Number fields instead, or is it just a matter of habit?

2) By simple, I mean I don't understand why I can't set a Script Trigger on that final field in the portal row that triggers a Script like "Go To Field: Notes". Then in *any* situation where the user was in that field for whatever reasons, a Tab stroke would take them to that other field outside the portal. I don't get why getting into the next portal row takes precedence / neutralizes the script trigger.

Thanks for your patience!

Link to comment
Share on other sites

1. A number sorts correctly - with text you'd need to have leading zeros, and therefore also a maximum value.

2. Sure you can do that. But then you'll be tabbed from the last field of the first row out of the portal - even when a second row exists. IOW, you cannot get to all your existing data by tabbing. As a user, I'd find it weird.

TabOut.zip

Link to comment
Share on other sites

Oh -- I see my error now. I didn't have the Exit Script step set to "Result:False" I'm not familiar with this obvisouly crucial feature and don't find an explanation in either of my FIlemaker manuals. . . Could I trouble you for one more explain?

Link to comment
Share on other sites

Some script triggers run the script before performing the triggering event itself; you can tell this by the note under Result in the Set Script Triggers dialog.

If you do not cancel the triggering event, it will be executed immediately after the script. In this case, the triggering event is tabbing into the next field in the tab order, i.e. the Name field in the next row of the portal. So all the script will achieve is putting the cursor in the Notes field for a split second, before it returns to its original path.

Link to comment
Share on other sites

Yes, that makes sense -- but how does the "Result:False" setting in the Exit Script step achieve this cancellation of the triggering event?

"Result:False" . . . of what? What's being tested and coming up False?

Link to comment
Share on other sites

  • 3 years later...

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