hi,

I just follow the instrction to do the "to-do list" ajax function. I
got everythin copy and pasted.
When I click the Add button there is an error message

To do

Notice: Undefined variable: javascript in
W:\www\blog\cake\libs\view\templates\layouts\default.thtml on line 36

Fatal error: Call to a member function link() on a non-object in
W:\www\blog\cake\libs\view\templates\layouts\default.thtml on line 36

Done
TestDelete
dddDelete

When I press F5 to refesh the whole page. It works!.... I can just
click to "to-do" or "done". But when I click the delete function, the
same error message comes again.

I just copy the following code and insert between <head>  in to my
default.thtml in the location of  cake/libs/views/templates/layouts/.
<?php print $html->charsetTag('UTF-8') ?>
<?php print $javascript->link('prototype') ?>
<?php print $javascript->link('scriptaculous.js?load=effects') ?> "


Can you help me figure out how is happen ?

Thanks
Eric C Blount wrote:
> That sounds like a likely candidate.
>
> I'd bet this tutorial will be helpful:
> http://wiki.cakephp.org/tutorials:ajax_sortable_list
>
> And in the controller, use the model functions:
> http://manual.cakephp.org/chapter/models
>
> Use $this->YourModel->findByUser_id($user_id) to try to get a result.
> If you get one, save the new values with $this->YourModel->save($newValues).
> If not, call $this->YourModel->create() before the save().
>
> Have Fun!
> Eric
>
>
> On 10/22/06, Eric <[EMAIL PROTECTED]> wrote:
> >
> >
> > Thanks  Eric...hehe (another Eirc)
> >
> > The cakephp AJAX library (prototype ,  script.aculo.us) seems just have
> > endDrag() ,which is "caught by the window's mouseup, stops dragging
> > the activeDraggable, if any, via its endDrag function. "
> >
> > Is it the function?
> >
> > More appreciate if you can post some code for the controller
> >
> > Thanks.
> >
> >
> >
> > Eric C Blount wrote:
> > > 1) Create a table with id,user_id,positionx,positiony
> > > 2) Create a model for that table
> > > 3) In your AJAX library, see if there's a callback function like
> > afterDrag()
> > > that you can call to send the x and y values with an ajax request
> > > 4) In the controller, store the values
> > > 5) On page load, read the values for the user and position the div
> > >
> > > HTH,
> > > Eric (the other Eric, confusing)
> > >
> > >
> > >
> > > On 10/22/06, Eric <[EMAIL PROTECTED]> wrote:
> > > >
> > > >
> > > > Hi,
> > > >
> > > > I am just learing Cake. I follow the instruction from the Tuto.  to
> > use
> > > > ajax to drag a element. But How Can I just save the postion after
> > > > draged baseon the user_ID.
> > > >
> > > >
> > > > Thanks
> > > >
> > > >
> > > > >
> > > >
> > >
> > > ------=_Part_127324_8450777.1161512368640
> > > Content-Type: text/html; charset=ISO-8859-1
> > > X-Google-AttachSize: 1026
> > >
> > > <div>1) Create a table with id,user_id,positionx,positiony</div>
> > > <div>2) Create a model for that table</div>
> > > <div>3) In yourAJAX library, see if there's a callback function like
> > afterDrag() that you can call to sendthe x and y values with an ajax
> > request</div>
> > > <div>4) In the controller, store the values</div>
> > > <div>5) On page load, read the values forthe user and position the
> > div</div>
> > > <div></div>
> > > <div>HTH,</div>
> > > <div>Eric (the other Eric, confusing)</div>
> > > <div><br><br></div>
> > > <div><span class="gmail_quote">On 10/22/06, <b
> > class="gmail_sendername">Eric</b> <<a href="mailto:[EMAIL PROTECTED]
> > ">[EMAIL PROTECTED]</a>> wrote:</span>
> > > <blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px
> > 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>Hi,<br><br>I am just
> > learing Cake. I follow the instruction from the Tuto.to use<br>ajax to
> > drag a element. But How Can I just save the postion after
> > > <br>draged baseon the user_ID.<br><br><br>Thanks<br><br><br><br>
> > >
> > > ------=_Part_127324_8450777.1161512368640--
> >
> >
> > >
> >
>
> ------=_Part_131908_24271256.1161557538340
> Content-Type: text/html; charset=ISO-8859-1
> X-Google-AttachSize: 4205
>
> <div>That sounds like a likely candidate.</div>
> <div>&nbsp;</div>
> <div>I'd bet this tutorial will be helpful:</div>
> <div><a 
> href="http://wiki.cakephp.org/tutorials:ajax_sortable_list";>http://wiki.cakephp.org/tutorials:ajax_sortable_list</a></div>
> <div>&nbsp;</div>
> <div>And in the controller, use the model functions:</div>
> <div><a 
> href="http://manual.cakephp.org/chapter/models";>http://manual.cakephp.org/chapter/models</a></div>
> <div>&nbsp;</div>
> <div>Use $this-&gt;YourModel-&gt;findByUser_id($user_id) to&nbsp;try to get a 
> result.</div>
> <div>If you get one, save the new&nbsp;values with 
> $this-&gt;YourModel-&gt;save($newValues).</div>
> <div>If not, call $this-&gt;YourModel-&gt;create() before the save().</div>
> <div>&nbsp;</div>
> <div>Have Fun!</div>
> <div>Eric<br><br>&nbsp;</div>
> <div><span class="gmail_quote">On 10/22/06, <b 
> class="gmail_sendername">Eric</b> &lt;<a href="mailto:[EMAIL 
> PROTECTED]">[EMAIL PROTECTED]</a>&gt; wrote:</span>
> <blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 
> 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>Thanks&nbsp;&nbsp;Eric...hehe 
> (another Eirc)<br><br>The cakephp AJAX library (prototype ,&nbsp;&nbsp;<a 
> href="http://script.aculo.us";>
> script.aculo.us</a>) seems just have<br>endDrag() ,which is &quot;caught by 
> the window's mouseup, stops dragging<br>the activeDraggable, if any, via its 
> endDrag function. &quot;<br><br>Is it the function?<br><br>More appreciate if 
> you can post some code for the controller
> <br><br>Thanks.<br><br><br><br>Eric C Blount wrote:<br>&gt; 1) Create a table 
> with id,user_id,positionx,positiony<br>&gt; 2) Create a model for that 
> table<br>&gt; 3) In your AJAX library, see if there's a callback function 
> like afterDrag()
> <br>&gt; that you can call to send the x and y values with an ajax 
> request<br>&gt; 4) In the controller, store the values<br>&gt; 5) On page 
> load, read the values for the user and position the div<br>&gt;<br>&gt; 
> HTH,<br>
> &gt; Eric (the other Eric, confusing)<br>&gt;<br>&gt;<br>&gt;<br>&gt; On 
> 10/22/06, Eric &lt;<a href="mailto:[EMAIL PROTECTED]">[EMAIL 
> PROTECTED]</a>&gt; wrote:<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; Hi,<br>&gt; 
> &gt;
> <br>&gt; &gt; I am just learing Cake. I follow the instruction from the 
> Tuto.&nbsp;&nbsp;to use<br>&gt; &gt; ajax to drag a element. But How Can I 
> just save the postion after<br>&gt; &gt; draged baseon the user_ID.<br>&gt; 
> &gt;<br>
> &gt; &gt;<br>&gt; &gt; Thanks<br>&gt; &gt;<br>&gt; &gt;<br>&gt; &gt; 
> &gt;<br>&gt; &gt;<br>&gt;<br>&gt; 
> ------=_Part_127324_8450777.1161512368640<br>&gt; Content-Type: text/html; 
> charset=ISO-8859-1<br>&gt; X-Google-AttachSize: 1026
> <br>&gt;<br>&gt; &lt;div&gt;1) Create a table with 
> id,user_id,positionx,positiony&lt;/div&gt;<br>&gt; &lt;div&gt;2) Create a 
> model for that table&lt;/div&gt;<br>&gt; &lt;div&gt;3) In yourAJAX library, 
> see if there's a callback function like afterDrag() that you can call to 
> sendthe x and y values with an ajax request&lt;/div&gt;
> <br>&gt; &lt;div&gt;4) In the controller, store the 
> values&lt;/div&gt;<br>&gt; &lt;div&gt;5) On page load, read the values forthe 
> user and position the div&lt;/div&gt;<br>&gt; &lt;div&gt;&lt;/div&gt;<br>&gt; 
> &lt;div&gt;HTH,&lt;/div&gt;
> <br>&gt; &lt;div&gt;Eric (the other Eric, confusing)&lt;/div&gt;<br>&gt; 
> &lt;div&gt;&lt;br&gt;&lt;br&gt;&lt;/div&gt;<br>&gt; &lt;div&gt;&lt;span 
> class=&quot;gmail_quote&quot;&gt;On 10/22/06, &lt;b 
> class=&quot;gmail_sendername&quot;&gt;Eric&lt;/b&gt; &lt;&lt;a 
> href=&quot;mailto:
> <a href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>&quot;&gt;<a 
> href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a>&lt;/a&gt;&gt; 
> wrote:&lt;/span&gt;<br>&gt; &lt;blockquote class=&quot;gmail_quote&quot; 
> style=&quot;PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px
> 0.8ex; BORDER-LEFT: #ccc 1px 
> solid&quot;&gt;&lt;br&gt;Hi,&lt;br&gt;&lt;br&gt;I am just learing Cake. I 
> follow the instruction from the <a href="http://Tuto.to";>Tuto.to</a> 
> use&lt;br&gt;ajax to drag a element. But How Can I just save the postion after
> <br>&gt; &lt;br&gt;draged baseon the 
> user_ID.&lt;br&gt;&lt;br&gt;&lt;br&gt;Thanks&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;<br>&gt;<br>&gt;
>  ------=_Part_127324_8450777.1161512368640--<br><br><br>
> ------=_Part_131908_24271256.1161557538340--


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to