Hallo
 I won't mix scala code with html code. So first I have a binding
bind("hotel", template,"starRating" -> {getStars
(elem.hotelInfo.stars)})

and function
def getStars(stars : String) : NodeSeq = {
         if(stars.length >0) {
          var style = "width: " + (stars.toInt * 10) + "px;"
          <div  class="fespHotelStarContainer" style={style}>
        <div class="fespHotelStars"></div>
          </div>
         } else {<div/>}
        }

in html code then I have only <hotel:starRating/> and works fine, but
it is possible to call from html function from lift ? Something like
tihs:
 <div  class="fespHotelStarContainer" style=***********>
                        <div class="fespHotelStars"/>
  </div>

and in ***** like getStars(<hotel:stars/>)
def getStars(stars: String) : String = {
"width: " + (stars.toInt * 10) + "px;"
}

--

You received this message because you are subscribed to the Google Groups 
"Lift" 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/liftweb?hl=en.


Reply via email to