Home » Developer & Programmer » Forms » on change trigger to filter (Forms)
on change trigger to filter [message #659042] Wed, 04 January 2017 16:10 Go to next message
dstran
Messages: 7
Registered: August 2015
Location: md
Junior Member
How can I filter results as the user is typing?

I have a contact list form with first name, last name, email ...
and would like to narrow down the results as the user is typing.

something like on_change trigger execute query based on the value typed?

thank you.

Re: on change trigger to filter [message #659048 is a reply to message #659042] Thu, 05 January 2017 00:42 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Forms - as it is - doesn't work that way (so I'd say that you can't do it). Try to Google for "Java Bean" along with keywords you're interested in, maybe you'll find something.

Alternatively, see if Forms' timer does any good; it should expire really quick (as some people type really fast). However, if you're in enter query mode, I think that any other processing is paused until you execute query (and that's too late for what you are looking for).
Re: on change trigger to filter [message #659075 is a reply to message #659048] Thu, 05 January 2017 11:03 Go to previous messageGo to next message
dstran
Messages: 7
Registered: August 2015
Location: md
Junior Member
Thanks for the quick reply, I've seen it done before in forms, perhaps its an LOV and not filtering on a table. will look into Java Bean, Thanks.
Re: on change trigger to filter [message #659077 is a reply to message #659042] Thu, 05 January 2017 11:37 Go to previous messageGo to next message
dstran
Messages: 7
Registered: August 2015
Location: md
Junior Member
Solution

Create a List->Combo box as the search filter input item

Create a When-List-Changed trigger

DECLARE
   c_where VARCHAR2(100);
   Blk_Id BLOCK;
	
BEGIN	

c_where := 'last_name like '''|| :your block.last_name_search||'%''';

Blk_Id := find_block('your block');
Set_block_Property (Blk_Id , default_where, c_where);								
execute_query;

END;

Not the most elegant but does what I need.

/forum/fa/13386/0/


[mod-edit: code tags added and image inserted into message body by bb]

[Updated on: Thu, 05 January 2017 16:43] by Moderator

Report message to a moderator

Re: on change trigger to filter [message #659080 is a reply to message #659077] Thu, 05 January 2017 13:29 Go to previous message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Great! I'm glad you solved it and shared the solution with us.
Previous Topic: Forms 6.0 Runtime Failure & Forms 6.0 runtime error-please help me (merged)
Next Topic: Limit Number of Rows in OLE2 Forms to Excel Export
Goto Forum:
  


Current Time: Fri Mar 29 04:04:39 CDT 2024