Often form developers want to add an expanding / collapsing section to a form. This can come in many forms, a simple button that controls the visibility of the corresponding section, a yes or no question, where if the user answers yes, then the form needs to ask additional questions, etc. All of these types of hide / show behavior can be done one of 3 ways.
XFDL - where just XFDL computes are used to control the visibility or display property of a section, or a bunch of items. The XFDL approach is the simplest approach, but often gets complicated or limited in forms with many sections or if tables or other xforms based items are involved. - plus it requires hidden items, which is often annoying to have to work with.
XForms - where xforms:binds are used to control the relevance of elements in the instance, and then sections or panes are bound to those elements. This approach is the most flexible, and will work in any form scenario. You have to write some binds, but once you get the hang of it, it's pretty straightforward. This is generally the recommended approach.
XForms + Switch Case. You might wonder why this approach is mentioned, but its the best way to help improve form load speed in IBM Forms 4.0.x. In the first two examples above, the items that are hidden are all still there, and the browser still needs to build the appropriate markup to handle the items. So if you have 100's of items that are hidden behind a collapsed section, the browser still has to do the work to create and handle those items - they are just not visible to the user - yet the user has to wait for the browser to build those items before the user gets to see any content - and this might be seen as form load time, where in reality, its the rendering of the first page that is taking the time.
So with forms that have many items on a given page or with users that are using very old browsers (like IE6) the time it takes to load a form page might take a while (the more items on the page, the longer it takes). But if you use a switch case, where you have 2 cases, one empty case (for the collapsed mode), and another case (that has the content to show in expanded mode) we'll call the content case, and if the form loads with the empty case as the active case, then the browser will only build the markup for the items in the content case when the user actually expands the section. There could be a slight delay, but this would be seen as an acceptable delay as the user asked to see additional content.
In some cases this can drastically help form load or page load times, as the content in cases are only rendered when that case becomes active, not during form load.
I've attached a sample form that shows a possible way to do each of these scenarios.