mardi 20 septembre 2016

Flex converting numeric string to exponential form

This is a weird issue I came across or a Flex 3 shortcoming. I am using SOAP messaging protocol and the response from the server for filling the 'Notes' field which I have on a pop-up looks like this:

Fiddler response - GLNotes

Since this is SOAP I am getting the response as a XML string. The GLNotes field value is 4582e12.

Some Flex code on how I handle this response:

<mx:DataGrid dataProvider="{AccruedIncomeWS.GetAccruedIncomeList.lastResult.root.AccruedIncomeList.Item}" 
itemClick="AccrualClick(event);" id="AccrualList>

Now I created a watch expression for AccrualList.selectedItem and I see:

SelectedItem numeric data

Why is the GLNotes getting converted to a Number here? To test out this implicit conversion I put some characters in the notes field and got this in the watch expression:

SelectedItem string data

With the presence of some alphabets the GLNotes field is treated as a string. Is there anyway I can make this value strongly typed and not have any implicit conversions applied? Let me know if additional info is required. Thanks!

Aucun commentaire:

Enregistrer un commentaire