10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

How You Can Create and Modify Fields DynamicallyBecause the ChildFields attribute makes it easy to reference the fields in aStackField object, the example for Step 4 uses a single ButtonField referencevariable instead of an array.If you are creating several fields of the same type that share most of theirattributes, you can duplicate the first and then change attribute values asappropriate, for example:efields[j+1] = efields[j].Duplicate();If you create an entry field dynamically, its style defaults to multi-line. Toallow the user to tab from entry field to entry field, change the dynamicallycreated entry field to single-line by setting the IsMultiLine attribute to FALSE.The following code makes this change:efields[].IsMultiLine = FALSE;How You Can Create Dynamic Composite FieldsComposite fields are created dynamically using the same steps used to createa simple field. For a discussion of these steps, see How You Can CreateDynamic Simple Fields (see page 373).However, creating a MatrixField object dynamically requires an additional step.When first instantiated, matrix fields contain no columns and no rows. Becauseyou cannot insert a field into a matrix field cell that does not exist, you mustspecify the number of rows and columns before you insert any child fields.Begin dynamic matrix field creation by specifying a number of rows andcolumns large enough to contain all the fields to be inserted. After all childfields have been added, remove the empty cells by setting the CollapsePolicyattribute.Creating Dynamic Frames 375

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!