JimmyCrackedCorn
Posts: 583
|
| Posted: 05/02/2007, 1:12 AM |
|
I have a simple search form with a grid below it. All created with the application builder.
When a user first gets to the page I needed to have the grid start empty rather than filled. So I followed these instructions and have it working just fine,
http://support.yessoftware.com/kb_article.asp?article_id=65
However, now I want to give the user the ability to display all records if he wishes. Before he could have simply cleared all fields and submitted which would have returned all records (or at least a page worth). But since I turned this off as described above, an empty form submission results in no records being displayed.
How can I access the incoming values from the search form (in the Before Execute Select event of the grid)? I feel if I can access them I could let the user enter an odd key like ~ and then I could test for that. If found then I could change back to,
FormName.command.Where = ""
which will allow all records to be retrieved.
Or, is there a better way to do this?
_________________
Walter Kempees...you are dearly missed. |
 |
 |
Wkempees
|
| Posted: 05/02/2007, 3:26 AM |
|
On the SearchForm put a button or a link (as you like)
have it put a self defined string on the URL like "?search="showAll"
In your grid test for that parameter and then change the Where.
Walter
|
|
|
 |
JimmyCrackedCorn
Posts: 583
|
| Posted: 05/02/2007, 3:57 AM |
|
thanks for your reply Walter. I can't seem to get that to work though. I'm sure I'm doing something silly.
I added the link to my search form as you described. Now when I launch this page and mouseover the link it shows,
http://localhost/myFolder/mySearchPage.asp?mySearch=showAll
Then, in my grid's Before Execute Select event I added,
if myGridForm.mySearch = "showAll" then
myGridForm.command.Where = ""
end if
doesn't work
_________________
Walter Kempees...you are dearly missed. |
 |
 |
Wkempees
|
| Posted: 05/02/2007, 4:26 AM |
|
I am not into ASP language but,
CCGetFromGet("mySearch","")
should get the URL value for you.
If that returns "" then it wasn;t there
if it returns "ShowAll" then do your Where stuff.
Something else bothering me is the URL you print in your post.
But for now try the above
Walter
|
|
|
 |
JimmyCrackedCorn
Posts: 583
|
| Posted: 05/02/2007, 7:07 AM |
|
nope. still cannot get anything passed in the querystring.
_________________
Walter Kempees...you are dearly missed. |
 |
 |
JimmyCrackedCorn
Posts: 583
|
| Posted: 05/02/2007, 7:30 AM |
|
if I cehck for CCGetFromGet("mySearch","") it does indeed = "showAll"
But, when I try and test for it I cannot get it to work.
if (myGridForm.command.Where = "") then
myGridForm.command.Where = "myGridForm.ID_B = -1"
elseif CCGetFromGet("mySearch","") = "showAll" then
tblCustomerHouseholds.command.Where = ""
end if
_________________
Walter Kempees...you are dearly missed. |
 |
 |
JimmyCrackedCorn
Posts: 583
|
| Posted: 05/02/2007, 7:56 AM |
|
OK. I'm moving forward a little bit now!
My conditional statement was backwards. The first condition was always true whether I clicked the button or the link. Now this is working,
if CCGetFromGet("mySearch","") = "showAll" then
tblCustomerHouseholds.command.Where = ""
elseif (myGridForm.command.Where = "") then
myGridForm.command.Where = "myGridForm.ID_B = -1"
end if
BUT, I have a new problem. Every time I click the link to show all more and more is added to the URL. Is there an inverse of CCGetFromGet for clearing this URL values?
_________________
Walter Kempees...you are dearly missed. |
 |
 |
MaFi
Posts: 49
|
| Posted: 05/04/2007, 2:46 AM |
|
Maybe you can do it in a different way.
If you call your search/grid form with a link like:
http://localhost/myFolder/mySearchPage.asp?hidegridname=1
the grid will not be displayed initially.
Remove the parameter hidegridname at the Search button
and add it to the Clearparameters (if used)
That should work fine and displays the grid only when
search is executed.
Martin
|
 |
 |
Wkempees
|
| Posted: 05/04/2007, 2:58 AM |
|
Remove parameters
is in the properties of your Grid
or
CCRemoveParam Function (ASP)
|
|
|
 |