Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FORMS and poplists

509 views
Skip to first unread message

Frank W Phillips JR

unread,
Jan 28, 1998, 3:00:00 AM1/28/98
to

I am attempting to dynamically populate a poplist based on a POST-CHANGE
trigger attached to another item. When the trigger runs I get a
"FRM-41331: Could not delete element from list" error. This appears to
be due to Forms insisting that the poplist have a default value (even if
it is a blank) when created. Can anyone tell me how to work around this?
This seems like a standard thing for a database app to do. It is very
important to my application to be able to build lists based on the value
of other items on the form. Thanks in advance for any help…

Peter H. Larsen

unread,
Jan 30, 1998, 3:00:00 AM1/30/98
to

On Wed, 28 Jan 1998 16:04:35 -0500, Frank W Phillips JR
<F...@vpha.health.ufl.edu> wrote:

>I am attempting to dynamically populate a poplist based on a POST-CHANGE
>trigger attached to another item.

1. Poplists are a finite list. That means values outside the poplist
are considered invalid. If you want to be able to accept invalid
values, use the COMBOBOX - not the poplist.
2. POST-CHANGE should be avoided at all times. Use
WHEN-VALIDATE-ITEM/POST-QUERY.

If you insist on the poplist then make sure you appoint a value for
"all other values" and use the "Other value" property to point to it.
When you populate the list make sure this other value is present!

Regards
Peter H. Larsen (pet...@pip.dknet.dk)
Oracle Consultant (not affiliated with Oracle)


DanHW

unread,
Feb 2, 1998, 3:00:00 AM2/2/98
to

>
>I am attempting to dynamically populate a poplist based on a POST-CHANGE
>trigger attached to another item. When the trigger runs I get a
>"FRM-41331: Could not delete element from list" error. This appears to
>be due to Forms insisting that the poplist have a default value (even if
>it is a blank) when created. Can anyone tell me how to work around this?
>This seems like a standard thing for a database app to do. It is very
>important to my application to be able to build lists based on the value
>of other items on the form. Thanks in advance for any help=85
>
>

I have the same thoughts as you, but what I have opted to do is use Oracle LOV
facility, rather than poplists or combo boxes. In implementing this, I put a
pushbottom item next to the field that activates the LOV for the field, so that
it looks more like Windows. In the query that builds the LOV, you can include
references to screen variables. If you are clever with decodes and nvl, you can
usually put just about anything in there. For example, (using US States), if
they have not entered any state, you want to show all <somethings>; if they
have entered a state, you want to restrict it to that state...

screen variable where state is displayed: :myblock.state

select .... from states where
decode(nvl(:myblock.state,'x'),'x',s.state,:myblock.state) = s.state

if a value is in :myblock.state, the nvl function will return the entered
value. The decode will then NOT match the 'x', so it returns the 'else' value,
which is the :myblock.state. This will then be used to return rows where
s.state = :myblock.state.

If no value is in :myblock.state, the nvl function will return the 'x' value.
The decode will then match this with its 'x', and return s.state. The all the
rows in which s.state = s.state is true will be returned. This of course is
satisfied for all rows in the table.

I also prefer the Oracle LOV because it gives you much better type-and-search
functionality than the standard Windows poplist - try and go to the 20th entry
that starts with a 'P'. You have to hit 'P' 20 times. In the LOV, you only type
the next letter that is different.

Good luck

Dan

Joe Strano

unread,
Feb 7, 1998, 3:00:00 AM2/7/98
to Frank W Phillips JR

Is this poplist in a multi-record block? If it is, you are toast. Two
workarounds are to use an LOV instead of a poplist, and to have a "floating
poplist". The poplist is in a separate non-base table block, and it's
When-List-Changed trigger copies the value to the appropriate field in the
base table block.

Joe Strano
Dulcian, Inc.

Frank W Phillips JR wrote:

> I am attempting to dynamically populate a poplist based on a POST-CHANGE
> trigger attached to another item. When the trigger runs I get a
> "FRM-41331: Could not delete element from list" error. This appears to
> be due to Forms insisting that the poplist have a default value (even if
> it is a blank) when created. Can anyone tell me how to work around this?
> This seems like a standard thing for a database app to do. It is very
> important to my application to be able to build lists based on the value

> of other items on the form. Thanks in advance for any help…

--
Joe Strano
Dulcian, Inc.

0 new messages