Re: trigger to fire when navigating records

From: Steve Cooper <coos02_at_blackburn.ac.uk>
Date: 9 Jan 2004 05:28:26 -0800
Message-ID: <2cd89d54.0401090528.6e25b7e2_at_posting.google.com>


Aaron,

Your right I misunderstood your initial question.....This is a tricky one, but other than your timer solution I can't really think of any other way to do this thats not going to be messy.

Steve

[Quoted] "Aaron V" <Tinkerist_at_hotmail.com> wrote in message news:<mEjKb.758853$Fm2.705095_at_attbi_s04>...
> Steve,
> I tried the post-Record trigger, but it doesn't fire when you click on the
> scrollbar, or scrollbar up or down buttons. New records are shown at the
> top or bottom of the block, but the cursor_record moves up or down in the
> block, it would only fire if the cursor record was the top record and you
> were to click scroll up again(or down and down), then the cursor record
> would change, firing triggers.
>
> Get this, mouse triggers don't fire on scrollbars, try a when-mouse-clicked,
> or even moved even at the Form level, it won't fire in a scrollbar, it's
> like it's not even on the form.
>
> Although I did find a way to make it work, sort of, but it's not pretty. I
> created a timer when I navigated to the Item I want to stay in sync with the
> cursor record, set it for 100 ms, then when-timer-expired verified the
> location of the sync item, and that it was still the cursor_item, and
> synchronized them if needed, or deleted the timer if the sync item wasn't
> the cursor item. It's works so far, and looks to the user, like it responds
> to the scrollbar.
>
> --Aaron V
>
> "Steve Cooper" <coos02_at_blackburn.ac.uk> wrote in message
> news:2cd89d54.0401050520.13fe9aa0_at_posting.google.com...
> > "Aaron V" <Tinkerist_at_hotmail.com> wrote in message
> news:<WWoJb.719437$HS4.5228893_at_attbi_s01>...
> > > I did get around to trying this out and it works great, except for one
> > > thing. I can't seem to be able to find a trigger to fire when one is
> > > navigating between records in some places, like when you have, 20
> records in
> > > a block and 10 are displayed, and the current record is the 12th record
> and
> > > it is the 5th record from the top. The Scrollbar Indicator will be
> floating
> > > somewhere in the middle of the scrolbar. If one where to click the up
> or
> > > down scrollbar buttons, the current record will change position, but it
> will
> > > still be the current record(won't fire the when-new-record trigger, or
> > > new-item-instance). So when this happens I have the formatting Item out
> of
> > > Physical sync with the original Item(it stayed in the same position, but
> the
> > > record moved up or down). I've tried this with every trigger I can
> think
> > > of, but none seem to fire in this scenario.
> > > forms 6i/Oracle 9i
> > >
> > > Thank for any help,
> > > --Aaron V
> > >
> > >
> > > 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.
> > > > |
> > > > |
> > > >
> > > >
> >
> > Araon,
> >
> > Try Post-Record trigger at the block level, this should fire when ever
> > you naviagte, either by arrow keys or scrollbar.
Received on Fri Jan 09 2004 - 14:28:26 CET

Original text of this message