Re: FORMS and poplists

From: DanHW <danhw_at_aol.com>
Date: 1998/02/02
Message-ID: <19980202013400.UAA16408_at_ladder03.news.aol.com>#1/1


>
>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 Received on Mon Feb 02 1998 - 00:00:00 CET

Original text of this message