I’m passing parameters to a server from a Flash Builder application. I want to search both for “teachers” and for “rooms”. I can do this via an HTML page, as follows:
<input type="checkbox" name="searchFor" value="teachers" />teachers
<input type="checkbox" name="searchFor" value="rooms" />rooms
So there are two inputs, both named searchFor. When submitted, the request looks like this:
searchFor: teachers
searchFor: rooms
In other words, two parameters are passed.
I’m trying to do the same thing in Flash Builder using an object called param:
param.query = pQuery;
param.searchFor = "teachers";
param.searchFor = "rooms";
searchUsersService(param);
Flex overwrites the one with the other, as I suspected it would, so all that is submitted is “rooms”. Is it possible to pass two parameters with the same name? (or do I need to ask the server guys to rename their search parameters?)
Thanks.
You can’t. It will only override the previous value:
What you can do is:
Or
And then in the server side you can get all the values from your array.