Re: Format Mask for Numbers with commas

From: mcstock <mcstockspamplug_at_spamdamenquery.com>
Date: Sun, 23 Nov 2003 08:26:00 -0500
Message-ID: <1cSdna8Kt-PgKF2iRVn-sw_at_comcast.com>


[Quoted] i assume you're using forms, and assume you're at using at least release 6i [Quoted] (don't forget to be specific in you next post)

'when-validate-item' is the typical trigger for detecting change at the item [Quoted] level. see also when-validate-record and when-validate-form

the SET_ITEM_INSTANCE_PROPERTY 'built-in' is the closest to what you want to [Quoted] do as far as setting the attributes of one occurrence of a multi-row item, but it does not appear to support changing the format

however, this can be simulated with a mirror ('synchronize with') item in the same block -- the implementation is not pretty but it can be made generic, and hence, reusable

basic steps:
1) create a block item with its 'synchronize with item' property set to the number item

[Quoted] -- no format mask in this item
-- important: set its 'number of items displayed' property to 1
-- position the item exactly on top of the number item (same x, y, width)
2) create a WHEN-NEW-RECORD-INSTANCE trigger on the block that positions the [Quoted] item (this code should be implemented in a reusable program unit, but see if you can get it working in the trigger first)
-- set the y_pos based on:
---- the SYSTEM.TRIGGER_RECORD
---- block property TOP_RECORD
---- height of the item (can get dynamically with GET_ITEM_PROPERTY)
---- item property distance between records (must be hard-coded, cannot get
with GET_ITEM_PROPERTY)
[Quoted] 3) set 'keyboard navigable' property of the number item to 'No' 4) create a WHEN-NEW-ITEM-INSTANCE trigger on the number item to set the focus to the edit item (using GO_ITEM)

let me know if you need additional assistance, but if you know PL/SQL and can use on-line help this should give you enough to go by

  • mcs

"Aaron V" <Tinkerist_at_hotmail.com> wrote in message news:pPTvb.81853$Dw6.391391_at_attbi_s02...
| Greetings,
| Does anyone know a good way to exclude the commas when editing a number
| field? I have a format mask that adds commas for readability on long
| numbers, but when I edit the number, I don't want the commas to be there.
| For instance, if I where to put the decimal point off by one position
| accidentaly on a long number, I would have to change the decimal position
| then remove all the commas or replace them where they should be. It would
be
| easier to retype the number; yes, but I would prefer to have the option to
| edit it. The closest I could come up with was to Nullify the Format Mask
on
| a Pre-text-item trigger, then Replace it on a Post-text-item trigger.
This
| would work fine if I were viewing only one Record, but I am not. So all
the
| numbers for that whole column lose their formatting when the focus is on
| that Item.
| Also, is there a trigger that fires when an item is changed(at the same
time
| the Item_is_valid becomes False).
|
| Any help would be appreciated,
| Aaron V.
|
|
Received on Sun Nov 23 2003 - 14:26:00 CET

Original text of this message