Reputation: 15345
My problem is happening when I use some attributes in
I have the following error displayed on my webpage:
error on line 146 at column 80: AttValue: " or ' expected
Here is the corresponding line:
try{jQuery("#F114215951950RGX25X").each(function(i) {this.innerHTML = "<span id=\"F114215951957PA3NZS\"></span>";});} catch (e) {}
Here is the code in my snippet:
import net.liftweb.util.ValueCell
import http.SHtml
import net.liftweb.widgets.autocomplete.AutoComplete
object SearchMenu {
/* A valueCell on which WiringUI is used */
val wiringCell= ValueCell(true)
/* The function called in html template */
def display = WiringUI.apply(wiringCell)(displayAjax)
/* The cell to be updated using autocomplete */
val cell = ValueCell("")
/* The function to create and display the autocomplete box */
def displayAjax(value: Boolean)(ns:NodeSeq):NodeSeq = {
def buildQueryName(current: String, limit: Int): Seq[String] = {
if (current.length == 0) Nil
else (1 to limit).map(n => current+""+n).take(limit)
}
AutoComplete("", buildQueryName _, cell.set _)
}
}
Here is the code in my HTML page:
<form class="lift:form.ajax">
<div class="lift:display"> </div>
</form>
Note: the code works if I call displayAjax(true)
instead of display
, that is to say, if I don't use Wiring.
Note: I think the problem might come from the fact that autocomplete uses a script that is not loaded when using Wiring UI.
Upvotes: 1
Views: 169
Reputation: 15345
It seems like I found 2 bugs in lift for the autocomplete widget. Here is the thread in the official lift mailing list: https://groups.google.com/forum/?fromgroups#!topic/liftweb/Zu5DBqSSW4U
Upvotes: 1