Trait/Object

net.liftweb.http

SHtml

Related Docs: object SHtml | package http

Permalink

trait SHtml extends Loggable

The SHtml object defines a suite of XHTML element generator methods to simplify the creation of markup, particularly with forms and AJAX.

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. SHtml
  2. Loggable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. class ApplicableElem extends AnyRef

    Permalink
  2. trait AreaShape extends AnyRef

    Permalink
  3. final case class BasicElemAttr(name: String, value: String) extends ElemAttr with Product with Serializable

    Permalink

    Any old attribute.

    Any old attribute. You should not explicitly construct one of these, but rather use "name" -> "value" and let the implicit conversion take care of making a BasicElemAttr.

  4. final case class ChoiceHolder[T](items: Seq[ChoiceItem[T]]) extends Product with Serializable

    Permalink

    Holds a series of choices: HTML for input controls alongside some user defined value

  5. final case class ChoiceItem[T](key: T, xhtml: NodeSeq) extends Product with Serializable

    Permalink

    Holds a form control as HTML along with some user defined value

  6. case class CirclePercentShape(centerX: Int, centerY: Int, radiusPercent: Int) extends AreaShape with Product with Serializable

    Permalink
  7. case class CircleShape(centerX: Int, centerY: Int, radius: Int) extends AreaShape with Product with Serializable

    Permalink
  8. trait ElemAttr extends (Elem) ⇒ Elem

    Permalink

    An attribute that can be applied to an element.

    An attribute that can be applied to an element. Typically, this will be a key-value pair, but there is a class of HTML5 attributes that should be similated in JavaScript.

  9. trait PairStringPromoter[T] extends (T) ⇒ String

    Permalink

    Convert a T to a String for display in Select, MultiSelect, etc.

  10. case class PolyShape(polyCoords: (Int, Int)*) extends AreaShape with Product with Serializable

    Permalink
  11. case class RectShape(left: Int, top: Int, right: Int, bottom: Int) extends AreaShape with Product with Serializable

    Permalink
  12. final case class SelectableOption[+T](value: T, label: String, attrs: ElemAttr*) extends Product with Serializable

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object ChoiceHolder extends Serializable

    Permalink
  5. object ElemAttr

    Permalink

    The companion object that has some very helpful conversion

  6. object PairStringPromoter

    Permalink

    A companion object that does implicit conversions

  7. object SelectableOption extends Serializable

    Permalink
  8. def a(body: NodeSeq, cmd: JsCmd, attrs: ElemAttr*): Elem

    Permalink

    Create an anchor that will run a JavaScript command when clicked

  9. def a(jsFunc: Call, body: NodeSeq, attrs: ElemAttr*)(func: ⇒ JsCmd): Elem

    Permalink

    Create an anchor with a body and the function to be executed when the anchor is clicked

    Create an anchor with a body and the function to be executed when the anchor is clicked

    jsFunc

    -- the user function that will be executed. This function will receive as last parameter the function that will actually do the ajax call. Hence the user function can decide when to make the ajax request.

    body

    - the NodeSeq to wrap in the anchor tag

    attrs

    - the anchor node attributes

  10. def a(body: NodeSeq, attrs: ElemAttr*)(func: ⇒ JsCmd): Elem

    Permalink

    Create an anchor with a body and the function to be executed when the anchor is clicked

  11. def a(func: () ⇒ JsObj, jsonContext: JsonContext, body: NodeSeq, attrs: ElemAttr*): Elem

    Permalink
  12. def a(jsFunc: Call, func: () ⇒ JsCmd, body: NodeSeq, attrs: ElemAttr*): Elem

    Permalink

    Create an anchor tag around a body which will do an AJAX call and invoke the function

    Create an anchor tag around a body which will do an AJAX call and invoke the function

    jsFunc

    -- the user function that will be executed. This function will receive as last parameter the function that will actually do the ajax call. Hence the user function can decide when to make the ajax request.

    func

    - the function to invoke when the link is clicked

    body

    - the NodeSeq to wrap in the anchor tag

    attrs

    - the anchor node attributes

  13. def a(func: () ⇒ JsCmd, body: NodeSeq, attrs: ElemAttr*): Elem

    Permalink

    Create an anchor tag around a body which will do an AJAX call and invoke the function

    Create an anchor tag around a body which will do an AJAX call and invoke the function

    func

    - the function to invoke when the link is clicked

    body

    - the NodeSeq to wrap in the anchor tag

    attrs

    - the anchor node attributes

  14. def ajaxButton(text: String, jsFunc: Call, func: () ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink

    Create an Ajax button that when pressed, executes the function

    Create an Ajax button that when pressed, executes the function

    text

    -- the name/text of the button

    func

    -- the function to execute when the button is pushed. Return Noop if nothing changes on the browser.

    returns

    a button to put on your page

  15. def ajaxButton(text: String, func: () ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink

    Create an Ajax button that when pressed, executes the function

    Create an Ajax button that when pressed, executes the function

    text

    -- the name/text of the button

    func

    -- the function to execute when the button is pushed. Return Noop if nothing changes on the browser.

    returns

    a button to put on your page

  16. def ajaxButton(text: NodeSeq, jsFunc: Call, func: () ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink

    Create an Ajax button that when pressed, executes the function

    Create an Ajax button that when pressed, executes the function

    text

    -- the name/text of the button

    jsFunc

    -- the user function that will be executed. This function will receive as last parameter the function that will actually do the ajax call. Hence the user function can decide when to make the ajax request.

    func

    -- the function to execute when the button is pushed. Return Noop if nothing changes on the browser.

    returns

    a button to put on your pagejsFunc.params ++ List(AnonFunc(makeAjaxCall(Str(name+"=true"))))

  17. def ajaxButton(text: NodeSeq, jsExp: JsExp, func: (String) ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink

    Create an Ajax button that when pressed, executes the function

    Create an Ajax button that when pressed, executes the function

    text

    -- the name/text of the button

    func

    -- the function to execute when the button is pushed. Return Noop if nothing changes on the browser.

    attrs

    -- the list of node attributes

    returns

    a button to put on your page

  18. def ajaxButton(text: NodeSeq, func: () ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink

    Create an Ajax button.

    Create an Ajax button. When it's pressed, the function is executed

    text

    -- the name/text of the button

    func

    -- the function to execute when the button is pushed. Return Noop if nothing changes on the browser.

    attrs

    -- the list of node attributes

    returns

    a button to put on your page

  19. def ajaxCall(jsCalcValue: JsExp, jsContext: JsContext, func: (String) ⇒ JsCmd): GUIDJsExp

    Permalink

    Build a JavaScript function that will perform an AJAX call based on a value calculated in JavaScript

    Build a JavaScript function that will perform an AJAX call based on a value calculated in JavaScript

    jsCalcValue

    the JavaScript that will be executed on the client to calculate the value to be sent to the server

    jsContext

    the context instance that defines JavaScript to be executed on call success or failure

    func

    the function to call when the data is sent

    returns

    the function ID and JavaScript that makes the call

  20. def ajaxCall(jsCalcValue: JsExp, func: (String) ⇒ JsCmd): GUIDJsExp

    Permalink

    Build a JavaScript function that will perform an AJAX call based on a value calculated in JavaScript

    Build a JavaScript function that will perform an AJAX call based on a value calculated in JavaScript

    jsCalcValue

    the JavaScript that will be executed on the client to calculate the value to be sent to the server

    func

    the function to call when the data is sent

    returns

    the function ID and JavaScript that makes the call

  21. def ajaxCheckbox(value: Boolean, jsFunc: Call, func: (Boolean) ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink
  22. def ajaxCheckbox(value: Boolean, func: (Boolean) ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink
  23. def ajaxCheckboxElem(settable: Settable { type ValueType = Boolean }, jsFunc: Call, attrs: ElemAttr*): Elem

    Permalink
  24. def ajaxCheckboxElem(settable: Settable { type ValueType = Boolean }, attrs: ElemAttr*): Elem

    Permalink
  25. def ajaxEditable(displayContents: ⇒ NodeSeq, editForm: ⇒ NodeSeq, onSubmit: () ⇒ JsCmd): NodeSeq

    Permalink

    This method generates an AJAX editable field.

    This method generates an AJAX editable field.

    Normally, the displayContents will be shown, with an "Edit" button. If the "Edit" button is clicked, the field will be replaced with the edit form, along with an "OK" and "Cancel" button. If the OK button is pressed, the form fields are submitted and the onSubmit function is called, and then the displayContents are re-run to get a new display. If cancel is pressed then the original displayContents are re-shown.

    Note that the editForm NodeSeq is wrapped inside of an ajaxForm, so it can be comprised of normal (non-AJAX) SHtml form elements. For example:

    ajaxEditable(Test("Click me"),
                 SHtml.text("Edit me", s => println("Edited with " +s)),
                 () => { println("submitted"); Noop })
    

  26. def ajaxEditableSelect(opts: Seq[SelectableOption[String]], deflt: Box[String], f: (String) ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink

    Create a select box based on the list with a default value and the function to be executed on form submission with an additional selection that transforms select into an ajaxText allowing the user to add a new select option

  27. def ajaxForm(body: NodeSeq, onSubmit: JsCmd, postSubmit: JsCmd): Elem

    Permalink

    Takes a form and wraps it so that it will be submitted via AJAX.

    Takes a form and wraps it so that it will be submitted via AJAX. This also takes a parameter for script code that will be executed after the form has been submitted.

    body

    The form body. This should not include the <form> tag.

    postSubmit

    Code that should be executed after a successful submission

  28. def ajaxForm(body: NodeSeq, onSubmit: JsCmd): Elem

    Permalink

    Takes a form and wraps it so that it will be submitted via AJAX.

    Takes a form and wraps it so that it will be submitted via AJAX.

    body

    The form body. This should not include the <form> tag.

    onSubmit

    JavaScript code to execute on the client prior to submission

  29. def ajaxForm(body: NodeSeq): Elem

    Permalink

    Takes a form and wraps it so that it will be submitted via AJAX.

    Takes a form and wraps it so that it will be submitted via AJAX.

    body

    The form body. This should not include the <form> tag.

  30. def ajaxInvoke(func: () ⇒ JsCmd): GUIDJsExp

    Permalink
  31. def ajaxOnSubmit(func: () ⇒ JsCmd): (NodeSeq) ⇒ NodeSeq

    Permalink

    Add appropriate attributes to an input type="submit" or button element to make it submit an ajaxForm correctly and return a JsCmd to the client.

    Add appropriate attributes to an input type="submit" or button element to make it submit an ajaxForm correctly and return a JsCmd to the client. Note that the key difference between this and ajaxSubmit is that ajaxSubmit returns a complete input type="submit" element, while ajaxOnSubmit applies the right attributes to any input type="submit" *or* button element.

    Example:

    "type=submit" #> ajaxOnSubmit(() => Alert("Done!"))
    

  32. def ajaxRadio[T](opts: Seq[T], deflt: Box[T], ajaxFunc: (T) ⇒ JsCmd, attrs: ElemAttr*): ChoiceHolder[T]

    Permalink

    Make a set of Ajax radio buttons.

    Make a set of Ajax radio buttons. When the buttons are pressed, the function is called

    opts

    -- The possible values. These are not revealed to the browser

    deflt

    -- the default button

    ajaxFunc

    -- the function to invoke when the button is pressed

  33. def ajaxSelect(opts: Seq[SelectableOption[String]], deflt: Box[String], jsFunc: Call, func: (String) ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink
  34. def ajaxSelect(opts: Seq[SelectableOption[String]], deflt: Box[String], func: (String) ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink
  35. def ajaxSelectElem[T](options: Seq[T], default: Box[T], jsFunc: Call, attrs: ElemAttr*)(onSubmit: (T) ⇒ JsCmd)(implicit f: PairStringPromoter[T]): Elem

    Permalink

    Create a select box based on the list with a default value and the function to be executed on form submission

    Create a select box based on the list with a default value and the function to be executed on form submission

    options

    -- a list of value and text pairs (value, text to display)

    default

    -- the default value (or Empty if no default value)

    onSubmit

    -- the function to execute on form submission

  36. def ajaxSelectElem[T](options: Seq[T], default: Box[T], attrs: ElemAttr*)(onSubmit: (T) ⇒ JsCmd)(implicit f: PairStringPromoter[T]): Elem

    Permalink

    Create a select box based on the list with a default value and the function to be executed on form submission

    Create a select box based on the list with a default value and the function to be executed on form submission

    options

    -- a list of value and text pairs (value, text to display)

    default

    -- the default value (or Empty if no default value)

    onSubmit

    -- the function to execute on form submission

  37. def ajaxSelectObj[T](options: Seq[SelectableOption[T]], default: Box[T], jsFunc: Call, onSubmit: (T) ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink

    Create a select box based on the list with a default value and the function to be executed on form submission

    Create a select box based on the list with a default value and the function to be executed on form submission

    options

    -- a list of value and text pairs (value, text to display)

    default

    -- the default value (or Empty if no default value)

    onSubmit

    -- the function to execute on form submission

  38. def ajaxSelectObj[T](options: Seq[SelectableOption[T]], default: Box[T], onSubmit: (T) ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink

    Create a select box based on the list with a default value and the function to be executed on form submission

    Create a select box based on the list with a default value and the function to be executed on form submission

    options

    -- a list of value and text pairs (value, text to display)

    default

    -- the default value (or Empty if no default value)

    onSubmit

    -- the function to execute on form submission

  39. def ajaxSubmit(value: String, func: () ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink

    Constructs an Ajax submit button that can be used inside ajax forms.

    Constructs an Ajax submit button that can be used inside ajax forms. Multiple buttons can be used in the same form.

    value

    - the button text

    func

    - the ajax function to be called

    attrs

    - button attributes

  40. def ajaxText(value: String, ignoreBlur: Boolean, jsFunc: Call, func: (String) ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink
  41. def ajaxText(value: String, ignoreBlur: Boolean, func: (String) ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink
  42. def ajaxText(value: String, jsFunc: Call, func: (String) ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink
  43. def ajaxText(value: String, func: (String) ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink
  44. def ajaxTextElem(settable: Settable { type ValueType = String }, attrs: ElemAttr*): Elem

    Permalink
  45. def ajaxTextarea(value: String, jsFunc: Call, func: (String) ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink
  46. def ajaxTextarea(value: String, func: (String) ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink
  47. def ajaxUntrustedSelect(opts: Seq[SelectableOption[String]], deflt: Box[String], jsFunc: Call, func: (String) ⇒ JsCmd, attrs: (String, String)*): Elem

    Permalink

    Create a select box based on the list with a default value and the function to be executed on form submission.

    Create a select box based on the list with a default value and the function to be executed on form submission. No check is made to see if the resulting value was in the original list. For use with DHTML form updating.

    opts

    -- the options. A list of value and text pairs

    deflt

    -- the default value (or Empty if no default value)

    jsFunc

    -- user provided function

    func

    -- the function to execute on form submission

    attrs

    -- select box attributes

  48. def ajaxUntrustedSelect(opts: Seq[SelectableOption[String]], deflt: Box[String], func: (String) ⇒ JsCmd, attrs: (String, String)*): Elem

    Permalink

    Create a select box based on the list with a default value and the function to be executed on form submission.

    Create a select box based on the list with a default value and the function to be executed on form submission. No check is made to see if the resulting value was in the original list. For use with DHTML form updating.

    opts

    -- the options. A list of value and text pairs

    deflt

    -- the default value (or Empty if no default value)

    func

    -- the function to execute on form submission

    attrs

    -- select box attributes

  49. def area(shape: AreaShape, func: () ⇒ JsCmd, alt: String, attrs: ElemAttr*): Elem

    Permalink

    Generate an Area tag

    Generate an Area tag

    shape

    - the shape of the area (RectShape, CircleShape, CirclePercentShape, PolyShape)

    func

    - The server side function to execute when the area is clicked on.

    alt

    - the contents of the alt attribute

    attrs

    - the balance of the attributes for the tag

  50. def area(shape: AreaShape, jsCmd: JsCmd, alt: String, attrs: ElemAttr*): Elem

    Permalink

    Generate an Area tag

    Generate an Area tag

    shape

    - the shape of the area (RectShape, CircleShape, CirclePercentShape, PolyShape)

    jsCmd

    - the JavaScript to execute on the client when the area is clicked

    alt

    - the contents of the alt attribute

    attrs

    - the balance of the attributes for the tag

  51. def area(shape: AreaShape, alt: String, attrs: ElemAttr*): Elem

    Permalink

    Generate an Area tag

    Generate an Area tag

    shape

    - the shape of the area (RectShape, CircleShape, CirclePercentShape, PolyShape)

    alt

    - the contents of the alt attribute

    attrs

    - the balance of the attributes for the tag

  52. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  53. def button(strOrNodeSeq: StringOrNodeSeq, func: () ⇒ Any, attrs: ElemAttr*): Elem

    Permalink

    Create an HTML button with strOrNodeSeq as the body.

    Create an HTML button with strOrNodeSeq as the body. The button will be type submit.

    strOrNodeSeq

    -- the String or NodeSeq (either will work just fine) to put into the body of the button

    func

    -- the function to execute when the form containing the button is posted

    attrs

    -- the attributes to append to the button

    returns

    a button HTML Element b

  54. def checkbox(value: Boolean, func: (Boolean) ⇒ Any, attrs: ElemAttr*): NodeSeq

    Permalink

    Defines a new checkbox set to { @code value } and running { @code func } when the checkbox is submitted.

  55. def checkbox[T](possible: Seq[T], actual: Seq[T], func: (Seq[T]) ⇒ Any, attrs: ElemAttr*): ChoiceHolder[T]

    Permalink

    Generate a ChoiceHolder of possible checkbox type inputs that calls back to the given function when the form is submitted.

    Generate a ChoiceHolder of possible checkbox type inputs that calls back to the given function when the form is submitted.

    possible

    complete sequence of possible values, each a separate checkbox when rendered

    actual

    values to be preselected

    func

    function to receive all values corresponding to the checked boxes

    attrs

    sequence of attributes to apply to each checkbox input element

    returns

    ChoiceHolder containing the checkboxes and values in order

  56. def checkboxElem(settable: Settable { type ValueType = Boolean }, attrs: ElemAttr*): NodeSeq

    Permalink

    Defines a new checkbox for the Settable

  57. def checkbox_*(value: Boolean, func: AFuncHolder, id: Box[String], attrs: ElemAttr*): NodeSeq

    Permalink
  58. def checkbox_id(value: Boolean, func: (Boolean) ⇒ Any, id: Box[String], attrs: ElemAttr*): NodeSeq

    Permalink

    Defines a new checkbox set to { @code value } and running { @code func } when the checkbox is submitted.

    Defines a new checkbox set to { @code value } and running { @code func } when the checkbox is submitted. Has an id of { @code id }.

  59. def checkbox_id(settable: Settable { type ValueType = Boolean }, id: Box[String], attrs: ElemAttr*): NodeSeq

    Permalink

    Defines a new checkbox for the Settable

  60. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  61. implicit def elemToApplicable(e: Elem): ApplicableElem

    Permalink
  62. def email(settable: Settable { type ValueType = String }, attrs: ElemAttr*): Elem

    Permalink

    Generate an email input element for the Settable.

    Generate an email input element for the Settable. At some point there will be graceful fallback for non-HTML5 browsers. FIXME

  63. def email(value: String, func: (String) ⇒ Any, attrs: ElemAttr*): Elem

    Permalink

    Generate an input field with type email.

    Generate an input field with type email. At some point, there will be graceful fallback for non-HTML5 browsers. FIXME

  64. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  65. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  66. def fajaxCall[T](jsCalcValue: JsExp, func: (String) ⇒ JsCmd)(f: (String, JsExp) ⇒ T): T

    Permalink
  67. def fileUpload(func: (FileParamHolder) ⇒ Any, attrs: ElemAttr*): Elem

    Permalink

    Defines a form element for a file upload that will call the specified function when the file is uploaded if the file size is greater than zero.

    Defines a form element for a file upload that will call the specified function when the file is uploaded if the file size is greater than zero. Note that in order to use the fileUpload element you need to specify the multipart attribute on your snippet tag:

    <lift:Some.snippet form="POST" multipart="true">
    ...
    </lift:Some.snippet>
    

  68. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  69. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  70. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  71. def hidden(func: (String) ⇒ Any, defaultlValue: String, attrs: ElemAttr*): Elem

    Permalink
  72. def hidden(func: () ⇒ Any, attrs: ElemAttr*): Elem

    Permalink
  73. def hidden_*(func: AFuncHolder, attrs: ElemAttr*): Elem

    Permalink
  74. def hrefFunc(func: () ⇒ Any): (NodeSeq) ⇒ NodeSeq

    Permalink

    If you want to update the href of an <a> tag, this method returns a function that mutates the href by adding a function that will be executed when the link is clicked: "#my_link" #> SHtml.hrefFunc(() => println("howdy"))

    If you want to update the href of an <a> tag, this method returns a function that mutates the href by adding a function that will be executed when the link is clicked: "#my_link" #> SHtml.hrefFunc(() => println("howdy"))

  75. def idMemoize(f: (IdMemoizeTransform) ⇒ NodeSeqFuncOrSeqNodeSeqFunc): IdMemoizeTransform

    Permalink

    Memoize the NodeSeq used in apply() and then call applyAgain() in an Ajax call and you don't have to explicitly capture the template

  76. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  77. def jsonButton(text: NodeSeq, jsExp: JsExp, func: (JValue) ⇒ JsCmd, ajaxContext: JsonContext, attrs: ElemAttr*)(implicit dummy: AvoidTypeErasureIssues1): Elem

    Permalink

    Create an Ajax button that when pressed, submits an Ajax request and expects back a JSON construct which will be passed to the success function

    Create an Ajax button that when pressed, submits an Ajax request and expects back a JSON construct which will be passed to the success function

    text

    -- the name/text of the button

    func

    -- the function to execute when the button is pushed. Return Noop if nothing changes on the browser.

    ajaxContext

    -- defines the callback functions and the JSON response type

    attrs

    -- the list of node attributes

    returns

    a button to put on your page

  78. def jsonButton(text: NodeSeq, func: () ⇒ JsObj, ajaxContext: JsonContext, attrs: ElemAttr*): Elem

    Permalink

    Create an Ajax button that when pressed, submits an Ajax request and expects back a JSON construct which will be passed to the success function

    Create an Ajax button that when pressed, submits an Ajax request and expects back a JSON construct which will be passed to the success function

    text

    -- the name/text of the button

    func

    -- the function to execute when the button is pushed. Return Noop if nothing changes on the browser.

    ajaxContext

    -- defines the callback functions and the JSON response type

    attrs

    -- the list of node attributes

    returns

    a button to put on your page

  79. def jsonCall(jsCalcValue: JsExp, jsonContext: JsonContext, func: (JValue) ⇒ JValue): GUIDJsExp

    Permalink

    Build a JavaScript function that will perform a JSON call based on a value calculated in JavaScript.

    Build a JavaScript function that will perform a JSON call based on a value calculated in JavaScript.

    The JSON generated by func will be returned to the client and passed as argument to the javascript function specified in jsonContext.success

    jsCalcValue

    the JavaScript to calculate the value to be sent to the server

    jsonContext

    the context instance that defines JavaScript to be executed on call success or failure

    func

    the function to call when the JSON data is sent. The returned JSON is sent back to the client

    returns

    the function ID and JavaScript that makes the call

  80. def jsonCall(jsCalcValue: JsExp, jsContext: JsContext, func: (JValue) ⇒ JsCmd): GUIDJsExp

    Permalink

    Build a JavaScript function that will perform a JSON call based on a value calculated in JavaScript.

    Build a JavaScript function that will perform a JSON call based on a value calculated in JavaScript. This method uses the Lift-JSON package rather than the old, slow, not-typed JSONParser. This is the preferred way to do client to server JSON calls.

    jsCalcValue

    the JavaScript to calculate the value to be sent to the server

    jsContext

    the context instance that defines JavaScript to be executed on call success or failure

    func

    the function to call when the data is sent

    returns

    the function ID and JavaScript that makes the call

  81. def jsonCall(jsCalcValue: JsExp, func: (JValue) ⇒ JsCmd): GUIDJsExp

    Permalink

    Build a JavaScript function that will perform a JSON call based on a value calculated in JavaScript.

    Build a JavaScript function that will perform a JSON call based on a value calculated in JavaScript. This method uses the Lift-JSON package rather than the old, slow, not-typed JSONParser. This is the preferred way to do client to server JSON calls.

    jsCalcValue

    the JavaScript to calculate the value to be sent to the server

    func

    the function to call when the data is sent

    returns

    the function ID and JavaScript that makes the call

  82. def jsonText(value: String, cmd: String, json: JsonCall, attrs: ElemAttr*): Elem

    Permalink

    Create a JSON text widget that makes a JSON call on blur or "return".

    Create a JSON text widget that makes a JSON call on blur or "return".

    value

    - the initial value of the text field

    cmd

    - the json command name

    json

    - the JsonCall returned from S.createJsonFunc

    returns

    a text field

  83. def jsonText(value: String, json: (JsExp) ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink

    This function does not really submit a JSON request to the server.

    This function does not really submit a JSON request to the server. Instead, json is a function that allows you to build a more complex JsCmd based on the JsExp JE.JsRaw("this.value"). This function is called by the overloaded version of jsonText.

    value

    - the initial value of the text field

    json

    - takes a JsExp which describes how to recover the value of the text field and returns a JsExp containing the thing to execute on blur/return

    returns

    a text field

  84. def jsonText(value: String, ignoreBlur: Boolean, json: (JsExp) ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink

    This function does not really submit a JSON request to the server.

    This function does not really submit a JSON request to the server. Instead, json is a function that allows you to build a more complex JsCmd based on the JsExp JE.JsRaw("this.value"). This function is called by the overloaded version of jsonText.

    value

    - the initial value of the text field

    ignoreBlur

    - ignore the onblur event and only do the event if the enter key is pressed

    json

    - takes a JsExp which describes how to recover the value of the text field and returns a JsExp containing the thing to execute on blur/return

    returns

    a text field

  85. def jsonTextarea(value: String, cmd: String, json: JsonCall, attrs: ElemAttr*): Elem

    Permalink

    Create a JSON text area widget that makes a JSON call on blur

    Create a JSON text area widget that makes a JSON call on blur

    value

    - the initial value of the text field

    cmd

    - the json command name

    json

    - the JsonCall returned from S.createJsonFunc

    returns

    a text field

  86. def jsonTextarea(value: String, json: (JsExp) ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink

    This function does not really submit a JSON request to the server.

    This function does not really submit a JSON request to the server. Instead, json is a function that allows you to build a more complex JsCmd based on the JsExp JE.JsRaw("this.value"). This function is called by the overloaded version of jsonTextarea.

    value

    - the initial value of the text area field

    json

    - takes a JsExp which describes how to recover the value of the text area field and returns a JsExp containing the thing to execute on blur

    returns

    a text area field

  87. def link(to: String, func: () ⇒ Any, body: NodeSeq, attrs: ElemAttr*): Elem

    Permalink

    create an anchor tag around a body

    create an anchor tag around a body

    to

    the target

    func

    the function to invoke when the link is clicked

    body

    the NodeSeq to wrap in the anchor tag

    attrs

    the (optional) attributes for the HTML element

  88. val logger: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    Loggable
  89. def makeAjaxCall(in: JsExp, context: AjaxContext): JsExp

    Permalink

    Invokes the Ajax request

    Invokes the Ajax request

    in

    the JsExp that returns the request data

    context

    defines the response callback functions and the response type (JavaScript or JSON)

  90. def makeAjaxCall(in: JsExp): JsExp

    Permalink

    Invokes the Ajax request

    Invokes the Ajax request

    in

    the JsExp that returns the request data

  91. def makeFormsAjax: (NodeSeq) ⇒ NodeSeq

    Permalink

    Vend a function that will take all of the form elements and turns them into Ajax forms

  92. def memoize(f: ⇒ (NodeSeq) ⇒ NodeSeq): MemoizeTransform

    Permalink

    Memoize the NodeSeq used in apply() and then call applyAgain() in an Ajax call and you don't have to explicitly capture the template

  93. def multiSelect(opts: Seq[SelectableOption[String]], deflt: Seq[String], func: (List[String]) ⇒ Any, attrs: ElemAttr*): Elem

    Permalink
  94. def multiSelectElem[T](options: Seq[T], default: Seq[T], attrs: ElemAttr*)(onSubmit: (List[T]) ⇒ Any)(implicit f: PairStringPromoter[T]): Elem

    Permalink

    Create a select box based on the list with a default value and the function to be executed on form submission

    Create a select box based on the list with a default value and the function to be executed on form submission

    options

    -- a list of value and text pairs (value, text to display)

    default

    -- the default value (or Empty if no default value)

    onSubmit

    -- the function to execute on form submission

  95. def multiSelectObj[T](options: Seq[SelectableOption[T]], default: Seq[T], onSubmit: (List[T]) ⇒ Any, attrs: ElemAttr*): Elem

    Permalink

    Create a select box based on the list with a default value and the function to be executed on form submission

    Create a select box based on the list with a default value and the function to be executed on form submission

    options

    -- a list of value and text pairs (value, text to display)

    default

    -- the default value (or Empty if no default value)

    onSubmit

    -- the function to execute on form submission

  96. def multiSelect_*(opts: Seq[SelectableOption[String]], deflt: Seq[String], func: AFuncHolder, attrs: ElemAttr*): Elem

    Permalink
  97. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  98. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  99. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  100. def number(settable: Settable { type ValueType = Double }, min: Double, max: Double, step: Double, attrs: ElemAttr*): Elem

    Permalink

    Generate a number input element for the Settable.

    Generate a number input element for the Settable. It allows for Double if your step is for example: 0.1 At some point there will be graceful fallback for non-HTML5 browsers. FIXME

  101. def number(value: Double, func: (Double) ⇒ Any, min: Double, max: Double, step: Double, attrs: ElemAttr*): Elem

    Permalink

    Generate an input field with type number.

    Generate an input field with type number. It allows for Double if your step is for example: 0.1 At some point, there will be graceful fallback for non-HTML5 browsers. FIXME

  102. def number(settable: Settable { type ValueType = Int }, min: Int, max: Int, attrs: ElemAttr*): Elem

    Permalink

    Generate a number input element for the Settable.

    Generate a number input element for the Settable. At some point there will be graceful fallback for non-HTML5 browsers. FIXME

  103. def number(value: Int, func: (Int) ⇒ Any, min: Int, max: Int, attrs: ElemAttr*): Elem

    Permalink

    Generate an input field with type number.

    Generate an input field with type number. At some point, there will be graceful fallback for non-HTML5 browsers. FIXME

  104. def onEvent(func: (String) ⇒ JsCmd): GUIDJsExp

    Permalink

    Create something that's bindable to an event attribute and when the event happens, the command will fire: "input [onblur]" #> SHtml.onEvent(s => Alert("Thanks: "+s))

    Create something that's bindable to an event attribute and when the event happens, the command will fire: "input [onblur]" #> SHtml.onEvent(s => Alert("Thanks: "+s))

  105. def onEventIf(question: String, fn: (String) ⇒ JsCmd): GUIDJsExp

    Permalink

    Create something that's bindable to an event attribute and guarded by a confirm dialog.

    Create something that's bindable to an event attribute and guarded by a confirm dialog. The fn passed in will only execute if the user clicks the "OK" button in the confirm dialog. Useful for things like delete buttons that you want a confirmation on.

    ".deleteBtn [onclick]" #> SHtml.onEventIf("Are you sure you want to do that?", s => deleteUser())

  106. def onEvents(event: String, events: String*)(func: (String) ⇒ JsCmd): (NodeSeq) ⇒ NodeSeq

    Permalink

    Specify the events (e.g., onblur, onchange, etc.) and the function to execute on those events.

    Specify the events (e.g., onblur, onchange, etc.) and the function to execute on those events. Returns a NodeSeq => NodeSeq that will add the events to all the Elements ":text" #> SHtml.onEvents("onchange", "onblur")(s => Alert("yikes "+s))

  107. def onSubmit(func: (String) ⇒ Any): (NodeSeq) ⇒ NodeSeq

    Permalink

    Execute the String function when the form is submitted.

    Execute the String function when the form is submitted. This method returns a function that can be applied to form fields (input, button, textarea, select) and the function is executed when the form containing the field is submitted.

  108. def onSubmitBoolean(func: (Boolean) ⇒ Any): (NodeSeq) ⇒ NodeSeq

    Permalink

    Execute the Boolean function when the form is submitted.

    Execute the Boolean function when the form is submitted. This method returns a function that can be applied to form fields (input, button, textarea, select) and the function is executed when the form containing the field is submitted.

  109. def onSubmitImpl(func: AFuncHolder): (NodeSeq) ⇒ NodeSeq

    Permalink

    Execute the function when the form is submitted.

    Execute the function when the form is submitted. This method returns a function that can be applied to form fields (input, button, textarea, select) and the function is executed when the form containing the field is submitted.

  110. def onSubmitList(func: (List[String]) ⇒ Any): (NodeSeq) ⇒ NodeSeq

    Permalink

    Execute the List[String] function when the form is submitted.

    Execute the List[String] function when the form is submitted. This method returns a function that can be applied to form fields (input, button, textarea, select) and the function is executed when the form containing the field is submitted.

  111. def onSubmitUnit(func: () ⇒ Any): (NodeSeq) ⇒ NodeSeq

    Permalink

    Execute the function when the form is submitted.

    Execute the function when the form is submitted. This method returns a function that can be applied to form fields (input, button, textarea, select) and the function is executed when the form containing the field is submitted.

  112. def password(value: String, func: (String) ⇒ Any, attrs: ElemAttr*): Elem

    Permalink
  113. def passwordElem(settable: Settable { type ValueType = String }, attrs: ElemAttr*): Elem

    Permalink
  114. def password_*(value: String, func: AFuncHolder, attrs: ElemAttr*): Elem

    Permalink
  115. def radio(opts: Seq[String], deflt: Box[String], func: (String) ⇒ Any, attrs: ElemAttr*): ChoiceHolder[String]

    Permalink
  116. def radioCssSel[T](initialValue: Box[T], onSubmit: (Box[T]) ⇒ Any)(cssSelToValue: (String, T)*): CssSel

    Permalink

    Generate a CSS transform that will bind to a template containing radio buttons without overwriting the radio buttons in the template with entirely new elements.

    Generate a CSS transform that will bind to a template containing radio buttons without overwriting the radio buttons in the template with entirely new elements.

    This is a change in technique from the normal radio handlers in that it doesn't involve the creation of a new element or injection of hidden elements. That means that labels designed to target a partiular radio by ID and CSS styles that target elements following radios using the + CSS selector won't stop working once a form is bound by Lift.

    As an example, given the following template:

    <input type="radio" id="all-emails">
    <label for="all-emails">All emails.</label>
    
    <input type="radio" id="some-emails">
    <label for="some-emails">Some emails.</label>

    You might invoke this function like so:

    def render = {
      SHtml.radioCssSel[String](Empty, submitHandler) (
        "#all-emails" -> "All emails",
        "#some-emails" -> "Some emails"
      )
    }
    
    val submitHandler:Box[String] => Unit = { box =>
      println("We got a box!! "+box)
    }
    initialValue

    initial value or Empty if no initial value

    onSubmit

    function to execute on form submission

    cssSelToValue

    mapping between CSS selectors of radio input nodes and values assigned to them

  117. def radioElem[T](opts: Seq[T], deflt: Box[T], attrs: ElemAttr*)(onSubmit: (Box[T]) ⇒ Any): ChoiceHolder[T]

    Permalink

    Generate a collection or radio box items from a sequence of things

  118. def radio_*(opts: Seq[String], deflt: Box[String], func: AFuncHolder, attrs: ElemAttr*): ChoiceHolder[String]

    Permalink
  119. def range(settable: Settable { type ValueType = Int }, min: Int, max: Int, attrs: ElemAttr*): Elem

    Permalink

    Generate a range input element for the Settable.

    Generate a range input element for the Settable. At some point there will be graceful fallback for non-HTML5 browsers. FIXME

  120. def range(value: Int, func: (Int) ⇒ Any, min: Int, max: Int, attrs: ElemAttr*): Elem

    Permalink

    Generate an input field with type range.

    Generate an input field with type range. At some point, there will be graceful fallback for non-HTML5 browsers. FIXME

  121. def select(opts: Seq[SelectableOption[String]], deflt: Box[String], func: (String) ⇒ Any, attrs: ElemAttr*): Elem

    Permalink

    Create a select box based on the list with a default value and the function to be executed on form submission

    Create a select box based on the list with a default value and the function to be executed on form submission

    opts

    -- the options. A list of value and text pairs (value, text to display)

    deflt

    -- the default value (or Empty if no default value)

    func

    -- the function to execute on form submission

  122. def selectElem[T](options: Seq[T], settable: LiftValue[T], attrs: ElemAttr*)(implicit f: PairStringPromoter[T]): Elem

    Permalink

    Create a select box based on the list with a default value and the function to be executed on form submission

    Create a select box based on the list with a default value and the function to be executed on form submission

    options

    -- a list of values

    attrs

    -- the attributes to append to the resulting Elem, these may be name-value pairs (static attributes) or special HTML5 ElemAtts

    f

    -- the function that converts a T to a Display String.

  123. def selectElem[T](options: Seq[T], default: Box[T], attrs: ElemAttr*)(onSubmit: (T) ⇒ Any)(implicit f: PairStringPromoter[T]): Elem

    Permalink

    Create a select box based on the list with a default value and the function to be executed on form submission

    Create a select box based on the list with a default value and the function to be executed on form submission

    options

    -- a list of values

    default

    -- the default value (or Empty if no default value)

    attrs

    -- the attributes to append to the resulting Elem, these may be name-value pairs (static attributes) or special HTML5 ElemAtts

    onSubmit

    -- the function to execute on form submission

    f

    -- the function that converts a T to a Display String.

  124. def selectObj[T](options: Seq[SelectableOption[T]], default: Box[T], onSubmit: (T) ⇒ Any, attrs: ElemAttr*): Elem

    Permalink

    Create a select box based on the list with a default value and the function to be executed on form submission

    Create a select box based on the list with a default value and the function to be executed on form submission

    options

    -- a list of value and text pairs (value, text to display)

    default

    -- the default value (or Empty if no default value)

    onSubmit

    -- the function to execute on form submission

  125. def select_*(opts: Seq[SelectableOption[String]], deflt: Box[String], func: AFuncHolder, attrs: ElemAttr*): Elem

    Permalink

    Create a select box based on the list with a default value and the function to be executed on form submission

    Create a select box based on the list with a default value and the function to be executed on form submission

    opts

    -- the options. A list of value and text pairs

    deflt

    -- the default value (or Empty if no default value)

    func

    -- the function to execute on form submission

  126. def span(body: NodeSeq, cmd: JsCmd, attrs: ElemAttr*): Elem

    Permalink

    Create a span that will run a JavaScript command when clicked

  127. def submit(value: String, func: () ⇒ Any, attrs: ElemAttr*): Elem

    Permalink

    Generates a form submission button.

    Generates a form submission button.

    value

    The label for the button

    func

    The function that will be executed on form submission

    attrs

    Optional XHTML element attributes that will be applied to the button

  128. def submitAjaxForm(formId: String, postSubmit: Call): JsCmd

    Permalink

    Having a regular form, this method can be used to send the serialized content of the form.

    Having a regular form, this method can be used to send the serialized content of the form.

    formId

    - the id of the form

    postSubmit

    - the function that needs to be called after a successfull request

  129. def submitAjaxForm(formId: String, func: () ⇒ JsCmd): JsCmd

    Permalink

    Submits a form denominated by a formId and execute the func function after form fields functions are executed.

  130. def submitAjaxForm(formId: String): JsCmd

    Permalink

    Having a regular form, this method can be used to send the serialized content of the form.

    Having a regular form, this method can be used to send the serialized content of the form.

    formId

    - the id of the form

  131. def submitButton(func: () ⇒ Any, attrs: ElemAttr*): Elem

    Permalink

    Generates a form submission button with a default label.

    Generates a form submission button with a default label.

    func

    The function that will be executed on form submission

    attrs

    Optional XHTML element attributes that will be applied to the button

  132. def submit_*(value: String, func: AFuncHolder, attrs: ElemAttr*): Elem

    Permalink
  133. def swappable(shown: Elem, hidden: (String) ⇒ Elem): Elem

    Permalink
  134. def swappable(shown: Elem, hidden: Elem): Elem

    Permalink

    Build a swappable visual element.

    Build a swappable visual element. If the shown element is clicked on, it turns into the hidden element and when the hidden element blurs, it swaps into the shown element.

  135. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  136. def text(value: String, func: (String) ⇒ Any, attrs: ElemAttr*): Elem

    Permalink
  137. def textAjaxTest(value: String, func: (String) ⇒ Any, ajaxTest: Box[(String) ⇒ JsCmd], attrs: ElemAttr*): Elem

    Permalink
  138. def textAjaxTest(value: String, func: (String) ⇒ Any, ajaxTest: (String) ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink
  139. def textElem(settable: Settable { type ValueType = String }, attrs: ElemAttr*): Elem

    Permalink

    Generate an input element for the Settable

  140. def text_*(value: String, func: AFuncHolder, ajaxTest: Box[(String) ⇒ JsCmd], attrs: ElemAttr*): Elem

    Permalink
  141. def text_*(value: String, ignoreBlur: Boolean, func: AFuncHolder, ajaxTest: Box[(String) ⇒ JsCmd], attrs: ElemAttr*): Elem

    Permalink
  142. def text_*(value: String, func: AFuncHolder, ajaxTest: (String) ⇒ JsCmd, attrs: ElemAttr*): Elem

    Permalink
  143. def text_*(value: String, func: AFuncHolder, attrs: ElemAttr*): Elem

    Permalink
  144. def textarea(value: String, func: (String) ⇒ Any, attrs: ElemAttr*): Elem

    Permalink
  145. def textareaElem(settable: Settable { type ValueType = String }, attrs: ElemAttr*): Elem

    Permalink
  146. def textarea_*(value: String, func: AFuncHolder, attrs: ElemAttr*): Elem

    Permalink
  147. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  148. def toggleKids(head: Elem, visible: Boolean, func: () ⇒ JsCmd, kids: Elem): NodeSeq

    Permalink
  149. def untrustedMultiSelect(opts: Seq[SelectableOption[String]], deflt: Seq[String], func: (List[String]) ⇒ Any, attrs: ElemAttr*): NodeSeq

    Permalink

    Create a multiple select box based on the list with a default value and the function to be executed on form submission.

    Create a multiple select box based on the list with a default value and the function to be executed on form submission. No check is made to see if the resulting value was in the original list. For use with DHTML form updating.

    opts

    -- the options. A list of value and text pairs

    deflt

    -- the default value (or Empty if no default value)

    func

    -- the function to execute on form submission

  150. def untrustedMultiSelect_*(opts: Seq[SelectableOption[String]], deflt: Seq[String], lf: AFuncHolder, attrs: ElemAttr*): NodeSeq

    Permalink

    Create a multiple select box based on the list with a default value and the function to be executed on form submission.

    Create a multiple select box based on the list with a default value and the function to be executed on form submission. No check is made to see if the resulting value was in the original list. For use with DHTML form updating.

    opts

    -- the options. A list of value and text pairs

    deflt

    -- the default value (or Empty if no default value)

  151. def untrustedSelect(opts: Seq[SelectableOption[String]], deflt: Box[String], func: (String) ⇒ Any, attrs: ElemAttr*): Elem

    Permalink

    Create a select box based on the list with a default value and the function to be executed on form submission.

    Create a select box based on the list with a default value and the function to be executed on form submission. No check is made to see if the resulting value was in the original list. For use with DHTML form updating.

    opts

    -- the options. A list of value and text pairs

    deflt

    -- the default value (or Empty if no default value)

    func

    -- the function to execute on form submission

  152. def untrustedSelect_*(opts: Seq[SelectableOption[String]], deflt: Box[String], func: AFuncHolder, attrs: ElemAttr*): Elem

    Permalink

    Create a select box based on the list with a default value and the function to be executed on form submission.

    Create a select box based on the list with a default value and the function to be executed on form submission. No check is made to see if the resulting value was in the original list. For use with DHTML form updating.

    opts

    -- the options. A list of value and text pairs

    deflt

    -- the default value (or Empty if no default value)

    func

    -- the function to execute on form submission

  153. def url(settable: Settable { type ValueType = String }, attrs: ElemAttr*): Elem

    Permalink

    Generate a url input element for the Settable.

    Generate a url input element for the Settable. At some point there will be graceful fallback for non-HTML5 browsers. FIXME

  154. def url(value: String, func: (String) ⇒ Any, attrs: ElemAttr*): Elem

    Permalink

    Generate an input field with type url.

    Generate an input field with type url. At some point, there will be graceful fallback for non-HTML5 browsers. FIXME

  155. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  156. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  157. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Loggable

Inherited from AnyRef

Inherited from Any

Ungrouped