10.07.2015 Views

Programming Guide - Actian

Programming Guide - Actian

Programming Guide - Actian

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Table Field OperationsHow You Can Turn CellAttributes OnThere are two ways to implement hidden columns:• Set the bias of the column(s) to FB_INVISIBLE.You may want some table field columns to be visible to some users but notothers or invisible only some of the time. For example, it might beacceptable for a supervisor to see a salary column but unacceptable for aclerk to see that information. To change a column to invisible, set theCurBias attribute of the ColumnField object to FB_INVISIBLE.The following code in a frame's initialize section determines who is usingthe application and sets the CurBias attribute for the columns in theframe's table field accordingly:select :user_name = dbmsinfo('username'),:dba_name = dbmsinfo('dba');commit;if user_name != dba_name thenfield(custtable[*].acctbal).CurBias =FB_INVISIBLE;Use this strategy only if you want to change the visibility of the columnduring the running of frame, since it adversely affects performance.• Define a user class that contains hidden columns as well as those displayedin the table field.This is the most efficient way to implement hidden columns. This way isuseful for keeping a record of data that might be changed by the user.The CellAttribute object gives you access to the attributes of an individual cellin a table field column. Because of the impact on performance, OpenROADdoes not automatically create CellAttribute objects when you create a tablefield. Instead, if you want to use CellAttribute objects, you must explicitly orimplicitly turn them on.CellAttribute objects are turned on by column rather than on a cell-by-cellbasis. Turning on CellAttributes for a column sets it on for all cells in thatcolumn.The easiest way to turn on CellAttributes for a column is to use the PropertyInspector to set the column's HasCellAttributes attribute to TRUE. This involvesthe least performance overhead. However, you can choose to turnCellAttributes on at runtime by using one of the following techniques:• Explicitly, in the initialize portion of a frame scriptTo turn on the CellAttributes explicitly, set the HasCellAttributes attributeof the ColumnField object to TRUE. The syntax is:field(tablefield[*].column).HasCellAttributes = TRUE246 <strong>Programming</strong> <strong>Guide</strong>

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

Saved successfully!

Ooh no, something went wrong!