[flexcoders] Re: major filtering of arrayCollection problem - help please
Imagine 1,2,10,23. If you try and match 3, you will find it even though it's just the 3 in 23. It might be better to do a more advanced regular expressions test. --- In flexcoders@yahoogroups.com, Mark [EMAIL PROTECTED] wrote: I got it - if (item.serviceLine.indexOf(checkBox.data) != -1){ isMatch = true; }... --- In flexcoders@yahoogroups.com, Mark pusateri02@ wrote: I'm using a filterFuction filtering a few different fields. So far so good, but I've been filtering on exact matches. How can I expand that to search for LIKE or INCLUDES matchs, or something like that. Here's what I have - 5 check boxes for the filter of one of the fields - lets say ( 1, 2, 3, 4, 5) My XML (arrayCollection) field had at one time, only 1 or 2 or 3, etc. Now they want it to include more than just one, so that field can look like more like - 1 1,2 2,4 2,3,4 1,2,3,4,5 ... So right now my filter is - if (item.serviceLine == checkBox.data){ isMatch = true; }... This would never return anything other than the check box marked with the exact single value. How can I expand on this? I't still early in the game so I can adjust the XML as needed if that works best. Help, Mark
[flexcoders] Re: CData inside XML object
Ignoring whitespace isn't a good option, because my server-side program doesn't ignore whitespace. The script you wrote causes a parse error, because the script itself is in a CDATA section. --- In flexcoders@yahoogroups.com, Daniel Freiman [EMAIL PROTECTED] wrote: Look at XML.ignoreWhitespace ( http://livedocs.adobe.com/flex/201/langref/XML.html). Also, would think you would be able to create a cdata node by doing something like this: var cdata:XML = new XML(![CDATA[ + s + ]]); - Dan Freiman On 9/7/07, discoguy77 [EMAIL PROTECTED] wrote: Hello, I am saving some text from a string into a XML element. For example: var s:String = Hello ; var xml:XML = root{s}/root; I would like the following to happen: trace(xml); // prints Hello (without quotes) Unfortunately, E4X trims the whitespace. I would like my XML object to be root![CDATA[{s}]]/root so that the space (maybe?) wouldn't be trimmed, but I cannot use a CDATA block since it occurs inside a mx:Script![CDATA[ ... ]]/mx:Script already. Is there a way to add a CDATA block to an E4X XML object? P.S. As a workaround, I can escape() the string before adding it, and unescape() afterwards, but this seems ugly and loses the human- readability.
[flexcoders] Re: CData inside XML object
Wow, don't I feel like an idiot for missing that one. I'll give it a try. Thanks! --- In flexcoders@yahoogroups.com, Daniel Freiman [EMAIL PROTECTED] wrote: var cdata:XML = new XML(![CDATA[ + s + ]+]); On 9/12/07, discoguy77 [EMAIL PROTECTED] wrote: Ignoring whitespace isn't a good option, because my server-side program doesn't ignore whitespace. The script you wrote causes a parse error, because the script itself is in a CDATA section. --- In flexcoders@yahoogroups.com flexcoders% 40yahoogroups.com, Daniel Freiman FreimanCQ@ wrote: Look at XML.ignoreWhitespace ( http://livedocs.adobe.com/flex/201/langref/XML.html). Also, would think you would be able to create a cdata node by doing something like this: var cdata:XML = new XML(![CDATA[ + s + ]]); - Dan Freiman On 9/7/07, discoguy77 discoguy77@ wrote: Hello, I am saving some text from a string into a XML element. For example: var s:String = Hello ; var xml:XML = root{s}/root; I would like the following to happen: trace(xml); // prints Hello (without quotes) Unfortunately, E4X trims the whitespace. I would like my XML object to be root![CDATA[{s}]]/root so that the space (maybe?) wouldn't be trimmed, but I cannot use a CDATA block since it occurs inside a mx:Script![CDATA[ ... ]]/mx:Script already. Is there a way to add a CDATA block to an E4X XML object? P.S. As a workaround, I can escape() the string before adding it, and unescape() afterwards, but this seems ugly and loses the human- readability.
[flexcoders] CData inside XML object
Hello, I am saving some text from a string into a XML element. For example: var s:String = Hello ; var xml:XML = root{s}/root; I would like the following to happen: trace(xml); // prints Hello(without quotes) Unfortunately, E4X trims the whitespace. I would like my XML object to be root![CDATA[{s}]]/root so that the space (maybe?) wouldn't be trimmed, but I cannot use a CDATA block since it occurs inside a mx:Script![CDATA[ ... ]]/mx:Script already. Is there a way to add a CDATA block to an E4X XML object? P.S. As a workaround, I can escape() the string before adding it, and unescape() afterwards, but this seems ugly and loses the human- readability.