Size: 4927
Comment:
|
← Revision 13 as of 2013-12-24 13:02:44 ⇥
Size: 294
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 2: | Line 2: |
= MildServer: The HTMLInput Namespace = | = MiServer: The HTMLInput Namespace = |
Line 4: | Line 4: |
<<Navigation(siblings,1)>> <<BR>> |
|
Line 7: | Line 5: |
<<TableOfContents>> | '''Note:''' !MiServer (originally named !MildServer) is not available from the APL Wiki anymore. |
Line 9: | Line 7: |
== HTMLInput Utilities == The file ''Utils\HTMLInput.dyalog'' contains the HTMLInput namespace, which contains utility functions which are used by all the examples. All the classes defined in the Utils folder are defined in the server workspace before the application starts. The easiest way to use these functions in your pages is to make sure your class source contains the following line: {{{ :Include #.HTMLInput }}} The functions in the HTMLInput namespace are described in the following. In each case, the function name is '''bold''', optional parameters are ''italic''. Most functions take a name on the left and define both the id and name attributes to have this value. Where present, the parameter called ''attributes'' allows you to insert any additional attributes that you wish. == Function Reference == === Button === Syntax: name '''Button''' value ''attributes'' A button. Unless you are using !JavaScript events to react to pressing the button, you should probably use the Submit function instead of Button. ''value'' is the text to be displayed. When values are posted, a parameter with the name of the button will be reported as having this value. A common technique is to give all your buttons the same name and use the reported value to determine which button was pressed. === Checkbox === Syntax: name '''!CheckBox''' checked ''attributes'' Defines an HTML input with type=checkbox, which is either checked or unchecked. For example:<<BR>> {{{ 'Check1' CheckBox 1 'style="color: blue;"' <input style="color: blue;" type=checkbox name=Check1 checked=1> }}} === DropDown === Syntax: name '''!DropDown''' items ''value attributes sort'' Defines a dropdown or combo box. ''items'' is the list of values to go in the list. ''value'' is the currently selected value. ''sort'' causes items to be sorted before they are inserted into the list. === Edit === Syntax: name '''Edit''' value ''size attributes'' Generates a "normal" Edit or Input field. ''value'' is the data to insert into the field. ''size'' is the size. === Enclose === Syntax: tag '''Enclose''' html Encloses arbitrary HTML in a tag. For example: {{{ 'a href="http://www.dyalog.com"' Enclose 'Dyalog' <a href="http://www.dyalog.com">Dyalog</a> }}} === File === Syntax: name '''File''' size ''value attributes'' Generates an Input field which can be used to upload a file. ''size'' is the size of the field, ''value'' is the data to initialize the field with. Note that the value that is reported for this kind of field is a two-element vector: The file name and the data content of the file. === "Form" === Syntax: ''attributes'' (method '''Form''') innerhtml ''Form'' is actually a user-defined operator: ''method'' can be either ''post'' or ''submit''. The right argument is simply some HTML which is to be embedded in the input form. === Hidden === Syntax: name '''Hidden''' value ''attributes'' Generates an invisible Input field with the defined value. The user cannot see or change the content of this field, but it will be posted back to the server, so it is a way to store data between requests. The contents can also be seen by client-side code (!JavaScript). === JS === Syntax: '''JS''' script Embeds javascript. === MultiEdit === Syntax: name '''!MultiEdit''' rowscols ''values attributes'' Generates a multi-row Edit or Input field. ''rowscols'' gives the size. ''values'' is the data to insert into the field. === Password === Syntax: name '''Password''' size ''value attributes'' An input field for entering input which should not be displayed as it is typed. ''value'' is the data to insert into the field. ''size'' is the size. === RadioButton === Syntax: name '''!RadioButton''' checked ''value attributes'' Defines an HTML input with type=radio, which is either checked or unchecked. The label is given by ''value''.<<BR>> === Submit === Syntax: name '''Submit''' value ''attributes'' A button which will submit the form that it is inside. ''value'' is the text to be displayed. When values are posted, a parameter with the name of the button will be reported as having this value. A common technique is to give all your buttons the same name and use the reported value to determine which button was pressed. === Table === Syntax: name '''Table''' data ''table_atts cell_atts header_atts header_rows'' Wraps a matrix as an HTML table. The optional arguments are: ||table_atts||Attributes for the table element|| ||cell_atts||Attributes for td elements|| ||header_atts||Attributes for header rows|| ||header_rows||Indices of header rows|| <<Navigation(siblings,1)>> Return to the main MildServer page. <<BR>><<BR>> |
Please visit the [[http://tools.dyalog.com/library/ | MiServer download page]] at Dyalog's web site. |
MiServer: The HTMLInput Namespace
Note: MiServer (originally named MildServer) is not available from the APL Wiki anymore.
Please visit the MiServer download page at Dyalog's web site.