how to delete an element randomly in tlist [message #81926] |
Wed, 02 April 2003 04:02 |
zhangrui
Messages: 37 Registered: March 2003
|
Member |
|
|
hi,all
I want to delete any element seleced randomly in 'tlist' by pressing a 'delete' button.
eg,there 5 elements(a,b,c,d,e) in tlist1,i want to delete 'b' when it selected by mouse sometimes,but sometimes 'd' can be deleted when I presss the 'delete'
button.
|
|
|
Re: how to delete an element randomly in tlist [message #81927 is a reply to message #81926] |
Wed, 02 April 2003 04:12 |
utsav
Messages: 94 Registered: March 2003
|
Member |
|
|
Hi,
I dont think if theres any direct method or builtin that can be used to delete items from tlist liske this.
What u can do is this,
use the list changed trigger, in this trigger store the value of currently selected item and thenuse a loop on button press to find the index of the item and then delete it.
Try it and in case of problems do let me know.
utsav.
|
|
|
Re: how to delete an element randomly in tlist [message #81982 is a reply to message #81926] |
Mon, 07 April 2003 09:42 |
sameer_am2002
Messages: 129 Registered: September 2002
|
Senior Member |
|
|
Yes u can do it.Follow this method . Create one dummy block item.Write this code in the When list Activated trigger
declare
lv_value varchar2(30) ;
begin
:dummy := :system.current_value ;
end ;
Write this code in the Button Pressed
declare
lv_count varchar2(30) ;
lv_value varchar2(4) ;
lv_srno number := 1 ;
begin
lv_count := get_list_element_count('item_1') ;
loop
lv_value := get_list_element_value('item_1' ,lv_srno) ;
exit when :dummy = lv_value ;
lv_srno := lv_srno + 1 ;
end loop ;
delete_list_element('item_1' ,lv_srno) ;
end ;
|
|
|