KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Using Placeholders
PRODUCT: 4D | VERSION: 14.0 | PLATFORM: Mac & Win
Published On: April 25, 2014

4D v14 has introduces a new feature that allows designers to provide users with a better user interface experience. This feature is the new Placeholder property that belongs to objects with enterable fields, although any object can have a placeholder, it is not as visually helpful. This feature allows designers to guide their users and make their application more user friendly.

One of the objects that has a placeholder property is the Variable Form Object. When giving users a form and asking them to fill it out, designers can enter a placeholder that occupies the enterable field to guide the users. Placeholder values are text and do not set the variable of the object it occupies, the variable will be Null or an empty string if the placeholder is visible.

To create a placeholder for an object there is a new property in some of the objects' Property List called Placeholder as shown below. Anything typed in the field will be shown in the object if it is empty. This only applies to objects that will visually display a placeholder.



Placeholders can also programmatically created or changed by code using the OBJECT SET PLACEHOLDER command. Using the OBJECT SET PLACEHOLDER command, placeholders can be applied to other objects. Placeholder values can be read using OBJECT Get placeholder.

Note: All objects can have a place holder using the commands, if a need to set and read placeholders from objects was desired.

Below are some examples of practical uses for placeholders.

What to enter: for example Names:



Format of entry: for example Date Structures: