Part of the EllisLab Network
   
 
Quick Question!
Posted: 08 July 2009 10: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 11:34 AM   [ Ignore ]   [ # 1 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  212
Joined  06-06-2007

Quick answer: Yes! Use Ajax

 Signature 

Arie.nl My CodeIgniter webshop.
http://werkschoenen.arie.nl, http://auto.arie.nl, http://merken.arie.nl, http://poets-wax.arie.nl, http://gereedschap.arie.nl

Profile
 
 
Posted: 08 July 2009 12:28 PM   [ Ignore ]   [ # 2 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  2264
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 

Become a fan of the CodeIgniter Cookbook (estimated: Fall 2010).

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

Profile
 
 
Posted: 09 July 2009 03: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 03:19 AM   [ Ignore ]   [ # 4 ]  
Grad Student
Rank
Total Posts:  33
Joined  03-24-2009

Worked like a charm, thank you very much.

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 819, on March 11, 2010 11:15 AM
Total Registered Members: 120309 Total Logged-in Users: 49
Total Topics: 126428 Total Anonymous Users: 5
Total Replies: 664852 Total Guests: 430
Total Posts: 791280    
Members ( View Memberlist )
Newest Members:  tismonAssetwebClearsitenwsvhelixBloom-Mediaamon77stacker574SPeed_FANat1cWandaTGOLIBU