nitrogen/nitrogen_core — pull request #16 by tex (2012-02-11 20:42:35+00:00)
Title: get_value and its use

This is inplace element, general version of inplace_textbox and inplace_textarea.

It can replace both of them by simply:

#inplace{edit=#textbox{}, view=#span{}},
#inplace{edit=#textarea{}, view=#span{}}.

It also supports #image and #dropdown. Any other element can be used as well.
It supports actions connected to edit element.

Example:

body() ->
Span = #span{},
TextBox = #textbox{ id=testBox, actions=[ #validate { validators=[ #is_required { text="Required." } ] } ] },
ListBox = #dropdown{ options = [
#option { text = "Pokus1" },
#option { text = "Pokus2" },
#option { text = "Pokus3" } ]},
Image = #image{ alt="obrazek" },
TextBoxImage = #textbox{ text = Image#image.image },
[
#panel { body=[
#inplace { tag=a, text="Pokus1", view=Span, edit=TextBox },
#inplace { tag=b, text="Pokus2", view=Span, edit=ListBox },
#inplace { tag=c, text="/images/test.jpg", view=Image, edit=TextBoxImage }
]}
].