diff --git a/typo3/sysext/form/Classes/Domain/Model/Json/SelectJsonElement.php b/typo3/sysext/form/Classes/Domain/Model/Json/SelectJsonElement.php index 3fd97c7..82bacf1 100644 --- a/typo3/sysext/form/Classes/Domain/Model/Json/SelectJsonElement.php +++ b/typo3/sysext/form/Classes/Domain/Model/Json/SelectJsonElement.php @@ -94,6 +94,10 @@ class SelectJsonElement extends \TYPO3\CMS\Form\Domain\Model\Json\AbstractJsonEl $childElementArguments['attributes']['selected'] = $childElementArguments['selected']; unset($childElementArguments['selected']); } + if (isset($childElementArguments['value'])) { + $childElementArguments['attributes']['value'] = $childElementArguments['value']; + unset($childElementArguments['value']); + } $this->configuration['options'][] = $childElementArguments; } } diff --git a/typo3/sysext/form/Resources/Private/Language/locallang_wizard.xlf b/typo3/sysext/form/Resources/Private/Language/locallang_wizard.xlf index 959ce4d..8732619 100644 --- a/typo3/sysext/form/Resources/Private/Language/locallang_wizard.xlf +++ b/typo3/sysext/form/Resources/Private/Language/locallang_wizard.xlf @@ -486,6 +486,9 @@ Data + + Value + Selected diff --git a/typo3/sysext/form/Resources/Public/JavaScript/Wizard/Viewport/Left/Options/Forms/Options.js b/typo3/sysext/form/Resources/Public/JavaScript/Wizard/Viewport/Left/Options/Forms/Options.js index cd6bd6b..db3d9b3 100644 --- a/typo3/sysext/form/Resources/Public/JavaScript/Wizard/Viewport/Left/Options/Forms/Options.js +++ b/typo3/sysext/form/Resources/Public/JavaScript/Wizard/Viewport/Left/Options/Forms/Options.js @@ -63,6 +63,10 @@ TYPO3.Form.Wizard.Viewport.Left.Options.Forms.Options = Ext.extend(Ext.grid.Edit name: 'selected', convert: this.convertSelected, type: 'bool' + }, { + name: 'value', + convert: this.convertValue, + type: 'string' } ]); @@ -117,6 +121,19 @@ TYPO3.Form.Wizard.Viewport.Left.Options.Forms.Options = Ext.extend(Ext.grid.Edit } }) }, + { + id: 'value', + header: TYPO3.l10n.localize('fieldoptions_value'), + dataIndex: 'value', + editor: new Ext.ux.form.TextFieldSubmit({ + allowBlank: true, + listeners: { + 'triggerclick': function(field) { + field.gridEditor.record.set('value', field.getValue()); + } + } + }) + }, checkColumn, itemDeleter ] @@ -146,7 +163,8 @@ TYPO3.Form.Wizard.Viewport.Left.Options.Forms.Options = Ext.extend(Ext.grid.Edit var option = this.store.recordType; var newOption = new option({ data: TYPO3.l10n.localize('fieldoptions_new'), - selected: false + selected: false, + value: '' }); this.stopEditing(); this.store.add(newOption); @@ -171,9 +189,12 @@ TYPO3.Form.Wizard.Viewport.Left.Options.Forms.Options = Ext.extend(Ext.grid.Edit data: record.get('data') }; if (record.get('selected')) { - option.attributes = { - selected: 'selected' - }; + if (!option.attributes) { option.attributes = {}; } + option.attributes['selected'] = 'selected'; + } + if (record.get('value')) { + if (!option.attributes) { option.attributes = {}; } + option.attributes['value'] = record.get('value'); } options.push(option); }); @@ -200,6 +221,13 @@ TYPO3.Form.Wizard.Viewport.Left.Options.Forms.Options = Ext.extend(Ext.grid.Edit } } return false; + }, + + convertValue: function(v, record) { + if (record.attributes && record.attributes.value) { + return record.attributes.value; + } + return ''; } });