Hi Brian, thank you for your answer. With $this->contain => false I'm using the shortform (see on http://book.cakephp.org/view/474/Containable).
I tried your changes. The errors changed: now in my view the vars which I set in the controller are unknown: Undefined variable: Objektnummer. Is it right, that the view is the same as for tab 1 to 4 or need I an element to display my variables? Regards Thomas On 15 Jul., 17:45, brian <[email protected]> wrote: > Don't use exit(). Try: > > function admin_getlist($id = null, $details = null) > { > if ($this->RequestHandler->isAjax()) > { > ... > > $this->set('Attachements',$attachements); > Configure::write('debug', 0); > $this->layout = 'ajax'; > } > > } > > Why do you have attach->('Containable') but then not use it? > > It should be Attachments, btw, but i guess it doesn't really matter. > > On Wed, Jul 15, 2009 at 10:42 AM, havanna<[email protected]> wrote: > > > Hi together, > > I have a view where I want to display thejQueryTabs UI with 5 tabs. > > Four of them are contain the content from the current Controller / > > View. So I have build it like the example: > > <script type="text/javascript"> > > $(function() { > > $("#tabs").tabs(); > > }); > > </script> > > <div id="tab-1"> > > <div id="tabs"> > > <ul> > > <li><a href="#tab-1"><span><?php echo __('Details'); ?></span></ > > a></li> > > <li><a href="#tab-2"><span><?php echo __('Fittings'); ?></span></ > > a></li> > > <li><a href="#tab-3"><span><?php echo __('Conditions'); ?></ > > span></a></li> > > <li><a href="#tab-4"><span><?php echo __('Partner'); ?></span></ > > a></li> > > <li><a href="/admin/attachements/getlist/<?php echo $this->data > > ['Posts']['id']; ?>"><span><?php echo __('Attachements'); ?></span></ > > a></li> > > </ul> > > The fifths tab should countain attachements, which is a 1:n relation > > to the current model. It tried to call it as a link (like injQuery > > Documentation described). > > > In my attachement controller I have this function > > > function admin_getlist($id = null, $details = null) { > > if ($this->RequestHandler->isAjax()) { > > $this->Attachements->Behaviors->attach('Containable'); > > $conditions = array('Attachements.post_id' => $id); > > $attachements = $this->Attachements->find('all', array( > > 'conditions' => $conditions, > > 'contain' => false > > ) > > ); > > > $this->set('Attachements',$attachements); > > $this->render(null,'ajax');exit; > > } > > } > > > From tab 1 to 4 everything works fine. If I call tab 5 I got the > > error: > > > [code]Notice (8): Undefined variable: javascript [APP/views/layouts/ > > admin.ctp, line 45] > > Fatal error: Call to a member function link() on a non-object in /www/ > > htdocs/w0064edd/demo/app/views/layouts/admin.ctp on line 45 > > > On line 45 is the command echo $javascript->link('jquery/ > > ui.core.js'); > > > This looks like missing the Javascript Helper. But the Javascript > > Helper is used in every controller and also in the AppController. > > > Can somebody explain me the reason? > > > Regards Thomas --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
