Difference between revisions of "Working with Forms"

From HSYCO
Jump to navigation Jump to search
Line 1: Line 1:
 
[[Category:INCOMPLETE]]
 
[[Category:INCOMPLETE]]
 +
== Introduction to Forms ==
 
There are several objects that allow the creation of a form to send data to the server.
 
There are several objects that allow the creation of a form to send data to the server.
 
These objects are of three types: fields, submit buttons and containers.
 
These objects are of three types: fields, submit buttons and containers.
 
*fields:
 
*fields:
**'''[[input]]''' [[File:UI Object input.png|thumb|30px]]
+
**'''[[input]]''': for text values
**'''[[time]]''' [[File:UI Object time.png|thumb|30px]]
+
**'''[[time]]''': for time values
**'''[[date]]''' [[File:UI Object date.png|thumb|30px]]
+
**'''[[date]]''': for date values
**'''[[keypad]]''' [[File:UI Object keypad.png|thumb|30px]]
+
**'''[[keypad]]''': for numeric values
**'''[[checkbox]]''' [[File:UI Object checkbox.png|thumb|30px]]
+
**'''[[checkbox]]''': for true/false values
**'''[[radiobutton]]''' [[File:UI Object radiobutton.png|thumb|30px]]
+
**'''[[radiobutton]]''': for a value from a list
 
*fields (panel form)
 
*fields (panel form)
**'''[[timepanel]]'''
+
**'''[[timepanel]]''': similar to time
**'''[[datepanel]]'''
+
**'''[[datepanel]]''': similar to date
**'''[[keypadpanel]]'''
+
**'''[[keypadpanel]]''': similar to keypad
 
*submit buttons:
 
*submit buttons:
**'''[[submit]]'''
+
**'''[[submit]]''': default size
**'''[[submit|submitmini]]'''
+
**'''[[submit|submitmini]]''': "mini" size
**'''[[submit|submitmicro]]'''
+
**'''[[submit|submitmicro]]''': "micro" size
**'''[[submit|submitimage]]'''
+
**'''[[submit|submitimage]]''': custom image
*[[container]]
+
*[[container]]: to group multiple objects
  
Fields have all the same function, they appear as a  
+
Fields of type time, date and keypad have a specific panel used to input the value, that will be visible in a popup when the field is clicked.
 +
These panels can also be added directly to the page, using the timepanel, datepanel and keypadpanel objects.
  
 +
Container are used to group fields and submit buttons.
 +
 +
Submit buttons are used to commit changes and send all the fields' values to the server. Only the fields inside the same container and nested containers will be considered.
 +
 +
Fields can also have an autosubmit mode, that sends the value when there's a change, instead of waiting for the user to click on a Submit button.
 +
This mode is automatically activated if there's no Submit button on the page (if the field is on page), or in one of the parent containers, up to the page. This autosubmit mode can also be toggled using a specific UISet (for example see the [[UI Object input#UI Attributes|autosubmit UI Attribute on the input object]]).
 
== Keypad ==
 
== Keypad ==
 
Pressing the OK button or pressing the Enter key on the physical keyboard is equivalent to pressing the [[submit]] button of a form; HSYCO will call the method:
 
Pressing the OK button or pressing the Enter key on the physical keyboard is equivalent to pressing the [[submit]] button of a form; HSYCO will call the method:

Revision as of 19:40, 25 February 2014

Introduction to Forms

There are several objects that allow the creation of a form to send data to the server. These objects are of three types: fields, submit buttons and containers.

Fields of type time, date and keypad have a specific panel used to input the value, that will be visible in a popup when the field is clicked. These panels can also be added directly to the page, using the timepanel, datepanel and keypadpanel objects.

Container are used to group fields and submit buttons.

Submit buttons are used to commit changes and send all the fields' values to the server. Only the fields inside the same container and nested containers will be considered.

Fields can also have an autosubmit mode, that sends the value when there's a change, instead of waiting for the user to click on a Submit button. This mode is automatically activated if there's no Submit button on the page (if the field is on page), or in one of the parent containers, up to the page. This autosubmit mode can also be toggled using a specific UISet (for example see the autosubmit UI Attribute on the input object).

Keypad

Pressing the OK button or pressing the Enter key on the physical keyboard is equivalent to pressing the submit button of a form; HSYCO will call the method: userCommand(String name, String param) in the user.class class, passing: name - the id of the (keypad) object param - the numeric value entered via the keypad. The USER <id> event will be generated as well. If the (keypad!id) object's id starts with $, then the server will also automatically set a variable named $<id> to the appropriate value. The (keypad) object can also be used in forms, just like an (input) object. The (keypad) object has the identified version only.