Search in a tabpanel

Hello, I think I’ve seen this error in the forum before, but cannot find it. When I search records through a tab panel, alle records are shown no matter what I search for. It is the most simple relation and the most simple tab panel I am using: “People to address”. Just the people_id to link between them. As said before, when searching for a street or so, I’ll end up with all records in people.

Any ideas?

can’t reproduce it.

i have a order formpanel ->order_lines/details (formpanel)
relation on order_id

and when i search (CTRL-F) and i fill in order_detail the quantity field to 10 i only get all the orders that have one ore more order_detail lines with the quantity 10..

so i have to see youre example

we’ve had this before… I’d have to send you at least 3 SQL Server databases. How are we going to trace this?

If I search directly in the (related) table, the results are fine. If I search via the tab panel, all records are shown.

just figured, when using a portal the search works like expected. I have also placed a new tab panel in my form with the same problem as described before.

maybe it relates to this problem could not delete record, try showAll records - Classic Servoy - Servoy Community?

I just created to new forms, one for people, on for addresses. The relation goes from people.people_id to addresses.people_id; That’s it?! Still doesn’t work. I get all records, no errors. If I search for a street called ‘xxxyyyzzz’ I don’t get an error either, all records show up.

MS SQL Server 2000, latest Servoy Beta, Windows XP, Java 1.4.2.

Thanks!

one more thing that might help you trace this: when I go to the people form (that has the addresses in a tab) and try to search, no proper results. Then I go to the address form directly, I see the two addresses that were related to the last record in people I looked at. I search for a street and do get an error (no search results). Then I load all records, search for the same street again and bingo, there it is. Once I have selected all records, everything goes fine inside the address form itself. If I go back to the people form and then back to the address form, I can’t find what I am looking for until I select all records again.

So even searching in the addresses form doesn’t always work right.

to make everything clear:

if you have a main form with a tabpanel that is based on a relation.
And you do CTRL-F and you input only a value in a field on the related tab.

Then you can have 2 options..
1> if the search find something it will show only the main row records that containts that related record value.
2> if the search doesn’t find something it will say that (modify search??) if you say no then it will show ALL records of the main form

if you go to the related tab directly and you see the related records of the last main recod of the previous form..
If you then search in this field. You search only through the relation
So if you have 5 records with one has a fieldvalue of 10. And you are searching for that 10 then you will find only one record.. Even if there where more records on that table with that value (but not in the relation of that panel with main->related tab)

so i don’t know exactly which part doesn’t work for you.
And you are saying that you see errors? What kind of errors? That no records are found is not an error. That is just a message..

i have only no idee what you mean with this:

If I search directly in the (related) table, the results are fine. If I search via the tab panel, all records are shown.

what do you meain with search directly in the related table?
and what do you meain search via tab panel , all records are shown? What kind of records from the main?

Hello Johan,

I try to make clear what happens. It is a nasty problem…

I have a table people with people_id as a primary key. Based on that I have a form, that shows people in record view.

Then I have a table called addresses, with address_id as pk and people_id as a foreign key. For addresses I have a table view. A relation people_to_addresses points from people.people_id to address.people_id and shows all related addresses via a tab panel.

When I enter finds mode in the people form ans search for whatever address (e.g. street = “xxxxxxxx” which does not exist) I always get all records from people returned. No “message” telling me no records were found or anyhting else. When I search for an address that exists I also get all records from people returned. The one I see doesn’t have the address I looked for.

Then I go to table form addresses directly (via the windows menu). I see some addresses (the ones that are related to the last people record I looked at). I enter find mode, search for an address that I know exists and hit F3. Now I get the message, telling me that no records were found (which is wrong, the address exists!). Then I load all addresses (ctrl.-j). Now I go back to find mode, enter the same street as before and voila, the address shows up.

I have lots of tables related to people. The story goes for all of those the same. If you enter a search criteria in any of the tabs of the people form, all records in people are returned, if they have the address, phone number, contact or whatever I search for or not. I always end up with all records in people, no search is performed! That is the problem.

I hope I made myself understandable and hope the problem can be traced and fixed!

Thanks, Patrick

When I enter finds mode in the people form ans search for whatever address (e.g. street = “xxxxxxxx” which does not exist) I always get all records from people returned. No “message” telling me no records were found or anyhting else.

it is strange that you don’t get the message that no records where found. But that you get all the people returned is right (that happens when i say in the message i get that i don’t want to modify the search)

When I search for an address that exists I also get all records from people returned. The one I see doesn’t have the address I looked for.

this is very strange and i can’t reproduce that as i said above. I made an example myself by using the crm example data of order to orderdetail. And if i search for an order througth the tab orderdetail (fill in quantity field) i do get exactly the right orders.
So for me to see youre behaviour i have to have youre solution example (prefereable build on the examle database of the crm, so that you don’t have to send me the database)

Then I go to table form addresses directly (via the windows menu). I see some addresses (the ones that are related to the last people record I looked at). I enter find mode, search for an address that I know exists and hit F3. Now I get the message, telling me that no records were found (which is wrong, the address exists!).

no the don’t exists!!
As i said before when you go directly to the address form which still displays the related data of the person selected in the person form.. And you search in that one you only search in the records of the related foundset. So if you see 3 records in that foundset and you search in that one you can’t get any other record then the onces that are already in that foundset..

As you mention that you can find them if you do first loadAllRecords. This is correct. Because then you don’t have a related foundset in that form anymore but a global table foundset..
So the behaviour that you see when viewing the address form as a main form is correct.

As you mention that you can find them if you do first loadAllRecords. This is correct. Because then you don't have a related foundset in that form anymore but a global table foundset..

OK for that.

I have attached a solution called “Test” with the database. I was able to reproduce that on a firebird database. This is so strange… If there was a bug everybody else would have screamed already, it seems to be something with my installation or something. I am curious to see what happens in your case.

In the test example you see a form called “data_single” with a tab panel that shows some related data. You see a guy called “Peter” with related data “Peter1” and “Peter2”. If I search for related_data “Peter” I get all records (I should get a message, since I didn’t search “Peter%”).

Let’s see what happens when you try.

Thanks, Patrick

one more interesting thing: when doing the same search via a method (instead of ctrl-f), results are correct.

ok i could reproduce it under RC6 but not anymore in the current code. So it seems to befixed for RC7. Please try it out when it comes out (this week)

poooh… I am glad. I will try RC7 :lol: