Part of the EllisLab Network
   
 
Quick Question!
Posted: 08 July 2009 11:02 AM   [ Ignore ]  
Grad Student
Rank
Total Posts:  33
Joined  03-24-2009

Is it possible to automatically refresh the page after a view is loaded?

The reason I ask is because say for example in one view I deleted some database fields and then loaded up a view displaying the updated fields. It will NOT show the updated content until I refresh.

Is there a way to fix this?

Thank you!

Profile
 
 
Posted: 08 July 2009 12:34 PM   [ Ignore ]   [ # 1 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  489
Joined  06-06-2007

Quick answer: Yes! Use Ajax

Profile
 
 
Posted: 08 July 2009 01:28 PM   [ Ignore ]   [ # 2 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2280
Joined  07-30-2007

This merely sounds like a browsing caching issue.

If I have a series of records, each with a checkbox, I click on all the little checkboxes, hit a delete button. That form self-submits to the same controller/method that displayed the list of results, runs some validation processes, sends the delete action to the model, then redirects to the controller/method again (to display the list of results), that new view should only show what exists in the database at that time.

function view() {
  $this
->load->library('form_validation');

  if (
$this->form_validation->run()) {
    
// Make a call to the model's delete action for each of the selected checkboxes
    
redirect('controller/view');
    return;
  
}
  
// Make a call to the model to retrieve all records - place in $data var
  
$this->load->view('records/edit'$data);

Maybe a more detailed explanation of exactly what is wrong is in order…

 Signature 

Follow me on twitter here.
MichaelWales.com | MichaelWales.info

Profile
 
 
Posted: 09 July 2009 04:15 AM   [ Ignore ]   [ # 3 ]  
Grad Student
Rank
Total Posts:  33
Joined  03-24-2009

Hmm, so instead of loading a view - I’ll do a redirect instead. I never actually though of that, I’m gonna give it ago and let you know.

@ Michael Wales - you are spot on with the explanation, what you’ve done is what I’m trying to accomplish.

Profile
 
 
Posted: 09 July 2009 04:19 AM   [ Ignore ]   [ # 4 ]  
Grad Student
Rank
Total Posts:  33
Joined  03-24-2009

Worked like a charm, thank you very much.

Profile