Vertical Scrollbal Issue [message #465551] |
Wed, 14 July 2010 12:28 |
Dysnomia
Messages: 9 Registered: February 2009 Location: Clearwater, FL
|
Junior Member |
|
|
Hello,
I am frustrated by the way the vertical scrollbar in forms 6i behaves. If I am dealing with a block with say 100 records and only have 14 displayed when the form is run the size of the scrollbar "bar" is half of the entire scrollbar length. If I scroll to the last record the size of the "bar" decreases by half its original size. It does not become the actual size until all records are displayed.
Now if I have "query all records" set to 'Y' then when the form is run the scrollbar "bar" is appropriately sized based on the total records in the form.
Now there could easily be 1000's of records in this table so I do not want to query all records. I have tried to increase the query array size and # of records buffered but this does not make any difference.
Does anyone have any workarounds to this or am I missing something obvious? Is there some way to size the scrollbar "bar" based on the total count of records when executing the query?
Thanks!
-Theresa
|
|
|
|
|
|
Re: Vertical Scrollbal Issue [message #465797 is a reply to message #465631] |
Thu, 15 July 2010 10:58 |
Dysnomia
Messages: 9 Registered: February 2009 Location: Clearwater, FL
|
Junior Member |
|
|
David, great solution now that's thinking outside the box =) It actually works great!
For anyone who would like to know how I did this:
Added logic to create a new timer in the block's post query. And added a when-timer-expired trigger to the form:
DECLARE
s varchar2(200);
BEGIN
s := get_application_property(timer_name);
IF s = 'QUERY_RECORDS' THEN
GO_BLOCK('PO');
For xx in 1..100 LOOP
IF not :system.last_record = 'TRUE' then
next_record;
end if;
END LOOP;
FIRST_RECORD;
END IF;
END;
|
|
|
Re: Vertical Scrollbal Issue [message #465804 is a reply to message #465797] |
Thu, 15 July 2010 11:08 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
I suspect that might come back and bite you.
Remember that post-query runs for every row retrieved by the query. So if your query returns a lot of rows then:
a) you could have a lot of unnecessary timers.
b) If you haven't set the block to retrieve all rows at once then that timer trigger can actually cause the post-query to fire again as it retrieves more rows from the DB. Which would recreate the timer.
c) If it takes a while to query the data you could very easily have timing issues:
1) Set the timer to too small a time and it could run while oracle is still querying data which could cause all sorts of problems.
2) Set the timer to too large a time and it could run after the user starts modifying data which would really annoy them - If they can't modify data then this is less of an issue.
|
|
|
Re: Vertical Scrollbal Issue [message #465822 is a reply to message #465804] |
Thu, 15 July 2010 12:00 |
Dysnomia
Messages: 9 Registered: February 2009 Location: Clearwater, FL
|
Junior Member |
|
|
Good point cookiemonster. I am currently testing this on a block with 80 records. Below is the logic when I create the timer in the block Post-Query, I first check to make sure the timer does not exist. I put in some error trapping and we are only hitting the when-timer-expired trigger twice.
I'll run some further testing on a different form with more records but it appears to work alright for now.
DECLARE
temp_timer TIMER;
BEGIN
temp_timer := find_timer('QUERY_RECORDS');
if not id_null(temp_timer) then
return;
end if;
temp_timer := Create_Timer('QUERY_RECORDS', 1 , NO_REPEAT );
END;
|
|
|
|
Re: Vertical Scrollbal Issue [message #465827 is a reply to message #465826] |
Thu, 15 July 2010 12:27 |
Dysnomia
Messages: 9 Registered: February 2009 Location: Clearwater, FL
|
Junior Member |
|
|
@Littlefoot yes that should work but I assume that it would have the same effect as having the block property "Query all records" set to "Yes". What I am trying to avoid is making forms actually query ALL of the records as we have some clients with very large amounts of data so we are trying to find a way to make navigation easier without drastically increasing the time it takes to query.
|
|
|
|
Re: Vertical Scrollbal Issue [message #465989 is a reply to message #465860] |
Fri, 16 July 2010 04:46 |
|
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
I thought that you would do this in the 'When-New-Form-Instance' and not be using a timer.
David
PS What happens if you do a 'go_record(100)' and there is less than 100 records that can be retrieved?
[Updated on: Fri, 16 July 2010 04:50] Report message to a moderator
|
|
|
|
|
Re: Vertical Scrollbal Issue [message #466179 is a reply to message #466001] |
Sat, 17 July 2010 09:13 |
Dysnomia
Messages: 9 Registered: February 2009 Location: Clearwater, FL
|
Junior Member |
|
|
@Cookiemonster, that is my assumption which is why I put the logic in the Post-Query.
@Littlefoot, I would have thought you would get an error if the block does not have that amt of records but just tried it and it worked as you indicated! Seems a better solution then looping.
[Updated on: Sat, 17 July 2010 09:14] Report message to a moderator
|
|
|
|
|
|
Re: Vertical Scrollbal Issue [message #466649 is a reply to message #466645] |
Tue, 20 July 2010 07:27 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
If the form executes one query based on parameters that'd work.
If there's an option to go into enter-query mode and execute queries with different criteria I don't see how it helps.
|
|
|
|
|
|
|
|