Home » Developer & Programmer » Forms » how to delete list eliment when u dont know index number
how to delete list eliment when u dont know index number [message #86400] Tue, 28 September 2004 02:33 Go to next message
shish mate
Messages: 49
Registered: February 2004
Member
i want to delete list eliment which is selected by user @ run time can and i dont know the index number can any one help me
Re: how to delete list eliment when u dont know index number [message #86405 is a reply to message #86400] Tue, 28 September 2004 03:21 Go to previous messageGo to next message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Hi,
You may make use of Ftree.Get_Tree_Selection to get the index no. of a node.

e.g.

Declare
L_Tree_Node FTREE.NODE;
L_Item ITEM;
Begin
L_Item := FIND_ITEM('USER_MENU_TREE_BLK.USER_MENU_TREE');
L_Tree_Node := Ftree.Get_Tree_Selection(L_Item, I);
End;

HTH
Regards
Himanshu
Re: how to delete list eliment when u dont know index number [message #86415 is a reply to message #86405] Tue, 28 September 2004 19:36 Go to previous messageGo to next message
shish mate
Messages: 49
Registered: February 2004
Member
what is this L_Tree_Node FTREE.NODE;
Re: how to delete list eliment when u dont know index number [message #86420 is a reply to message #86415] Tue, 28 September 2004 22:33 Go to previous message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Hi Ashsih,
Sorry I gave you code for Deleting Tree Node from a Tree item.

Here is a code for List items:

/*

** Built-in: GET_LIST_ELEMENT_COUNT
** Example: Add an element to the list item. Before adding
** the element, verify that the element is not in
** the current list.
*/
DECLARE
total_list_count NUMBER(2);
loop_index_var NUMBER(2) := 1;
list_element VARCHAR2(50);
list_element_value VARCHAR2(50);
list_element_to_add VARCHAR2(50);
list_value_to_add VARCHAR2(50);
element_match VARCHAR2(5) := 'TRUE';
value_match VARCHAR2(5) := 'TRUE';
BEGIN
/*
** Determine the total number of list elements.
*/
total_list_count := Get_List_Element_Count(list_id);
/*
** Compare the current list item elements with the element that
** needs to be deleted.
*/
LOOP
list_element := Get_List_Element_Value(list_id,
loop_index_var);
loop_index_var := loop_index_var + 1;
IF list_element_to_add = list_element THEN
element_match := 'FALSE';
END IF;
EXIT WHEN list_element = list_element_to_add OR
loop_index_var = total_list_count;
END LOOP;
/*
** Compare the current list item values with the value that
** will be added.
*/
loop_index_var := 1;
LOOP
list_element_value:= Get_List_Element_Value(list_id,
loop_index_var);
loop_index_var := loop_index_var + 1;
IF list_value_to_add = list_element_value THEN
value_match := 'FALSE';
END IF;
EXIT WHEN list_element_value = list_value_to_add OR
loop_index_var = total_list_count;
END LOOP;
/*
** Add the element and value if it is not in the current list
*/
IF element_match AND value_match = 'TRUE' THEN
DELETE_List_Element(list_id, loop_index_var);
END IF
END;

HTH
Regards
Himanshu
Previous Topic: Problem in Forms MDI Window
Next Topic: urgent delete list eliments
Goto Forum:
  


Current Time: Mon Sep 09 17:19:41 CDT 2024