Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: sql*forms problem

Re: sql*forms problem

From: Christian Mondrup <reccmo_at_sc03.sctp.dk>
Date: 1998/03/23
Message-ID: <6f5asg$mvq$1@news.net.uni-c.dk>#1/1

Martin Meadows <mmeadows_at_indy.net> wrote:
: I have a table, let's call it A, with about 20 fields in it. One of the
: fields in table A is called: cost of widgets. In sqlforms30, I need to
: allow a user to put his/her cursor in the cost of widgets field of a
: form & have this trigger a pop-up window called Widgets. In this pop-up
: form, the user will see something like this:
 

: Kind of Widget Cost
: _______ ____
: _______ ____
: _______ ____
 

: There could be a really huge number of widgets for him/her to enter.
: When the user is finished entering widgets on this screen, he/she hits
: enter or accept & it returns to the cost of widgets field on the
: original screen. The sum of the costs from the pop-up window is
: automatically entered in the cost of widgets field and the user can't
: change this info unless he/she goes back to the pop-up window. How can
: this be done in sqlforms?

Make the field cost_of_widgets non-writable and non-updateable - that does not prevent you from doing programmed writings to it. Create a KEY-NXTFLD trigger for the block containing this field. In this trigger test the name of the next field using the function call

FIELD_CHARACTERISTIC(:system.cursor_field, nextfield)

If the function call evaluates to the name of your cost_of_widgets field let the trigger do the next_field action followed by a go_block to your pop-up block.

In your pop-up block create a KEY-EXIT trigger doing a loop on all rows in the block calculating the cost sum. Assign this sum to your cost_of_widgets field before exiting from the block. If the cost_of_widgets field is a database field let the KEY-EXIT trigger do a commit_form at last.

: Thanks,
: Martin Meadows

Hope that helps

--
Christian Mondrup, Computer Programmer
Scandiatransplant, Skejby Hospital, University Hospital of Aarhus
Brendstrupgaardsvej, DK 8200 Aarhus N, Denmark
Phone: +45 89 49 53 01, Telefax: +45 89 49 60 07
Received on Mon Mar 23 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US