Re: Format Mask for Numbers with commas

From: Aaron V <Tinkerist_at_hotmail.com>
Date: Mon, 24 Nov 2003 20:38:40 GMT
Message-ID: <k%twb.295741$Fm2.312668_at_attbi_s04>


Thanks mcs for your reply,
this sounds like a great idea, especially because you could use this technique for almost any of the Set_Properties that can't be set for the instance. Thanks so much, and I'll give it a try.

--Aaron V

"mcstock" <mcstockspamplug_at_spamdamenquery.com> wrote in message news:1cSdna8Kt-PgKF2iRVn-sw_at_comcast.com...
> i assume you're using forms, and assume you're at using at least release
6i
> (don't forget to be specific in you next post)
>
> 'when-validate-item' is the typical trigger for detecting change at the
item
> 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
> 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
> -- 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
> 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)
> 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 Mon Nov 24 2003 - 21:38:40 CET

Original text of this message