Items, Records and Blocks Question
--------
How does a Display Item differ from a normal Text Item ?
Answer
------
A Display Item is essentially a permanently non-enterable
text-item. It can be used for implementing variable
boilerplate text, or for any on-screen values which do not
require operator interaction (date/time for example).
Since Display Items are a special "subset" of the features
that a Text Item provide, they require slightly less memory
for their definition because many of the text-items
property's do not apply to the display item.
Question
--------
Why do a get a null entry in my poplists at startup ?
Answer
------
Consider a poplist with the values:
Label Value
------- --------
One 1
Two 2
Three 3
If you have a poplist that is in a block where no record has
yet to be instantiated, then the poplist item has a NULL
value. To visually reflect this, we show a null label in
the poplist. To show a null label in the poplist, we need to
add a null entry to the list at the bottom, and tell the
toolkit that *that* is the current value of the widget.
In addition, if the item is not required, then we
automatically add an empty list element to your set of
choices so that the user can pick NULL as one of the values.
The trick is, like for any item, if you want some value to
appear in the item at startup, you have to set the value or
instantiate the record in the block where that item belongs
so that those items take on their default values.
Question
--------
How can I dynamically prevent the user from entering a new
record ?
Answer
------
Have a Pre-Record trigger that does:
IF ((dynamic-condition-is-true) AND
:System.Record_Status = 'NEW')
THEN
RAISE Form_Trigger_Failure;
END IF;
Question
--------
How can I dynamically make an entire block query-only at
runtime ?
Answer
------
Issue the following :
Set_Block_Property('blockname', INSERT_ALLOWED,
PROPERTY_OFF);
Set_Block_Property('blockname', UPDATE_ALLOWED,
PROPERTY_OFF);
Question
--------
How can I change the colour and font of an item dynamically
at runtime ?
Answer
------
Using the builtin Set_Item_Property :
Set_Item_Property( 'Blockname.Itemname',
VISUAL_ATTRIBUTE,
'VisualAttributeName' );
Where 'VisualAttributeName' is either the name of a visual
attribute you've set up in the form (which has foreground,
background, font, etc.), or is the name of a logical visual
attribute from the resource file.
Question
--------
How can I have an item which acts like a disabled item , but
is not greyed out ?
Answer
------
The INSERT_ALLOWED and UPDATE_ALLOWED attributes solve this
problem. INSERT_ALLOWED=OFF, UPDATE_ALLOWED=OFF items don't
show as like disabled items but do not allow the user to
change the values in either new or queried records.
Question
--------
What exactly does 'Query Hits' and 'Query Options' mean in
the context of a block ?
Answer
------
Set_Block_Property(.., QUERY_HITS) lets your ON-COUNT
transactional trigger tell Forms how many records the query
(that you are handling yourself) will return so it may print
out the message :
"FRM-xxxxx: Query will retrieve nnn record(s)."
Getting this property via Get_Block_Property(.., QUERY_HITS)
simply returns the number of records that have been
retrieved by the query.
Get_Block_Property(.., QUERY_OPTIONS) lets your
transactional trigger know whether it's supposed to be doing
a normal query, a COUNT(*) type query, or a lock record
query.
Question
--------
What is the difference between the block properties of ARRAY
SIZE and RECORDS BUFFERED ?
Answer
------
ARRAY SIZE is the number of records that get fetched each
time forms goes to the database.
The RECORDS BUFFERED specifies the minimum number of records
that should be placed in memory when records are fetched
from the database. Even if you specify a low value of 3,
the minimum per form is slightly over 300.
As more records are brought back from the database (eg
records 303-306) they get moved between memory and the file
buffer as the user scrolls down.
Monday, April 20, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment