tlist problem..pls help [message #116413] |
Tue, 19 April 2005 19:35 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
ramisy2k
Messages: 150 Registered: April 2005
|
Senior Member |
|
|
Hello,
I am facing a problem..pls help me...
I have tlist in a form and i have populted 400 names of students form a table to the tlist..in alpahbetical order
I have used when-list-activated trigger and when any selected name is double clicked then it moves form the current tlist to another tlist...and is also deleted from the current tlist..using the delete_list_element built_in
the problem is that when the element is deleted from the first tlist the tlist is scrolls back to top and doesn't keeps the focus around where the last element was deleted...
Suppose, the list has following names
John
Brown
Smith
Richar
brian
Jimmy
Rick
Yaseen
Zaimad
and so on..
suppose i scroll down in the tlist and click the name 'Yaseen' which is at the end part of the tlist as starts with Y..so when it is deleted from the list the tlist scrolls up and displays the names that start with 'A'
I wnat that when the list elemnt is deleted the tlist remains where it had been before deleting list element or move move to the next name with the same first letter of the name which is deleted or move to the first name starting from the next alphabet....so for the above case
i want after Yaseen is deleted the tlist sld preselect the name 'Zaimad' as it is next on the list after "Yaseen'
...i would be grateful if some one helps me..
best regards,
Ramis.
|
|
|
|
Re: tlist problem..pls help [message #116540 is a reply to message #116416] |
Wed, 20 April 2005 10:03 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
ramisy2k
Messages: 150 Registered: April 2005
|
Senior Member |
|
|
hi martin
many thanks for ur reply..no perhpas u have not got my question...as u said suppose i have deleted 'Yaseen' now i dont want to go to the 'Yaseen' but as soon as the element is dleted the tlist sld highlight or select the next name after 'yaseen' and should not scroll up automatically to the top of tlist each time after the elemt is deleted
i am using this procedure to move my element and delete the clicked element from the tlist...
PROCEDURE DELETE_STUDENT (FROM_LIST_NAME VARCHAR2) IS
list_id item;
LIST_COUNT NUMBER;
CURRENT_VALUE VARCHAR2(50);
CLICKED_VALUE VARCHAR2(50):= name_in(FROM_LIST_NAME);
CLICKED_LABEL VARCHAR2(80);
BEGIN
list_id := find_item(FROM_LIST_NAME);
IF ID_NULL(LIST_ID) THEN
MESSAGE('MESSAGE_TEXT');
RAISE FORM_TRIGGER_FAILURE;
END IF;
LIST_COUNT := GET_LIST_ELEMENT_COUNT(list_id);
FOR i IN 1..LIST_COUNT LOOP
CURRENT_VALUE := GET_LIST_ELEMENT_VALUE(list_id, i);
IF CLICKED_VALUE = CURRENT_VALUE THEN
clicked_label := GET_LIST_ELEMENT_LABEl(LIST_ID, i);
DELETE_LIST_ELEMENT(list_id, i);
exit;
end if;
end loop;
EXCEPTION WHEN OTHERS THEN MESSAGE('MESSAGE_TEXT');
RAISE FORM_TRIGGER_FAILURE;
end;
--------------------------------------------------
Now I am usIng the the following code on the trigger when-list-activated on bloCk level..to call my procedure from there...
declare
list_activated varchar2(50) := :system.trigger_item;
begin
if list_activated = 'BLOCK.TLIST_ITEM' then
DELETE_STUDENT (''BLOCK.TLIST_ITEM');
end if;
end;
-----------------------------------------------------
NOW PLS TELL
what should i do SO THAT WHEN AN ELEMNT IS DELETED THE TLIST SLECTS THE NEXT OR PREVIOUS STUDENT NAME AS I MENTIONED IN MY ORIGINAL QUESTION...
PLS ADJUST THE NECESSARY CODE FOR MY REQUIREMET IN THE ABOVE CODING
REGARDS,
Ramis.
|
|
|
Re: tlist problem..pls help [message #116607 is a reply to message #116413] |
Wed, 20 April 2005 20:19 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/67467.jpg) |
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
I'm sorry but I don't have time to build a full test form. But please try what I detailed previously.
When you find the entry you want to delete, also find the value of the next entry, and after the delete place that value in your field and reactivate the tlist. You may have to use a timer to active the 'set' and 'pop'.
|
|
|