Project

General

Profile

Bug #64532 ยป form_wizard_select_option_value.diff

Stephan Ude, 2015-01-27 12:19

View differences:

typo3/sysext/form/Classes/Domain/Model/Json/SelectJsonElement.php
$childElementArguments['attributes']['selected'] = $childElementArguments['selected'];
unset($childElementArguments['selected']);
}
if (isset($childElementArguments['value'])) {
$childElementArguments['attributes']['value'] = $childElementArguments['value'];
unset($childElementArguments['value']);
}
$this->configuration['options'][] = $childElementArguments;
}
}
typo3/sysext/form/Resources/Private/Language/locallang_wizard.xlf
<trans-unit id="fieldoptions_data" xml:space="preserve">
<source>Data</source>
</trans-unit>
<trans-unit id="fieldoptions_value" xml:space="preserve">
<source>Value</source>
</trans-unit>
<trans-unit id="fieldoptions_selected" xml:space="preserve">
<source>Selected</source>
</trans-unit>
typo3/sysext/form/Resources/Public/JavaScript/Wizard/Viewport/Left/Options/Forms/Options.js
name: 'selected',
convert: this.convertSelected,
type: 'bool'
}, {
name: 'value',
convert: this.convertValue,
type: 'string'
}
]);
......
}
})
},
{
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
]
......
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);
......
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);
});
......
}
}
return false;
},
convertValue: function(v, record) {
if (record.attributes && record.attributes.value) {
return record.attributes.value;
}
return '';
}
});
    (1-1/1)