Ville
|
| Posted: 04/01/2003, 6:03 PM |
|
I'm working on an application in CCS 2.0. It has multiple, almost identical pages, each with a grid and a record. The only difference between the pages is some custom code (SQL 'where' clause) in the grid's 'Before Build Select' event to pull varying reports depending on which page is chosen from the initial menu.
The small inconvenience I came across is that the Record part of the page is not cleared when moving from one report to another; the application remembers the last item chosen from the grid -- even if it was on a different page. This can be confusing to the user as the item the Record section is displaying may be such that while it obviously existed on the page it was selected from, it may not exist on the new report page they have moved on to because of the different SQL 'where' clause.
So my question is, how to reset/clear the Record section of the page when entering a page? Optimally the Record section would display data only after the user has selected an item from the grid.
Thanks for any help!
|
|
|
 |
Ville
|
| Posted: 04/02/2003, 7:38 PM |
|
Well, here's the solution:
I noticed that the "ID" is passed between the pages as a part of the URL. To reset the ID, I simply added a piece of code in each grid/record page's "After Initialize" as follows:
if Request.QueryString("page")<> "1" Then
Response.Redirect Request.ServerVariables("SCRIPT_NAME")&"?page=1"
end if
Obviously, the page number differs depending on the page. This wipes out the "ID" tag and clears the Record when a different report page is entered.
I could not figure out how to add multiple parameters to the URL using CCAddParam as per the example
if Request.QueryString("status")= Empty Then
Response.Redirect Request.ServerVariables("SCRIPT_NAME")&"?"&_
CCAddParam(Request.ServerVariables("QUERY_STRING"), "status", 1)
end if
For this use my solution is cleaner, but if someone know how to add two or more parameteres with CCAddParam it would be useful to know for future reference.
|
|
|
 |
|