UX: Enhanced Scrolling Behavior in Subforms
User forms are all about making things easy for users. But what happens when scrolling becomes a battle between subforms and their contents? You’ve probably experienced this before: you try to scroll through a list box in a subform, but the entire subform moves instead. Or, worse, you try to scroll the subform itself, but the list box stubbornly stays put!
This has been improved with 4D 20 R6, making the action more natural.
A class for easy handling of your sub-forms
On the forum, several requests, tips, or questions have been asked about displaying a message, an hourglass, or some interface elements in the foreground of a form while blurring out the rest. You can create this type of interface with sub-forms and call forms. The code can get complicated if you’re working with a multi-page form.
To simplify your work, Vincent De Lachaux has prepared a class to simplify the management of sub-forms displayed in a multi-page form. It handles loading the sub-form on the fly, controlling it from a worker, and repositioning it if the main form is resized. You can focus on your dialogues without worrying about the mechanics.
Tips & Tricks for your 4D Apps – August Edition
by Add Komoncharoensiri, Director of Technical Services at 4D Inc
Here we go with another set of tips and tricks.
As you know, 4D Knowledge Base is a library of information about the 4D technology where weekly tech tips and monthly technotes are actively published. If you missed the last tips on the KB, that’s fine; here is a compilation from the past few weeks.
This blog post covers 16 tips:
Form and subform communication made easy!
Starting with 4D v19 R5, the ability to associate a variable with a subform has enriched the possibilities of interfaces and communication between forms and subforms. The means of communication are now simplified by two new commands: Say hello to OBJECT Get subform container value and OBJECT SET SUBFORM CONTAINER VALUE.
List box typeahead: Intuitive list searching
by guest author Chris Belanger, a 4D developer from Canada
List box typeahead (a method for progressively searching) is not a native feature of list boxes. However, you can easily implement this feature with some creative coding. In this blog post, I’ll demonstrate the technique along with a database example and an exhaustive document explaining the details step by step.
The final result is summarized in the GIF below, It illustrates two “searches”. One for E-L-L-I-O-T, then another (after a column sort) for H-A-N-N-A-H:
On resize… On resize… On resize…
Wondering how to create a nice and dynamic user interface? Typically when a form is resized, the form objects whose horizontal sizing or vertical sizing properties are set to move or grow, are automatically resized. In some cases (e.g., finer user interface management), developers choose to manage form object size and position by programming. To do so, they check the “on resized” event which is triggered within the form method. But what happens when the form contains one or more subforms? On many levels? This blog post gives you the answers!
Passing data back and forth between forms
Wouldn’t it be great if you could just open a form and pass it some parameters to initialize your form objects? What about being able to also get the data back to process, after it’s been modified by the user? 4D v16 R5 makes your coding so much easier by greatly simplifying communications with forms.
Until now, when you wanted to display data (not coming from the database itself, but computed or external) to multiple users, you had two options: either write complex code to handle data display in multiple processes, or create as many forms as necessary with a bunch of global variables. But you know that global variables are not an optimized way of coding, from a memory point of view.
So get rid of your complex code and global variables! With 4D v16 R5 you can just bind an object to your form and use it internally with the new Form command. Painless…and powerful!
Contact us
Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!
* Your privacy is very important to us. Please click here to view our Policy