morowind
Posts: 46
|
Posted: 02/05/2014, 5:37 AM |
|
I realy don't know how to redirect to next page on Editable Grid submit event.
|
|
|
eratech
Posts: 513
|
Posted: 02/06/2014, 7:10 PM |
|
Same as you would any other page.....
Change the 'Return Page' property on the Record/Editable Grid.
If left blank it will show the same page again.
In code there is also the $Redirect variable (in PHP), but the property is the easiest.
See also Help Manual for 'Redirect'
Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |
|
|
morowind
Posts: 46
|
Posted: 02/14/2014, 4:56 AM |
|
Thank you eratech but it doesn't help...Maybe I was confused about....
This is how I dooit:
function Questions_AfterSubmit(& $sender) {
$Questions_AfterSubmit = true;
$Component = & $sender;
$Container = & CCGetParentContainer($sender);
global $Questions; //Compatibility
//End Questions_AfterSubmit
//Custom Code @22-2A29BDB7
// -------------------------
global $FileName;
global $Redirect;
$pg = CCRemoveParam(CCGetQueryString("QueryString", ""), "QuestionsPage");
$pg = CCRemoveParam(CCGetQueryString("QueryString", ""), "ccsForm");
if ($Component->PageNumber <> $Component->RecordCount->GetValue()) {
$pg = CCAddParam($pg, "QuestionPage", $Component->PageNumber + 1);
$Redirect = '../'.$FileName."?". $pg;
}
if ($Component->PageNumber == $Component->RecordCount->GetValue()){
$pg = CCRemoveParam(CCGetQueryString("QueryString", ""), "QuestionsPage");
$Redirect = '../Pages/ThankYou.php'."?". $pg;
}
// -------------------------
//End Custom Code
//Close Questions_AfterSubmit @2-301A00C0
return $Questions_AfterSubmit;
}
|
|
|
eratech
Posts: 513
|
Posted: 02/14/2014, 7:40 PM |
|
Ok, never really used it to go through pages of questions before.
I treat the Editable Grid as a multi-record display, and when it is submitted (updated) I usually store something in the record that I use to filter display.
For example, a list of transactions that you are setting status for approving/rejecting. When loading the Editable Grid the query is for any transactions with a null 'status' (and date filters etc etc), and when the user has set them and updated the records, the query will reload the page (can use blank 'Redirect' property on the Editable grid as that will default to the same page) and then shows the next bunch of transactions with 'null' status.
For your questions, you can flag that they have been answered (if you are storing answers, then you know which have been answered) and display the unanswered ones.
From your code you appear to be checking the PageNumber of the grid against the number of Records - are you using a single question per page (so page number relates to question number but not recordcount if there are 10 questions in total) or are there multiple questions per page (eg: 10 total questions at 5 questions per page would never match the number of records: pagenumber 2 <> records of 10, so your redirects would never be set.
If you are doing 1 question per page, a single Record would probably work instead and you can retrieve the next question through a querystring value.
Cheers
Eric
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |
|
|
morowind
Posts: 46
|
Posted: 02/27/2014, 4:10 AM |
|
You have right, thank you.Works only 1 question per page.
|
|
|
eratech
Posts: 513
|
Posted: 02/27/2014, 9:53 PM |
|
Glad to help, and thanks for marking the topic Resolved.
E
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia |
|
|
|