Jump to content
Server Maintenance This Week. ×

Current control highlighting


jmci

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

Recommended Posts

I've seen FileMaker apps designed by others where the fill color of an object on the layout changes as the user enters that object. For example, as the user tabs from one editbox control to another on a layout, the fill color of the current object changes from white (the apparent default color) to yellow. I always thought that technique was cool and wanted to know how to accomplish it.

I've recently had an opportunity to look at a file which used that technique. In layout mode I saw that all of the editbox controls on a layout had a default fill color of yellow and each of these controls had the same conditional formatting specified. Based upon the conditional formatting formula the fill color was changed to white. The formula was simply the number 1.

I tried it on one of my projects and it works very well. My problem is that I don't understand how it was accomplished. What's going on with that conditional formatting formula?

Link to comment
Share on other sites

1 stay for: True ( or better ALWAYS true, since that is a fixed number <> 0 .

So the always true color is white but, when the field is active, that condition can't be evaluated so the field background turns to the default yellow.

Link to comment
Share on other sites

Hi Raybaudi

Actually I didn't really have a problem understanding 1 as the conditional formatting formula. True is always true and that's easy enough to understand. What I don't understand is why the conditional formatting formula evaluates as false or can't be evaluated while the control has focus.

jmci

Link to comment
Share on other sites

Can anybody explain why the conditional formatting formula evaluates as false or can't be evaluated while the control has focus?

One possible reason is this: If the conditional formatting were evaluated while the cursor is in a field, it would have to be re-evaluated each time the content of the field changed. Depending on the conditional formats applied to the field, the formatting could change radically with each keystroke, which would be a very bad user experience. On the one hand, we're smart enough to figure this out on our own and not apply conditional formats for blue text on a red background for an even number of characters in a field, and red text on a blue background for odd; but on the other hand, FileMaker's target audience is users who don't specialize in FileMaker development, so a little paternalism makes sense.

Another possible reason: Not evaluating while the field is active saves compute cycles. When I implement search-as-you-type functionality, I do something similar where I only actually run the Find after there's a pause in the user's typing.

Link to comment
Share on other sites

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