Storing strings and integers in one GWT array
It seems like it should be relatively simple, but apparently not much. I can't figure out how to store strings and integers in an array in GWT. What type of data are you using? If I use JsArrayString it outputs IllegalArgumentException
when retrieving the index containing the number. I obviously cannot use JsArrayInteger (I have strings). JsArray requires a type that I have no idea what to use (if it can be used), I tried String
it but get the same results.
The data retrieved from the script page has no way to distinguish between strings and ints (ColdFusion).
a source to share
It's a little awkward, but you can always make some rough definitions of whether a given value is an int or a string:
<cfset val1="one">
<cfset val2="1">
<cfif int(val(val1)) eq val1>int<cfelse>string</cfif>
<br />
<cfif int(val(val2)) eq val2>int<cfelse>string</cfif>
This should give you
string
int
a source to share