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.

Table Field OperationsControlling Multiple Table Fields with a Single Control ButtonYou can use one control button to provide operations for multiple table fields.In fact, if you have multiple table fields on a frame, it is necessary to use asingle ControlButton so that the Control Button accelerator keys will be appliedto the table field that currently has input focus. Assume you have a frame withtwo table fields, for example:• CheckoutsThis table field tracks DVDs as they are checked out and in by eachcustomer.• ReservationsThis table field tracks reservations held by customers for specific DVDs.As customers check out a DVD, they also can reserve another disc.You could add operations to the control buttons provided by default with eachof these table fields. However, to reduce duplication of code, you can writegeneric code for operations common to both table fields and provide a singlecontrol button for both.Independent control buttons are created with no menu operations. To includethe standard table field operations (Insert Before Current Row, Delete CurrentRow, and Delete All Rows) that are provided by default with every table fieldcontrol button, you can copy the 4GL code for these operations into theindependent control button. You can find this code using View Processed Scriptin the Frame Editor. These three default table field operations are excellentexamples of coding table fields generically.How You Can Sort Table Field Data GenericallySorting array data by specifying a column in its associated table field is acommon operation. You can put a generic sort operation into a control buttonthat is attached to a specific table field or is an independent control buttonfield.252 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!