# General In-Place Element

Getting Started | API | Elements | Actions | Validators | Handlers | Configuration Options | About

## Table of Contents

- 1 General In-Place Element - #inplace {}

## 1 General In-Place Element - #inplace {}

The inplace element creates a view element that the user can edit in place.

The user clicks on the view element, and it is replaced with an edit element, an OK button, and a Cancel button.

If the user clicks OK, a callback is issued to the delegate module so that it can save the new value.

### Usage

    #inplace { id=textbox1, text="Some text.", view=#span{}, edit=#textbox{} }.

    #inplace { id=textbox2, text="", view=#image{}, edit=#textbox{} }.

    Dropdown = #dropdown{options=[#option{value="option1", text="Option 1"},
                                  #option{value="option2", text="Option 2"},
                                  #option{value="option3", text="Option 3"} ]},
    #inplace { id=textbox3, text="option2", view=Dropdown#dropdown{actions=#disable{}}, edit=Dropdown }.

### Attributes

view - (Erlang term)
  View element.
edit - (Erlang term)
  Edit element.
text - (string)
  Set the view element's contents.
start_mode - (Atom, 'edit' or 'view')
  Set whether the textbox should start in edit mode or view mode.
tag - (Erlang term)
  See the delegate attribute for details.
delegate - (Atom)
  Name of the module to call inplace_event(Tag, Value).

### Callbacks

#### inplace_event(Tag, Value)

Called when the user presses the OK button. Tag is specified in the 'tag' attribute, above. Value is the current value of the textbox. This callback function should process the value as necessary, and must return either the value itself, or a new value that will be sent back to the page and set as the value of the textbox.

### See Also

- base element
- inplacetextarea element
- inplacetextbox element

Date: 2012-10-18 03:25:23 CDT

Author: Milan Svoboda

Org version 7.8.02 with Emacs version 23

Validate XHTML 1.0

## Comments

Note:To specify code blocks, just use the generic code block syntax:

    <pre><code>your code here</code></pre>

comments powered by Disqus