A couple more fields to the mix
This commit is contained in:
parent
c15cfa954f
commit
848a106e1a
6 changed files with 268 additions and 322 deletions
|
|
@ -556,168 +556,6 @@ sub group {
|
|||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 HTMLArea ( name [, label, value, subtext, extras, wrap, rows, columns, uiLevel, defaultValue ] )
|
||||
|
||||
Adds an HTML area row to this form. An HTML area is different than a standard text area in that it provides rich edit functionality and some special error trapping for HTML and other special characters.
|
||||
|
||||
=head3 name
|
||||
|
||||
The name field for this form element.
|
||||
|
||||
=head3 label
|
||||
|
||||
The left column label for this form row.
|
||||
|
||||
=head3 value
|
||||
|
||||
The default value for this form element.
|
||||
|
||||
=head3 subtext
|
||||
|
||||
Extra text to describe this form element or to provide special instructions.
|
||||
|
||||
=head3 extras
|
||||
|
||||
If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
|
||||
|
||||
'onChange="this.form.submit()"'
|
||||
|
||||
=head3 wrap
|
||||
|
||||
The method for wrapping text in the text area. Defaults to "virtual". There should be almost no reason to specify this.
|
||||
|
||||
=head3 rows
|
||||
|
||||
The number of characters tall this form element should be. There should be no reason for anyone to specify this.
|
||||
|
||||
=head3 columns
|
||||
|
||||
The number of characters wide this form element should be. There should be no reason for anyone to specify this.
|
||||
|
||||
=head3 uiLevel
|
||||
|
||||
The UI level for this field. See the WebGUI developer's site for details. Defaults to "0".
|
||||
|
||||
=head3 defaultValue
|
||||
|
||||
If no value is specified, this will be used.
|
||||
|
||||
=head3 richEditId
|
||||
|
||||
An asset Id of a rich editor config. Defaults to the default rich editor in the settings.
|
||||
|
||||
=head3 hoverHelp
|
||||
|
||||
A string of text or HTML to be displayed when a user's mouse hover's over a field label. It is meant to describe to the user what to use the field for.
|
||||
|
||||
=cut
|
||||
|
||||
sub HTMLArea {
|
||||
my ($output);
|
||||
my ($self, @p) = @_;
|
||||
my ($name, $label, $value, $subtext, $extras, $wrap, $rows, $columns, $uiLevel, $defaultValue, $richEditId, $hoverHelp) =
|
||||
rearrange([qw(name label value subtext extras wrap rows columns uiLevel defaultValue richEditId hoverHelp)], @p);
|
||||
if (_uiLevelChecksOut($uiLevel)) {
|
||||
$output = WebGUI::Form::HTMLArea({
|
||||
"name"=>$name,
|
||||
"value"=>$value,
|
||||
"wrap"=>$wrap,
|
||||
"columns"=>$columns,
|
||||
"rows"=>$rows,
|
||||
"extras"=>$extras,
|
||||
defaultValue=>$defaultValue,
|
||||
richEditId=>$richEditId
|
||||
});
|
||||
$output .= _subtext($subtext);
|
||||
$output = $self->_tableFormRow($label,$output,$hoverHelp);
|
||||
} else {
|
||||
$output = WebGUI::Form::hidden({
|
||||
"name"=>$name,
|
||||
"value"=>$value,
|
||||
defaultValue=>$defaultValue
|
||||
});
|
||||
}
|
||||
$self->{_data} .= $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 integer ( name [, label, value, maxlength, extras, subtext, size, uiLevel, defaultValue ] )
|
||||
|
||||
Adds an integer row to this form.
|
||||
|
||||
=head3 name
|
||||
|
||||
The name field for this form element.
|
||||
|
||||
=head3 label
|
||||
|
||||
The left column label for this form row.
|
||||
|
||||
=head3 value
|
||||
|
||||
The default value for this form element.
|
||||
|
||||
=head3 maxlength
|
||||
|
||||
The maximum number of characters to allow in this form element. Defaults to 11.
|
||||
|
||||
=head3 extras
|
||||
|
||||
If you want to add anything special to this form element like javascript actions, or stylesheet information, you'd add it in here as follows:
|
||||
|
||||
'onChange="this.form.submit()"'
|
||||
|
||||
=head3 subtext
|
||||
|
||||
Extra text to describe this form element or to provide special instructions.
|
||||
|
||||
=head3 size
|
||||
|
||||
The number of characters wide this form element should be. There should be no reason for anyone to specify this.
|
||||
|
||||
=head3 uiLevel
|
||||
|
||||
The UI level for this field. See the WebGUI developer's site for details. Defaults to "0".
|
||||
|
||||
=head3 defaultValue
|
||||
|
||||
If no value is specified, this will be used.
|
||||
|
||||
=head3 hoverHelp
|
||||
|
||||
A string of text or HTML to be displayed when a user's mouse hover's over a field label. It is meant to describe to the user what to use the field for.
|
||||
|
||||
=cut
|
||||
|
||||
sub integer {
|
||||
my ($output);
|
||||
my ($self, @p) = @_;
|
||||
my ($name, $label, $value, $maxlength, $extras, $subtext, $size, $uiLevel, $defaultValue, $hoverHelp) =
|
||||
rearrange([qw(name label value maxlength extras subtext size uiLevel defaultValue hoverHelp)], @p);
|
||||
if (_uiLevelChecksOut($uiLevel)) {
|
||||
$output = WebGUI::Form::integer({
|
||||
"name"=>$name,
|
||||
"value"=>$value,
|
||||
"maxlength"=>$maxlength,
|
||||
"size"=>$size,
|
||||
"extras"=>$extras,
|
||||
defaultValue=>$defaultValue
|
||||
});
|
||||
$output .= _subtext($subtext);
|
||||
$output = $self->_tableFormRow($label,$output,$hoverHelp);
|
||||
} else {
|
||||
$output = WebGUI::Form::hidden({
|
||||
"name"=>$name,
|
||||
"value"=>$value,
|
||||
"defaultValue"=>$defaultValue
|
||||
});
|
||||
}
|
||||
$self->{_data} .= $output;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 interval ( name [, label, value, extras, subtext, uiLevel, defaultValue ] )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue