I'm getting it in Firebug when I try to use AJAX. It was working fine a 
month or two ago.

Here's the code that calls the AJAX. It adds or deletes a venue from an 
event.

def getVenuesBlock: NodeSeq = {
   val items = Model.createNamedQuery[Venue]("findAllVenues").findAll
   val ev = Model.createNamedQuery[Event]("findEventById",
     "id" -> event.id).findOne.openOr(new Event())
   val allItems = items.toList.map((x: Venue) => {
     (x.id.toString, x.name)
   })
   val currentItems = JPA.setToWrapper(ev.venues).toList.map(
     (x: Venue) => {(x.id.toString, x.name)}
   )
   val unusedItems = (allItems -- currentItems)

   <div class="venuesBlock">
     <div>{
       if (currentItems.isEmpty)
         <em>None</em>
       else
         JPA.setToWrapper(ev.venues).toList.map(
           (x: Venue) => {
             <div id={"venues" + x.id.toString}>{
               SHtml.ajaxButton("-",
                 () => {
                   val item = Model.getReference[Venue](classOf[Venue],
                     x.id)
                   val ev = Model.getReference[Event](classOf[Event],
                     event.id)
                   ev.venues.remove(item)
                   Model.merge(ev)
                   Model.flush()
                   SetHtml("venuesBlock", getVenuesBlock)
                 },
                 ("title", "Remove this venue"),
                 ("class", "removeButton")
               )
             }{x.name}</div>
           }
         )
       }</div>
       {
         if (unusedItems.isEmpty)
           Text("")
         else
           <div id="addVenue">{
             SHtml.ajaxForm(
               <p><input type="submit" value="+" class="addButton"
                 title="Add this venue"/> {
                   SHtml.select(unusedItems, Empty,
                     (id: String) => {
                       val item =
                         Model.getReference[Venue](classOf[Venue],
                           id.toLong)
                       val ev = Model.getReference[Event](classOf[Event],
                         event.id)
                       ev.venues.add(item)
                       Model.merge(ev)
                       Model.flush()
                       SetHtml("venuesBlock", getVenuesBlock)
                     },
                     ("id", "selectVenue")
                   )
                 }
               </p>
             )
           }</div>
       }
   </div>
}

David Pollak wrote:
> Are you getting it in the console... in the browser... where?  What are 
> you doing to get the message?
> 
> On Fri, May 22, 2009 at 9:31 PM, Charles F. Munat <c...@munat.com 
> <mailto:c...@munat.com>> wrote:
> 
> 
>     Any idea why I'm getting this:
> 
>     YAHOO.lift is undefined
>     lift_actualAjaxCall("F1048611400615MAS=true", function(),
>     function())liftAjax.js (line 134)
>     lift_doAjaxCycle()liftAjax.js (line 105)
>     lift_ajaxHandler("F1048611400615MAS=true", null, null)liftAjax.js
>     (line 16)
>     onclick(click clientX=132, clientY=431)g95xgMP4...YfQ%3D%3D (line 2)
>     [Break on this error] url =
>     YAHOO.lift.buildURI(addPageName('/...nSuccess(res);}, failure :
>     onFailure });
> 
>     Chas.
> 
> 
> 
> 
> 
> -- 
> Lift, the simply functional web framework http://liftweb.net
> Beginning Scala http://www.apress.com/book/view/1430219890
> Follow me: http://twitter.com/dpp
> Git some: http://github.com/dpp
> 
> > 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to