SelectRecord not going to the correct record.

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

SelectRecord not going to the correct record.

Postby melchizedek » Mon Oct 18, 2004 8:54 pm

I have 2 forms currently. The first form is a docket form. Part of the Docket is a companyid which corrisponds to the primary key of the Company table. I need to select a company for the docket but do to the large number of companies I cannot use a dropdown (4500+ records). I have built a second form which I called CompanySelect. I have a button on the docket form that causes the CompanySelect form to display (in list view). There is a button beside each record which passes the selected company back to the docket form to change the companyid of the docket.

My problem is I want the CompanySelect form to goto the currently set company for the docket and it is not working correctly. I am using the following code called from the dockt form:

forms.CompanySelect.controller.loadAllRecords();
forms.CompanySelect.foundset.selectRecord(companyid);
forms.CompanySelect.controller.show();

The first time that the CompanySelect form displays the first record in the foundset is always selected regardless of what record is supposed to display. After the first load if I go back to the CompanySelect form the correct record will be displayed as long as the record is one of the first 200 in the list. If I scroll down the list and select a record >200 in the list then when I come back to the form it will go to the correct record. However, if I filter the list and then select the record and then return to the docket and try to select a Company again the selected record will be whatever position that the filterd lists record position was but of course because loadAllRecords was called the list will be showing the entire list not just my filtered list so the index position was wrong.

Does anyone know how to get around this or see what I am doing wrong?.
melchizedek
 
Posts: 2
Joined: Fri Oct 08, 2004 4:53 pm

Postby Jan Blok » Thu Oct 21, 2004 11:15 am

selectRecord only selects a row when in the client cache..., to show the current selected record in your case, show it in a global in the title header part in the form "CompanySelect"
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 24 guests

cron