Fixed select slider and key/value pair support for list type form elements in Thingy
This commit is contained in:
parent
77d62f837f
commit
20e561788b
3 changed files with 30 additions and 9 deletions
|
|
@ -8,6 +8,8 @@
|
||||||
- fixed: DataForm doesn't keep posted values properly when data fails validation
|
- fixed: DataForm doesn't keep posted values properly when data fails validation
|
||||||
- fixed: Documentation for DataForm and Thingy updated for Possible Values field
|
- fixed: Documentation for DataForm and Thingy updated for Possible Values field
|
||||||
- added a new permission denied page for version tag approval
|
- added a new permission denied page for version tag approval
|
||||||
|
- fixed: Thingy list type form elements do not support key/value pairs
|
||||||
|
- fixed: Select Slider borked in Thingy
|
||||||
- fixed: Shortcuts includes HTML head data twice
|
- fixed: Shortcuts includes HTML head data twice
|
||||||
- fixed: DataForm entry table isn't properly indexed
|
- fixed: DataForm entry table isn't properly indexed
|
||||||
- fixed: DataForm can't export fields containing newlines
|
- fixed: DataForm can't export fields containing newlines
|
||||||
|
|
|
||||||
|
|
@ -830,7 +830,7 @@ sub getFormElement {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WebGUI::Utility::isIn($data->{fieldType},qw(SelectList CheckList SelectBox Attachments SelectSlider))) {
|
if (WebGUI::Utility::isIn($data->{fieldType},qw(SelectList CheckList SelectBox Attachments))) {
|
||||||
my @defaultValues;
|
my @defaultValues;
|
||||||
if ($self->session->form->param($name)) {
|
if ($self->session->form->param($name)) {
|
||||||
@defaultValues = $self->session->form->selectList($name);
|
@defaultValues = $self->session->form->selectList($name);
|
||||||
|
|
@ -844,15 +844,22 @@ sub getFormElement {
|
||||||
$param{value} = \@defaultValues;
|
$param{value} = \@defaultValues;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WebGUI::Utility::isIn($data->{fieldType},qw(SelectList SelectBox CheckList RadioList))) {
|
if (WebGUI::Utility::isIn($data->{fieldType},qw(SelectList SelectBox CheckList RadioList SelectSlider))) {
|
||||||
delete $param{size};
|
delete $param{size};
|
||||||
my %options;
|
|
||||||
tie %options, 'Tie::IxHash';
|
my $values = WebGUI::Operation::Shared::secureEval($self->session,$data->{possibleValues});
|
||||||
foreach (split(/\n/x, $data->{possibleValues})) {
|
if (ref $values eq 'HASH') {
|
||||||
s/\s+$//x; # remove trailing spaces
|
$param{options} = $values;
|
||||||
$options{$_} = $_;
|
}
|
||||||
|
else{
|
||||||
|
my %options;
|
||||||
|
tie %options, 'Tie::IxHash';
|
||||||
|
foreach (split(/\n/x, $data->{possibleValues})) {
|
||||||
|
s/\s+$//x; # remove trailing spaces
|
||||||
|
$options{$_} = $_;
|
||||||
|
}
|
||||||
|
$param{options} = \%options;
|
||||||
}
|
}
|
||||||
$param{options} = \%options;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($data->{fieldType} eq "YesNo") {
|
if ($data->{fieldType} eq "YesNo") {
|
||||||
|
|
|
||||||
|
|
@ -529,7 +529,19 @@ vertically.|,
|
||||||
},
|
},
|
||||||
|
|
||||||
'possible values description' => {
|
'possible values description' => {
|
||||||
message => q{This field is used for the list types (like Checkbox List and Select List). Enter the values you wish to appear, one per line. If you want a different label for a value, seperate them with a | (pipe) character: value|label },
|
message => q{This field is used for the list types (like Checkbox List and Select List). Enter the values
|
||||||
|
you wish to appear, one per line. <br />
|
||||||
|
<br />If you want a different label for a value, the possible values list has to be
|
||||||
|
formatted as follows:
|
||||||
|
<pre>
|
||||||
|
{
|
||||||
|
"key1"=>"value1",
|
||||||
|
"key2"=>"value2",
|
||||||
|
"key3"=>"value3"
|
||||||
|
...
|
||||||
|
}
|
||||||
|
</pre>
|
||||||
|
Braces, quotes and all. You simply replace "key1"/"value1" with your own name/value pairs},
|
||||||
lastUpdated => 1104630516,
|
lastUpdated => 1104630516,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue