Yahoo Lift error

6 views
Skip to first unread message

Charles F. Munat

unread,
May 23, 2009, 12:31:36 AM5/23/09
to Lift
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.

David Pollak

unread,
May 23, 2009, 1:22:28 AM5/23/09
to lif...@googlegroups.com
Are you getting it in the console... in the browser... where?  What are you doing to get the message?
--
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

Charles F. Munat

unread,
May 23, 2009, 3:53:06 AM5/23/09
to lif...@googlegroups.com
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>
Reply all
Reply to author
Forward
0 new messages