У меня есть TextInput и список в моем приложении. Я хочу отправить информацию, написанную в TextInput, и имена выбранных опций из списка в файл php.
После HTTPService отправляет текст TextInput и индексы выбранных элементов из списка в файл php, но selectedItems не работает, как я ожидал. Не отправляются имена выбранных предметов
<mx:HTTPService id="configureService" url="configure.php" resultFormat="text" method="POST">
<mx:request xmlns="">
<textInput>
{textInput.text}
</textInput>
<selectedFoodNames>
{foodList.selectedItems.join(",")} <!-- Problem in this LOC -->
</selectedFoodNames>
<selectedFoodIndices>
{foodList.selectedIndices.join(",")}
</selectedFoodIndices>
</mx:request>
</mx:HTTPService>
Теперь результаты моего php-файла:
echo $_POST['textInput']; //Output the right answer
echo $_POST['selectedFoodNames']; //Outputs: "[object Object],[object Object],[object Object]" if three items are selected from the list
echo $_POST['selectedFoodIndices']; //Outputs the indices of selected items separated by comma
Список выглядит так:
<mx:List id="foodList" x="26.95" y="54" width="231.55" height="236.9" allowMultipleSelection="true">
<mx:dataProvider>
<mx:Array>
<mx:Object id="Sugar" label="Sugar" data="#FF0000"/>
<mx:Object id="Salt" label="Salt" data="#00FF00"/>
<mx:Object id="Pepper" label="Pepper" data="#0000FF"/>
</mx:Array>
</mx:dataProvider>
Есть ли способ, которым я могу отправить метки элементов в списке?