And resolved. The issue appears to be pretty wide spread, the last posting I saw was from 2007 but no fix.
As it turns out though I was just doing things wrong. I needed to separate the paging actions and the action that was actually being displayed. I'm not sure where the %s comes from but it goes away and comes back depending on which div I specified that paginate should replace. If I replaced #content all was good but it refreshed everything the view was giving it and duplicating things inside the paging div. I worked around that by making the paging output its own action. Now instead of getting bad request 400 when updating #content or duplicating the view inside of the paging div when updating #paging there are no bad request 400 and the correct div is updating with JUST the information I wanted updated. Thanks for listening to me work through this one... hope it helps someone in the future. On Oct 12, 11:35 am, Anthony <[email protected]> wrote: > Wow, talk about embarrassing, it seemed like it was going to be much > more complicated than this. > > Accomplished my goal for the most part... see below for an explanation > of what I've done, but I still have one small issue. It doesn't seem > to be effecting the rendering or parsing of any of the code (no errors > anyway) but when the page is loaded I see two requests for /schools/ > view/%s which result in 400 bad request. Sorting the lists or > updating the container results in two requests the good one and a %s. > Any ideas where that's coming from or how I might go about tracking it > down? As far as I'm aware there is nothing in my code that would > result in an URL ending with %s.... > > Now for the other part: > > This was really very simple... I'm not sure if there was a more > efficient way to get it all done in one go but all it took to do what > I wanted above was after running my find for the school and checking > that data was returned I just needed to setup some options on the > paginater, paginate the results, and lastly (not shown here) cutting > out the reports returned by the findBySlug magic function using > contain. > > function view($id = null) { > $school = $this->School->findBySlug($id); > if (!empty($school)) { > $this->paginate = array( > 'Report' => array( > 'conditions' => > array('Report.school_id' => $school['School'] > ['id']), > ), > ); > > $this->set('reports', $this->paginate('Report')); > $this->set('school', $school); > } > else { > $this->Session->setFlash(__('No matching school was > found.', > true)); > $this->redirect(array('action' => 'index')); > } > } > > On Oct 12, 10:49 am, Anthony <[email protected]> wrote: > > > Is is possible to paginate based on data returned from a previous > > query? > > > Example: > > > I'm displaying the detail for a school. Each school has many reports > > and I would like to paginate just the reports that were returned from > > the query used to look up the school. > > > My first instinct was to just do something like this: $this- > > > >paginate($school['Report']) > > > However this didn't work; I'm guessing because paginate calls find > > itself. > > > Does this mean I need to use contain to not return the reports the > > first time then make a second query using paginate for the schools > > reports? > > > Is there a way to do this without making that second query? > > > Lastly, I followed the ajax (jQuery) pagination examples to make the > > full list of schools and reports paginated with ajax. How can I reuse > > these elements to make the reports section on the view ajax > > paginatable. (I'm pretty sure thats a valid technical term...) > > > Thanks in advanced for any assistance and insight. > > Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
