Record Navigation

I have a database consisting of two tables, Names and Adresses. Each table will have approx. 900,000 records.

Searches to be performed will yeald anything upto 80,000 records, and I need a way of providing a quick navigation function. I don’t necessarily need to load all the foundset records (or is that a pre-requisite for record navigation), I just want to be able to go any record within the foundset quickly.

I have tried creating a global for the user to enter a record no., and setting up a method to use the global as a record no. to go to, which works fine for record counts under 200, but not over 200.

MAC OSX 10.3 server, running on an Apple Mac G4, database is in MySQL.

Any help would be appreciated.

There are 3 ways for doing this:

  1. search for the record

  2. create a relation with the global on the left side and the field you jumping to the right doing a controller.loadRecords(thatRelation) after filling the global

  3. looping until you are where you want to be (can be expensive)
    while(controller.recordIndex < controller.getMaxRecordIndex() && controller.recordIndex < globals.jump_id)
    {
    controller.recordIndex = controller.getMaxRecordIndex();
    }
    controller.recordIndex = globals.jump_id

Thanks for the response.

1 How would I go about searching for a particular record no (i.e the 1000th record in a found set of say 10,000) without having to go into Find mode.

2 Not quite sure what you are saying here. The global on the left no problem, but given that I am looking for a particular record no within a found set, what do I put on the right, bearing in mind that none of the fields will have relevant record no’s.

3 Tried that, and it’s too expensive.

What I am looking for is something similar to the way FM does it, i.e. after doing a search you get the records found on the left and then one just has to either pull the slider down or type in the record number to jump straight to that record in the found set.

Curious question how do you know what is on the 1000th record? (i.e. why whould you want?)

The answer is I don’t know what’s in the record. Just browsing records to ensure consistency plus a number of other reasons.

I could use the standard controller, but the 200 limit is a problem

i need to ask. why do you need a 80.000 records foundset?
and why do you then go to the 1000 or what ever?

people will never look at that many records.
what consistency are they checking?

I was trying to keep the description as brief as possible. However, it seems I ned to give more detail, so if it’s Ok with you, I will send over more info offline.

please send it over . and also tell what you are trying to do.

I would be interested to hear how this discussion ended.

I am also looking to implement a similar FM style controller/slider for browsing over potentially thousands of search results (up to 400,000 records).

Some of the technicians in our lab like to scroll over large sections of stocks for various reasons (mainly because they are used to FM and fear change!!! :evil:). I am currently considering replacing our FM database with a servoy - mysql implementation, and have been instructed that this is one of the requirements of any new interface we put in place.

Any instructions on getting this working would be greatly appreciated.

Thanks
Simon

servoydump.txt (302 KB)

you can scroll just fine over 1000+ records
they will be loaded in chunks of 200 when you hit the then current maxFoundSet index.

if you want to scroll to record 1500 (i still have no clue why you would do that) then you can do that in javascript pretty easy

var wantedIndex = 1500;
do
{
var current = controller.getMaxRecordIndex();
controller.recordIndex = current;
}
while(controller.getMaxRecordIndex() <wantedIndex &&
controller.getMaxRecordIndex() > current)
controller.recordIndex = wantedIndex;

Thanks for that, I think I have convinced the technicians that they dont need the ability to scroll the entire database anymore! :D . Like I said, it was just a tool available in File Maker, that they requested in the new interface.

I am having a little trouble getting a custom JSlider working. Would it be possible to see some of the code that is used to get the slider working for the default controller?

Do you have any plans for a Servoy workshop in the UK this year?

Simon

the default controller is a pure java implementation.
I didn’t use the jslider yet as a bean in javascript.. so i can’t help you with that one right now.

How do I get the total number of records in a foundset?
Is there a single method to get this?

Also, could anyone give me some general pointers on how I could set up a method for updating a single field in every record in a foundset?

Any help would be great.

try to move sample on databaseManager.getFoundSetCount(…)

As for the Update of a single field in every record in a foundset: See the FoundSetUpdater functions under the DatabaseManager… And search the forum, since there have been a couple discussions going on how to get it to work.

Paul

test_data.backup.txt (93.7 KB)

Thanks for the response.

As I am a novice with servoy, im not sure if what Im doing is correct. I am storing the getfoundsetcount in a global variable, which is displayed in a field on my navigation form.

The variable is set when onShow is executed on the form, and it displays the correct value of the initial foundset.
Now, if I issue the default find to search a field, the global variable is not updated in the results, because the method to calculate it isnt called again. How can I get the display of the foundsetcount updated automatically after a simple find is executed?

Do I need to write my own find method? Or is there a much simpler way to do this?

Sorry for the simple questions, hopefully I can get the hang of this soon…

Simon

OK, I sorted the above issue myself.

I have my own method executed onFind, I want to include in the method the ability to search colums based on the text entered into the dataproviders in my form (like how the default onFind does it). How do I get the data out of the fields in find mode?

Can I use the onRecordEdit in find mode to store the entered text into a global?

that won’t work.
in find mode scripts aren’t working. So onRecordSelect will not be executed.

if you work with global input fields you will need to trigger youre own search. So put a search button on the form and when they fill in the globals and press that button you do the search.

Thanks, that was how I did it in the end.

Your help whilst I have been getting to grips with the demo has been very much appreciated. We are currently seriously considering purchasing Servoy and using it within our department.

Cheers for now.
Simon