Home » Developer & Programmer » Forms » how to navigate on list item (Forms [32 Bit] Version 6.0.8.11.3 ,Oracle8i Enterprise Edition Release 8.1.7.0.0)
how to navigate on list item [message #666662] Mon, 20 November 2017 00:44 Go to next message
shawaj
Messages: 89
Registered: January 2016
Member
Hello,
I have created a list item and i want to search in list for specific value.

DECLARE
   l_count INTEGER;
   l_text VARCHAR2(100);
   l_indx	number;
BEGIN
   l_count := GET_LIST_ELEMENT_COUNT('BUT.PONO');
   IF nvl(l_count,0)>1 then
	   FOR i in 1..l_count LOOP 
	      IF GET_LIST_ELEMENT_LABEL('BUT.PONO',i) = :BUT.SEARCH_PO THEN
	      	l_text := GET_LIST_ELEMENT_VALUE('BUT.PONO',i);
	      	l_indx :=i;
	      	exit;
	      END IF;
	   END LOOP;
   END IF;
   message(l_text);
END;

now i want to send cursor on i index value of list 'BUT.PONO'
Re: how to navigate on list item [message #666664 is a reply to message #666662] Mon, 20 November 2017 02:29 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'd switch to list of values (LoV) as they are simpler to handle, you can easily search through their values, ... So, apart from a list item looking "better", I don't see any benefit over a LoV.
Re: how to navigate on list item [message #666665 is a reply to message #666664] Mon, 20 November 2017 02:47 Go to previous messageGo to next message
shawaj
Messages: 89
Registered: January 2016
Member
But it is existing system.Users do not like LOV so i can not convert it into LOV.
As mentioned in attached file
  • Attachment: SCRPRNT.png
    (Size: 41.40KB, Downloaded 1828 times)

[Updated on: Mon, 20 November 2017 03:08]

Report message to a moderator

Re: how to navigate on list item [message #666680 is a reply to message #666665] Mon, 20 November 2017 04:50 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Sorry, I wouldn't know how to do that.
Re: how to navigate on list item [message #666684 is a reply to message #666680] Mon, 20 November 2017 05:09 Go to previous messageGo to next message
shawaj
Messages: 89
Registered: January 2016
Member
I have resolved this problem using the following code

DECLARE
   l_count 		INTEGER DEFAULT 0;
   l_text 		VARCHAR2(100);
   l_indx			number default 0;
   Problem   	EXCEPTION;
	 l_n				number :=1;
	 not_found	exception;
BEGIN
   l_count := GET_LIST_ELEMENT_COUNT('BUT.PONO');
   IF nvl(l_count,0)=0 then
   	raise problem;
   	else
	   FOR i in 1..l_count LOOP 
	      IF Upper(GET_LIST_ELEMENT_LABEL('BUT.PONO',i)) LIKE upper(:BUT.SEARCH_PO)||'%' THEN
--	      	l_text := GET_LIST_ELEMENT_VALUE('BUT.PONO',i);
	      	l_indx :=i;
--					DELETE_LIST_ELEMENT('BUT.PONO',i);
	      	exit;
	      END IF;
	   END LOOP;
   	END IF; 
   	IF l_indx < 1 then
   		:BUT.PONO :=GET_LIST_ELEMENT_VALUE('BUT.PONO',1);
   		raise not_found;
   	else
   		:BUT.PONO :=GET_LIST_ELEMENT_VALUE('BUT.PONO',l_indx);
   	END IF;
   	
  EXCEPTION 
   	WHEN Problem then
   	message('can not find in empty list..!');
   	WHEN NOT_FOUND THEN
   	message('Does not exists in list..!!');
   	when others then
   	message('Error in finding..'); 
END;
Re: how to navigate on list item [message #666685 is a reply to message #666684] Mon, 20 November 2017 05:19 Go to previous message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Excellent, if it does what you need.
Previous Topic: matched query issue
Next Topic: Unsupported item type
Goto Forum:
  


Current Time: Wed Dec 04 02:23:05 CST 2024