frdmgrp
Posts: 16
|
Posted: 02/23/2010, 6:04 AM |
|
I am creating an editable grid with listboxes. I have a search box as well.
When the page initially loads, it seems to be loading all records, this is causing things to time out as the list boxes do a lot of work, and there are a lot of records in the table. Even when I set the default value of the search fields to a value that should return no rows (which is what I want for the initial load), it brings back everything until I actually do a search.
This behavior is preventing me from building out the whole page, because the initial load is causing a timeout.
I'm sure this can be done, what am I missing?
|
|
|
datadoit
|
Posted: 02/23/2010, 3:17 PM |
|
One way around this is to hide the grid if there are no search
parameters in the URL (or no QueryString).
Do this in the page's BeforeShow event.
|
|
|
frdmgrp
Posts: 16
|
Posted: 02/23/2010, 6:36 PM |
|
Thanks for that, I will try that. So if it is hidden, it won't execute the query to load the grid?
|
|
|
datadoit
|
Posted: 02/24/2010, 5:11 AM |
|
Correct. It'll "build" the query, but it won't "execute" the query
($this->query($this->SQL)).
|
|
|
frdmgrp
Posts: 16
|
Posted: 02/24/2010, 12:35 PM |
|
Thanks, that seems to work real well.
Do you know if I have to have the primary key as part of the grid for an update to work properly? I don't have it now, and the update seems to be updating every record, instead of just the ones I update on the screen.
I should be able to just update a couple fields on a couple rows, right?
|
|
|
datadoit
|
Posted: 02/25/2010, 6:20 AM |
|
Yes, usually the easiest method is to have the primary key on each
record row as a hidden field, since it needs not be changed. The other
method is to do a Custom Update.
|
|
|
frdmgrp
Posts: 16
|
Posted: 02/25/2010, 7:43 AM |
|
Thank you again!
I tried adding the primary key, and that didn't really work, so I went into the custom update, and sure enough it was not using the primary key in the where clause. So I updated that, and it stopped updating all the records. Unfortunately now it won't update any.
It complains "One or more parameters missing to perform the Update/Delete. The application is misconfigured."
I went through the options on the custom update screen, and set things as well as I could. where clause is only primary key, parameters only update if there is a value, don't update things from the grid that are informational, etc. But am still getting the above error.
Any thoughts on that?
Does every element of the grid have to be in the update?
|
|
|
datadoit
|
Posted: 02/25/2010, 1:53 PM |
|
To double check... make sure you placed the hidden primary key field in
the 'row', and the datasource for that hidden component is set. To
verify it's in the right place, temporarily change the hidden field
control to a label. It should display each PK on each row of the grid.
Secondly, is it a multi-column primary key?
|
|
|
frdmgrp
Posts: 16
|
Posted: 02/26/2010, 10:55 AM |
|
Yeah, I didn't have it hidden, and it was displaying proper values.
No, it's not a multi-column primary key.
I am on 3.2, could this be a task that didn't work well then?
Given how far I am from being done on this, I think I am going to have to take it outside of the tool and write the code manually.
|
|
|
datadoit
|
Posted: 02/26/2010, 3:33 PM |
|
On 2/26/2010 1:55 PM, frdmgrp wrote:
> Yeah, I didn't have it hidden, and it was displaying proper values.
>
> No, it's not a multi-column primary key.
>
> I am on 3.2, could this be a task that didn't work well then?
>
> Given how far I am from being done on this, I think I am going to have to take
> it outside of the tool and write the code manually.
> ---------------------------------------
Wait! Don't leave yet. :)
When you had it displayed, did you have it as a text box or a label? To
effectively handle the update, it has to be an input control (textbox or
hidden).
I don't recall editable grid issues in 3.2. As a last resort perhaps
run through the wizard again and see if it works 'out-of-the-gate'.
|
|
|
frdmgrp
Posts: 16
|
Posted: 02/27/2010, 6:48 AM |
|
Yeah, it's a text box.
I can go try the wizard again, Thanks for the help. This is only the tip of the iceberg for the complexity I need on this screen, and can't spend more weeks trying to get past these simple issues that 'should' work.
I've got someone willing to handwrite this page for $200(classic ASP), so I think I'll just go that route. CCS seems to handle the simple well, but the complex seems to require a masters degree.
Thanks for all your efforts on this, I will make an attempt to repay the community.
|
|
|
datadoit
|
Posted: 02/27/2010, 6:59 AM |
|
No doubt there's a bit of a learning curve.
|
|
|
|