11.01.2013 Views

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

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.

GET_BLOCK_PROPERTY examples<br />

162<br />

and QUERY if the block contains only valid records that have been<br />

retrieved from the database.<br />

TOP_RECORD Returns the record number of the topmost visible record<br />

in the given block.<br />

UPDATE_ALLOWED Returns the VARCHAR2 value TRUE if the<br />

Update Allowed block property is Yes, FALSE if it is No. This property<br />

determines whether the operator or the application is allowed to update<br />

records in the block.<br />

UPDATE_CHANGED_COLUMNS Specifies that only those columns<br />

updated by an operator will be sent to the database. When Update Changed<br />

Columns Only is set to No, all columns are sent, regardless of whether they<br />

have been updated. This can result in considerable network traffic,<br />

particularly if the block contains a LONG data type.<br />

/*<br />

** Built-in: GET_BLOCK_PROPERTY<br />

** Example: Return the screen line of the current record in<br />

** a multi-record block. Could be used to<br />

** dynamically position LOV to a place on the<br />

** screen above or below the current line so as to<br />

** not obscure the current record in question.<br />

*/<br />

FUNCTION Current_Screen_Line<br />

RETURN NUMBER IS<br />

cur_blk VARCHAR2(40) := :System.Cursor_Block;<br />

cur_rec NUMBER;<br />

top_rec NUMBER;<br />

itm_lin NUMBER;<br />

cur_lin NUMBER;<br />

bk_id Block;<br />

BEGIN<br />

/*<br />

** Get the block id since we’ll be doing multiple<br />

** Get_Block_Property operations for the same block<br />

*/<br />

bk_id := Find_Block( cur_blk );<br />

/*<br />

** Determine the (1) Current Record the cursor is in,<br />

** (2) Current Record which is visible at the<br />

** first (top) line of the multirecord<br />

** block.<br />

*/<br />

cur_rec := Get_Block_Property( bk_id, CURRENT_RECORD);<br />

top_rec := Get_Block_Property( bk_id, TOP_RECORD);<br />

/*<br />

** Determine the position on the screen the first field in<br />

** the multirecord block<br />

*/<br />

itm_lin := Get_Item_Property( Get_Block_Property<br />

(bk_id,FIRST_ITEM),Y_POS);<br />

/*<br />

** Add the difference between the current record and the<br />

** top record visible in the block to the screen position<br />

** of the first item in the block to get the screen<br />

** position of the current record:<br />

*/

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

Saved successfully!

Ooh no, something went wrong!