Lift autocomplete's widget

45 views
Skip to first unread message

Roch Delsalle

unread,
Oct 25, 2012, 6:23:06 AM10/25/12
to lif...@googlegroups.com
Hi,

I'm using Lift's autocomplete widget a lot in some parts of my website,
I would like to know if there is any way I can get rid of the <span> thats appearing around my input text : 

<span class="product" size="16" type="text">
        <link type="text/css" rel="stylesheet" href="/classpath/autocomplete/jquery.autocomplete.css">
        <input type="text" value="" id="F4641319815512IPJBJ" autocomplete="off" class="ac_input">
        <input name="F4641319815525IP1WI" type="hidden" value="" id="F4641319815525IP1WI">
</span>

I'm adding the AutoComplete to ".product" using a CssSel (I don't have this issue when I call the autocomplete directly into the template but I have to pass parameters this time),

Thanks for your help,

Roch

and...@officenet.no

unread,
Oct 25, 2012, 7:45:36 AM10/25/12
to lif...@googlegroups.com
    def hideParent(sel: CssSel): CssSel = {
        "*" #> ((ns: NodeSeq) => PassThru(sel(ns.head.child)))
    }
 
val xml = <div class="outer"><input type="text"/></div>
(".outer" #> hideParent(":text" #> <input type="text" name="struts" value=""/>)).apply(xml)
res3: scala.xml.NodeSeq = NodeSeq(<input value="" type="text" name="struts" class="outer"></input>)
 
without hideParent:
(".outer" #> (":text" #> <input type="text" name="struts" value=""/>)).apply(xml)
res4: scala.xml.NodeSeq = NodeSeq(<div class="outer"><input value="" type="text" name="struts"></input></div>)
 
--
Andreas Joseph Krogh <and...@officenet.no>      mob: +47 909 56 963
Senior Software Developer / CEO - OfficeNet AS - http://www.officenet.no
Public key: http://home.officenet.no/~andreak/public_key.asc
 

Roch Delsalle

unread,
Oct 26, 2012, 6:23:17 AM10/26/12
to lif...@googlegroups.com
Thank you very much for the help ;)
--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code
 
 
 

Reply all
Reply to author
Forward
0 new messages