Name

form — web form with standard layout

Synopsis

LZX: form
JavaScript: lz.form
Type: Class
Access: public
Topic: Components.Laszlo Components
Declared in: lps/components/lz/form.lzx

Description

The form tag allows you to create a web form and provides automatic layout. Most components are laid out vertically with buttons at the lower right. The data represented by components that are enclosed in the form tag can be sent to the server using the submit tag. Each form component, such as checkbox, combobox or radiogroup must have a name. The data is submitted as name-value pairs, using the name and value of the component.

<canvas height="200">
              <dataset name="echoer" src="http:../../examples/components/echo.jsp"/>
              <window id="win">
              <form>
              <submit name="survey" data="${echoer}"/>
              <statictext>What is your favorite vacation spot?</statictext>
              <radiogroup name="place">
              <radiobutton>Hawaii</radiobutton>
              <radiobutton>Paris</radiobutton>
              <radiobutton>Jamaica</radiobutton>
              </radiogroup>
              <button isdefault="true" onclick="parent.survey.submit()">submit</button>
              </form>
              </window>
              
              <view x="260" y="20" layout="class: simplelayout" datapath="echoer:/response">
              <text text="Data received"/>
              <view layout="axis: y">
              <view datapath="formcomponent" layout="axis:x">
              <text resize="true" datapath="@name"/>
              <text text=":"/>
              <text resize="true" datapath="text()"/>
              </view>
              </view>
              </view>
              </canvas>

If you want to include buttons in the form that are not placed in the lower-right, you can specify placement="content" in the button tag. To use a custom layout with a form, use the baseform tag.

Extends the component grouping features of baseform to also provide standard layout for from controls. Buttons will be placed in a view at the bottom right of the form (placement 'buttonplace'). A form is typicaly a collection of UI elements where each represents data from the user that will be submitted to the server as a request.

Superclass Chain

node (LzNode) » view (LzView) » baseform » form

Known Subclasses

Details

Properties (8)

defaultplacement
<attribute name="defaultplacement" type="string" value="content" />
private final var defaultplacement : String;
The default placement view for subviews that go in this form.
inset_bottom
<attribute name="inset_bottom" value="10" />
public var inset_bottom;
The bottom inset for content appearing within form.
inset_left
<attribute name="inset_left" value="10" />
public var inset_left;
The left inset for content appearing within form.
inset_right
<attribute name="inset_right" value="10" />
public var inset_right;
The right inset for content appearing within form.
inset_top
<attribute name="inset_top" value="10" />
public var inset_top;
The top inset for content appearing within form.
spacing
<attribute name="spacing" value="10" />
public var spacing;
Vertical space between content and button area. If forms height is specified, the button area will be flush against the form's bottom right corner (adjusted by any layout that the form has).
_useformheight
<attribute name="_useformheight" value="true" />
private var _useformheight;
If true, use content's height to determine size of form. If false, use form's width to determine width of content area.
_useformwidth
<attribute name="_useformwidth" value="true" />
private var _useformwidth;
If true, use content's width to determine size of form. If false, use form's width to determine width of content area.

Methods (2)

construct()
<method name="construct" args="p, args" />
private function construct(p, args);
determinePlacement()
<method name="determinePlacement" args="newsubview, placement, args" />
private function determinePlacement(newsubview, placement, args);

LZX Synopsis

<class name="lz.form" extends=" lz.baseform ">
  <attribute name=" defaultplacement " type="string" value="content" />
  <attribute name=" inset_bottom " value="10" />
  <attribute name=" inset_left " value="10" />
  <attribute name=" inset_right " value="10" />
  <attribute name=" inset_top " value="10" />
  <attribute name=" spacing " value="10" />
  <attribute name=" _useformheight " value="true" />
  <attribute name=" _useformwidth " value="true" />
  <method name=" construct " args="p, args" />
  <method name=" determinePlacement " args="newsubview, placement, args" />
</class>

JavaScript Synopsis

public lz.form extends  lz.baseform  {
  private final var defaultplacement  : String;
  public var inset_bottom ;
  public var inset_left ;
  public var inset_right ;
  public var inset_top ;
  public var spacing ;
  private var _useformheight ;
  private var _useformwidth ;
  prototype private function construct (p, args);
  prototype private function determinePlacement (newsubview, placement, args);
}