Re: [flexcoders] FilterFunction creating duplicate items in the list

2009-06-01 Thread Rohit Sharma
  Hi Srinivas,

   I tried using creating a different data provider from the roomlist and
applying filter functions on that.
   And then assigning the filtered dataprovider to the roomlist. But still I
am seeing the issue.
   Can you provide some code snippets for what you mean?

  Thanks,
  Rohit

On Mon, Jun 1, 2009 at 8:12 AM, Srinivas Sandur Madhu Murthy 
s.m.srini...@gmail.com wrote:



 Longtime back I did face similar issue. I probably believe, you have binded
 the array collection with data grid or list directly  applying filter on
 this binded array collection. If it is true, then trying not binding them
 using {}, use flags and commitProperties() method and apply filter
 function if not applied already on collection  then assign dataProvider for
 grid/list. Probably this might remove or resolve duplication problem.

 Srinivas

 On May 31, 2009, at 12:16 PM, Rohit Sharma wrote:

  Hi All,

 I am stuck up with this problem. Please provide some insight into
 it.

  I have a list component which shows all the game rooms currently
 existing. As soon as some property of the room changes,
 I update the corresponding item in the dataprovider using setItemAt. (I
 typecast dataprovider as Arraycollection).
   Recently I added some filters to the room list using
 filterfunction. As soon as I start applying filters, I see few items getting
 duplicated in the list. Some items exist with old values as well as new
 values.
 I also tried making the filtering and updating actions mutually
 exclusive using flags hoping that two different actions taking
 place on the same data might cause duplication of items. But the
 duplication is still taking place.
  In fact I tried using itemUpdate() also in place of setItemAt but the
 problem still persists.
 I have also tried modifying only the source array during updates because
 the filtering takes place only on the ArrayCollection and
 not on the source array but this also failed.

   Any inputs will be appreciated.

 Thanks,
 Rohit


  



[flexcoders] FilterFunction creating duplicate items in the list

2009-05-31 Thread Rohit Sharma
Hi All,

I am stuck up with this problem. Please provide some insight into
it.

 I have a list component which shows all the game rooms currently existing.
As soon as some property of the room changes,
I update the corresponding item in the dataprovider using setItemAt. (I
typecast dataprovider as Arraycollection).
  Recently I added some filters to the room list using
filterfunction. As soon as I start applying filters, I see few items getting
duplicated in the list. Some items exist with old values as well as new
values.
I also tried making the filtering and updating actions mutually
exclusive using flags hoping that two different actions taking
place on the same data might cause duplication of items. But the duplication
is still taking place.
 In fact I tried using itemUpdate() also in place of setItemAt but the
problem still persists.
I have also tried modifying only the source array during updates because the
filtering takes place only on the ArrayCollection and
not on the source array but this also failed.

  Any inputs will be appreciated.

Thanks,
Rohit


Re: [flexcoders] FilterFunction creating duplicate items in the list

2009-05-31 Thread Srinivas Sandur Madhu Murthy
Longtime back I did face similar issue. I probably believe, you have  
binded the array collection with data grid or list directly  applying  
filter on this binded array collection. If it is true, then trying not  
binding them using {}, use flags and commitProperties() method and  
apply filter function if not applied already on collection  then  
assign dataProvider for grid/list. Probably this might remove or  
resolve duplication problem.


Srinivas

On May 31, 2009, at 12:16 PM, Rohit Sharma wrote:




Hi All,

I am stuck up with this problem. Please provide some insight  
into it.


 I have a list component which shows all the game rooms currently  
existing. As soon as some property of the room changes,
I update the corresponding item in the dataprovider using setItemAt.  
(I typecast dataprovider as Arraycollection).
  Recently I added some filters to the room list using  
filterfunction. As soon as I start applying filters, I see few items  
getting
duplicated in the list. Some items exist with old values as well as  
new values.
I also tried making the filtering and updating actions  
mutually exclusive using flags hoping that two different actions  
taking
place on the same data might cause duplication of items. But the  
duplication is still taking place.
 In fact I tried using itemUpdate() also in place of setItemAt  
but the problem still persists.
I have also tried modifying only the source array during updates  
because the filtering takes place only on the ArrayCollection and

not on the source array but this also failed.

  Any inputs will be appreciated.

Thanks,
Rohit





[flexcoders] FilterFunction

2009-03-17 Thread valdhor
You need to check into a number of things...

ArrayCollection:
http://livedocs.adobe.com/flex/3/langref/mx/collections/ArrayCollection.\
html
You need to know how to filter your data. Here you will find info
regarding FilterFunction.

CheckBox:
http://livedocs.adobe.com/flex/3/langref/mx/controls/CheckBox.html
This will show you some of the events that the checkbox generates
including the change event.

String: http://livedocs.adobe.com/flex/3/langref/String.html
This will show you a few ways of doing string searches including
indexOf().

As a quick and dirty example:

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=vertical
 initialize=onInit()
 mx:Script
 ![CDATA[
 import mx.collections.ArrayCollection;

 [Bindable] private var IPAddresses:ArrayCollection;

 private function onInit():void
 {
 IPAddresses = new ArrayCollection([
 {IP:192.168.1.1},
 {IP:192.168.1.2},
 {IP:192.168.1.3},
 {IP:192.168.1.4},
 {IP:192.168.1.5},
 {IP:192.168.2.1},
 {IP:192.168.2.2},
 {IP:192.168.2.3},
 {IP:192.168.2.4},
 {IP:192.168.2.5}
 ]);
 }

 private function checkBoxChanged():void
 {
 if(IPCheckBox.selected)
 {
 IPAddresses.filterFunction = IPFilter;
 }
 else
 {
 IPAddresses.filterFunction = null;
 }
 IPAddresses.refresh();
 }

 private function IPFilter(item:Object):Boolean
 {
 var isMatch:Boolean = false;
 if((item.IP as String).indexOf(IPTextInput.text)  -1)
 {
 isMatch = true;
 }
 return isMatch;
 }
 ]]
 /mx:Script
 mx:HBox
 mx:CheckBox id=IPCheckBox label=IP address
change=checkBoxChanged()/
 mx:TextInput id=IPTextInput /
 /mx:HBox
 mx:DataGrid id=IPDataGrid dataProvider={IPAddresses}
rowCount={IPAddresses.length}
 mx:columns
 mx:DataGridColumn headerText=IP dataField=IP/
 /mx:columns
 /mx:DataGrid
/mx:Application

If there is anything about this you don't understand, please don't
hesitate to ask.


HTH.



Steve


--- In flexcoders@yahoogroups.com, diana_usim diana_u...@... wrote:

 hye

 i've got a problem to build my checkbox.i have a checkbox with label
IP address and a text input beside it.

 i want to be able to input any IP address and when i click the
checkbox button it will filter the datagrid according to IP address
input earlier.it like a combination of 'search' and checkbox.but i don't
know how to do this.

 can you show me how to work on this one??i'm ready to learn form the
expert!!




[flexcoders] filterFunction and selecting a Date Range

2008-10-27 Thread Blair Cox
Hi everyone, just thought I would run this by you.

With the help of others on this list, we were able to find a way to sort
dates returned from a database in a hacked sort of way. What I need to now
is to be able to select a range, so  this date and  this date. Perhaps I¹m
over simplifying this, but I can¹t get modifications of the below to
function:

...
 private function processFilter(item:Object):Boolean {return
item.Date_Collected  dfconv.format(getdate.text).toString();
item.Date_Collected  dfconv.format(getdateEnd.text).toString();
}

It¹s not throwing an error and only half works because it is stopping at the
first part. Any date  ... Works. I can¹t seem to define the  however.

Any hints greatly welcomed. Thanks,

-- 
Blair 





From: Tim Hoff [EMAIL PROTECTED]
Reply-To: flexcoders@yahoogroups.com
Date: Sat, 25 Oct 2008 01:28:37 -
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Help: filterFunction and Dates

 
 


See how messy this gets; when dates are represented as strings.  Look
into AMFPHP serialization/deserialization.  If you get back a date,
instead of a sting, you don't have to jump through these hoops.   I only
say this because the amount of time it takes to setup the integration is
sometimes less than the time it takes to hack the application into
submission. :)

Glad that you have a working solution.

-TH



Re: [flexcoders] filterFunction and selecting a Date Range

2008-10-27 Thread Blair Cox
Yup, that was a totally newbie question...

 private function processFilter(item:Object):Boolean {return
item.Date_Collected  dfconv.format(getdate.text).toString() 
item.Date_Collected  dfconv.format(getdateEnd.text).toString();
}

For future newbie¹s :)

-- 
Blair 





From: Blair Cox [EMAIL PROTECTED]
Reply-To: flexcoders@yahoogroups.com
Date: Mon, 27 Oct 2008 10:58:54 -0300
To: flexcoders@yahoogroups.com
Conversation: filterFunction and selecting a Date Range
Subject: [flexcoders] filterFunction and selecting a Date Range

 
 

Hi everyone, just thought I would run this by you.

With the help of others on this list, we were able to find a way to sort
dates returned from a database in a hacked sort of way. What I need to now
is to be able to select a range, so  this date and  this date. Perhaps I¹m
over simplifying this, but I can¹t get modifications of the below to
function:

...
 private function processFilter(item:Object):Boolean {return
item.Date_Collected  dfconv.format(getdate.text).toString();
item.Date_Collected  dfconv.format(getdateEnd.text).toString();
}

It¹s not throwing an error and only half works because it is stopping at the
first part. Any date  ... Works. I can¹t seem to define the  however.

Any hints greatly welcomed. Thanks,

-- 
Blair 




[flexcoders] filterFunction Tilelist effects

2008-09-17 Thread mjharvey1979
Hi, 
I have created a tilelist component, displaying a grid of products. 
This is then filtered by the user, using  a combobox or typing a search 
string into a text input box. All works fine up 2 now :)

Can anybody give me any tips on how the fade out and re-ordering of the 
tilelist is achieved when items are removed from the list by the filter.

This effect is used in the FlexStore app on the Adobe site. I have 
currently tried using an itemsChangeEffect on the tilelist but it does 
nothing. Any help would be greatly appreciated.

Thanks

Mart



Re: [flexcoders] filterFunction Tilelist effect

2008-09-17 Thread Haykel BEN JEMIA
Didn't test this, but try setting the show and hide effects for the items.

-- 
Haykel Ben Jemia

Allmas
Web  RIA Development
http://www.allmas-tn.com

On Wed, Sep 17, 2008 at 9:27 PM, mjharvey1979 [EMAIL PROTECTED]wrote:

   Hi,
 I have created a tilelist component, displaying a grid of products.
 This is then filtered by the user, using a combobox or typing a search
 string into a text input box. All works fine up 2 now :)

 Can anybody give me any tips on how the fade out and re-ordering of the
 tilelist is achieved when items are removed from the list by the filter.

 This effect is used in the FlexStore app on the Adobe site. I have
 currently tried using an itemsChangeEffect on the tilelist but it does
 nothing. Any help would be greatly appreciated.

 Thanks

 Mart

  



Re: [flexcoders] FilterFunction is throwing an error #1069

2008-09-11 Thread David Harris
Hi,

I came across this error not long ago, and when I search about it I
found something like this is logged in the Flex issue tracker (Jira)

The work round provided is something like:
Before you call the filter function on the dataprovider for the Combo
box, set the selected index for the combo box to -1 (neagtive 1)

HTH

David

On Tue, Jul 29, 2008 at 6:23 PM, jitendra jain
[EMAIL PROTECTED] wrote:
 Hi friends,

 My code is as follows
public function setVisitor():void{

if(frm_visitType.selectedItem == E){
  visitorList= ObjectUtil.copy(model.visitorList)
 as ICollectionView;
  visitorList.filterFunction =
 filterExisitingVisitorCode;
   visitorList.refresh();
}else{
   visitorList=
 ObjectUtil.copy(model.visitorList) as ICollectionView;
   visitorList.filterFunction =
 filterNewVisitorCode;
visitorList.refresh();
}

   }
}
}
public function filterExisitingVisitorCode(item :
 Object):Boolean{
return (item.visitorType==Exisitng)
}
public function filterNewVisitorCode(item : Object):Boolean{
return (item.visitorType==New)
}

 When there is no New Visitor it throws this error.

 ReferenceError: Error #1069: Property data not found on User and there is no
 default value.
 at mx.controls::ComboBase/get value()
 at mx.controls::ComboBase/setSelectedItem()
 at mx.controls::ComboBase/set selectedItem()
 at mx.controls::ComboBox/set selectedItem()
 at mx.controls::ComboBase/updateDisplayList()
 at mx.controls::ComboBox/updateDisplayList()


 Thanks,

 with Regards,
 Jitendra Jain
 Software Engineer
 91-9979960798

 


[flexcoders] FilterFunction is throwing an error #1069

2008-07-29 Thread jitendra jain
Hi friends,

My code is as follows
   public function setVisitor():void{
  
   if(frm_visitType.selectedItem == E){
 visitorList= ObjectUtil.copy(model.visitorList) as 
ICollectionView;
 visitorList.filterFunction = 
filterExisitingVisitorCode;
  visitorList.refresh();
   }else{
  visitorList= ObjectUtil.copy(model.visitorList) 
as ICollectionView;
  visitorList.filterFunction = filterNewVisitorCode;
   visitorList.refresh();
   }

  }
   }
   }
   public function filterExisitingVisitorCode(item : 
Object):Boolean{
   return (item.visitorType==Exisitng)
   }
   public function filterNewVisitorCode(item : Object):Boolean{
   return (item.visitorType==New)
   }
  

When there is no New Visitor it throws this error.

ReferenceError: Error #1069: Property data not found on User and there is no 
default value.
at mx.controls::ComboBase/get value()
at mx.controls::ComboBase/setSelectedItem()
at mx.controls::ComboBase/set selectedItem()
at mx.controls::ComboBox/set selectedItem()
at mx.controls::ComboBase/updateDisplayList()
at mx.controls::ComboBox/updateDisplayList()


Thanks,

with Regards,
Jitendra Jain
Software Engineer
91-9979960798



  

[flexcoders] FilterFunction is throwing an error #1069

2008-07-29 Thread jitendra jain
Hi friends,

My code is as follows
   public function setVisitor():void{
  
   if(frm_visitType.selectedItem == E){
 visitorList= ObjectUtil.copy(model.visitorList) as 
ICollectionView;
 visitorList.filterFunction = 
filterExisitingVisitorCode;
  visitorList.refresh();
   }else{
  visitorList= ObjectUtil.copy(model.visitorList) 
as ICollectionView;
  visitorList.filterFunction = filterNewVisitorCode;
   visitorList.refresh();
   }

  }
   }
   }
   public function filterExisitingVisitorCode(item : 
Object):Boolean{
   return (item.visitorType==Exisitng)
   }
   public function filterNewVisitorCode(item : Object):Boolean{
   return (item.visitorType==New)
   }
  

When there is no New Visitor it throws this error.

ReferenceError: Error #1069: Property data not found on User and there is no 
default value.
at mx.controls::ComboBase/get value()
at mx.controls::ComboBase/setSelectedItem()
at mx.controls::ComboBase/set selectedItem()
at mx.controls::ComboBox/set selectedItem()
at mx.controls::ComboBase/updateDisplayList()
at mx.controls::ComboBox/updateDisplayList()


Thanks,

with Regards,
Jitendra Jain
Software Engineer
91-9979960798



  

[flexcoders] filterFunction problems being had

2008-05-22 Thread bredwards358
Okay, I'm working on a filter function to sort through information in an
ArrayCollection which is filled by the results of a select statement to
a database. The actual functionaility is modified ever so slightly from
the source I found here:

http://www.franto.com/blog2/wp-content/uploads/examples/filterfunction/s\
rcview/

This is what I have:

private function filterProducts():void
{
 model.prodMaintData.filterFunction = sortProducts;
 model.prodMaintData.refresh();
}

private function sortProducts(item:Object):Boolean
 {
 var value:String;
 var col:String = this.cmbColumns.selectedItem.data as String;
 searchBy = this.txtDescription.text;

 searchBy = searchBy.toLowerCase();

 if (searchBy != )
 {
 if (col != any)
 {
 value = item[col]; //Why is value NOT getting set
equal to this?
 value = value.toLowerCase(); //Error happens here
because value is still null for some reason

 if (value.indexOf(searchBy) = 0)
 {
 return true;
 }
 }
 else
 {
 for (var o:String in item)
 {
 value = item[o];
 value = value.toLowerCase();
 if (value.indexOf(searchBy) = 0)
 {
 return true;
 }
 }
 }
 }
 else
 {
 return true;
 }

 return false;
 }


Now, as seen by my comments, I keep getting an error because the value
variable is null for some reason, even when lines were changed around
from what was originally from the sample. I don't know if this has
anything to do with it, but despite the fact that my comboBox is
populated by an ArrayCollection that was declared and filled manually in
the code:


columnArray = new ArrayCollection();
 columnArray.addItem({data:'any', label:'Any'});
 columnArray.addItem({data:'productID', label:'Product ID'});
 columnArray.addItem({data:'productName', label:'Product
Name'});
 columnArray.addItem({data:'print', label:'Print'});
 columnArray.addItem({data:'barcode', label:'Barcode'});
 columnArray.addItem({data:'vendor', label:'Vendor'});
 columnArray.addItem({data:'status', label:'Status'});


The ArrayCollection which populates the dataGrid, the one I'm trying to
sort through, is instantiated and populated automatically again from a
database table. I don't see the reason why the value variable should be
null and causing the error. Thanks in advance.

Brian Ross Edwards



[flexcoders] filterFunction for Array problem

2008-04-21 Thread grimmwerks
I've got an Array of class objects (a class Circle with a property  
percentage) coming in.

I've got 4 Numeric steppers that are supposed to control each Circle's  
percentage  -- trouble is each of the 4 circles has it's own type - so  
one stepper controls one circle type, etc.

How can I best bind the stepper to the correct circle?

If I use the filter function, it return an array - do I do the filter  
function and return the first Circle returned (there will be only one  
-- and in doing this will the binding still work for live data binding?

Or do I just do the extra code up top that when these are loaded in I  
make sure they're always in the proper order and have the steppers  
just bind via Circles[0] -- positioning?




Re: [flexcoders] filterFunction for Array problem

2008-04-21 Thread grimmwerks
Seems like 'some' is more what I want...?


On Apr 21, 2008, at 3:19 PM, grimmwerks wrote:

 I've got an Array of class objects (a class Circle with a property
 percentage) coming in.

 I've got 4 Numeric steppers that are supposed to control each Circle's
 percentage  -- trouble is each of the 4 circles has it's own type - so
 one stepper controls one circle type, etc.

 How can I best bind the stepper to the correct circle?

 If I use the filter function, it return an array - do I do the filter
 function and return the first Circle returned (there will be only one
 -- and in doing this will the binding still work for live data  
 binding?

 Or do I just do the extra code up top that when these are loaded in I
 make sure they're always in the proper order and have the steppers
 just bind via Circles[0] -- positioning?



 

 --
 Flexcoders Mailing List
 FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 Search Archives: 
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo 
 ! Groups Links






[flexcoders] filterFunction - blows up when item field blank

2008-03-27 Thread Don Kerr
I've been using this code below for a long time...but don't fully
understand how it works:) It does work great, as long as both title
and docNumber are not null. But it blows up if docNumber is null.

1) Can someone explain in words what indexOf does? Obviously it
compares the two and spits out a number, but I just don't fully grasp
what is going on. Why use it instead of just == ?

2) The OR || isn't clicking either. Would I add !item.docNumber.length
as another || to prevent the error when docNumber is blank? I want it
to filter on one or more columns in the dataProvider, but not blow up
if any one of them are blank. If one is blank, it should still filter
on the others.

public function processFilter(item:Object):Boolean
{
var result:Boolean=false;
// If no filter text, or a match, then true
if (!item.title.length
|| item.title.toUpperCase().indexOf(term.text.toUpperCase()) = 0
||item.docNumber.toUpperCase().indexOf(term.text.toUpperCase()) = 0
)
result=true;

return result;
}

Thanks for the added insight into this borrowed code.:)
Don



Re: [flexcoders] filterFunction - blows up when item field blank

2008-03-27 Thread Scott Melby

1) Can someone explain in words what indexOf does? Obviously it
compares the two and spits out a number, but I just don't fully grasp
what is going on. Why use it instead of just == ?

 - String.indexOf returns -1 if the specified sequence is not found in 
the target string (the one you are calling the method on) and returns 
the zero based index of the position within the target string if it is 
found.  You would use indexOf if you were interested in substring 
(partial) matches.  i.e. so your grid shows all titles with ch in them 
without requiring the title to BE ch.


The problem you are having is that the filter calls methods on both 
title and docNumber without first checking if they are null.  So, if 
either is null you are going to get exceptions.


I would probably re-write that as something like: Note... this code may 
not compile, but should be close :)


public function processFilter(item:Object):Boolean
{
var result:Boolean=false;


//make sure there is a search term
if(term.text != null  term.text.length  0)
{ 
  //get the search term as upper case

  var searchTerm:String = term.text.toUpperCase();

  //check against the title
  if(item.title != null  item.title.length  0)
  {
 result = (item.title.toUpperCase().indexOf(searchTerm) != -1);
  }

  //no need to check doc number if title already matched or if there is no 
docNumber
  if(result == false  item.docNumber != null  item.docNumber.length  0)
  {
 result = (item.docNumber.toUpperCase().indexOf(searchTerm) != -1);
  }
}

return result;
}

Though I may use RegExp and String.search() instead of indexOf...  Check out this 
page 
http://livedocs.adobe.com/flex/3/html/help.html?content=09_Working_with_Strings_09.html
 for more info on string searches.


hth
Scott

Scott Melby
Founder, Fast Lane Software LLC
http://www.fastlanesw.com
http://blog.fastlanesw.com



Don Kerr wrote:

I've been using this code below for a long time...but don't fully
understand how it works:) It does work great, as long as both title
and docNumber are not null. But it blows up if docNumber is null.

1) Can someone explain in words what indexOf does? Obviously it
compares the two and spits out a number, but I just don't fully grasp
what is going on. Why use it instead of just == ?

2) The OR || isn't clicking either. Would I add !item.docNumber.length
as another || to prevent the error when docNumber is blank? I want it
to filter on one or more columns in the dataProvider, but not blow up
if any one of them are blank. If one is blank, it should still filter
on the others.

public function processFilter(item:Object):Boolean
{
var result:Boolean=false;
// If no filter text, or a match, then true
if (!item.title.length
|| item.title.toUpperCase().indexOf(term.text.toUpperCase()) = 0	 
||item.docNumber.toUpperCase().indexOf(term.text.toUpperCase()) = 0

)
result=true;
		
return result;

}

Thanks for the added insight into this borrowed code.:)
Don


  


RE: [flexcoders] filterFunction on ArrayCollection

2007-08-27 Thread Alex Harui
When does startFIlter get called?  Can you post the entire call stack
with the error?  startFilter may be called before the result from the
HTTPService. Add trace statements to startFilter and the result handler
and see which one gets called first.



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Ary
Sent: Sunday, August 26, 2007 3:07 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] filterFunction on ArrayCollection



Hi Alex, thx for replying, yes i thought so too...but
if it is...it won't work on local either..but it works
on localhost...

here's the code
private function startFilter(toFilter:String):void {
categoryString=toFilter;
tabSwitch(toFilter);
playlist=userRequest.lastResult.videolink.video
playlist.filterFunction=processFilter;
playlist.refresh();
dgUserRequest.selectedIndex=0; 
}

private function processFilter(item:Object):Boolean
{
var result:Boolean=false;
if (!item.videocategory.length ||
item.videocategory.toUpperCase().indexOf(categoryString)
= 0){
result=true;
}
return result;
}

and here is the httpservice, trigerred on
creationComplete app. userRequest.send();
mx:HTTPService id=userRequest url=_fxrequest.php
useProxy=false method=POST
result=playlist=userRequest.lastResult.videolink.video


thanks!
ary

--- Alex Harui [EMAIL PROTECTED] mailto:aharui%40adobe.com  wrote:

 please post some code. Sounds like you might be
 filtering before the
 results come back from the server.

__
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/ http://travel.yahoo.com/ 


 


RE: [flexcoders] filterFunction on ArrayCollection

2007-08-26 Thread Ary
Yes, i called a php file who generate data from mysql
strange ..cause it works fine on my localhost but not
when i upload it to server.


--- Alex Harui [EMAIL PROTECTED] wrote:

 Are you filtering when the result event comes back
 from the webservice?
 
 
 
 From: flexcoders@yahoogroups.com
 [mailto:[EMAIL PROTECTED] On
 Behalf Of Ary
 Sent: Thursday, August 23, 2007 10:05 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] filterFunction on
 ArrayCollection
 
 
 
 Hi,
 
 i have a weird problem with filter function on
 arraycollection, i have generated an array from a
 database (webservice). first, no filter attached
 then
 several button who filter based on a field data, in
 local machine it works fine..all the filter
 condition
 work.
 
 but when i upload it i got this error when trying to
 filter the data 
 TypeError: Error #1009: Cannot access a property or
 method of a null object reference.
 i know this because the array has not been
 populated..but how come it works on my local
 machine?
 and can somebody told me how to detect the array is
 ready for filtering?or some solution...
 
 thank you
 ary
 

__
 Fussy? Opinionated? Impossible to please? Perfect.
 Join Yahoo!'s user
 panel and lay it on us.

http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7

http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
  
 
 
 
  
 



   

Got a little couch potato? 
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mailp=summer+activities+for+kidscs=bz
 


RE: [flexcoders] filterFunction on ArrayCollection

2007-08-26 Thread Alex Harui
please post some code.  Sounds like you might be filtering before the
results come back from the server.



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Ary
Sent: Sunday, August 26, 2007 9:00 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] filterFunction on ArrayCollection



Yes, i called a php file who generate data from mysql
strange ..cause it works fine on my localhost but not
when i upload it to server.

--- Alex Harui [EMAIL PROTECTED] mailto:aharui%40adobe.com  wrote:

 Are you filtering when the result event comes back
 from the webservice?
 
 
 
 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com

 [mailto:flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com ] On
 Behalf Of Ary
 Sent: Thursday, August 23, 2007 10:05 AM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com 
 Subject: [flexcoders] filterFunction on
 ArrayCollection
 
 
 
 Hi,
 
 i have a weird problem with filter function on
 arraycollection, i have generated an array from a
 database (webservice). first, no filter attached
 then
 several button who filter based on a field data, in
 local machine it works fine..all the filter
 condition
 work.
 
 but when i upload it i got this error when trying to
 filter the data 
 TypeError: Error #1009: Cannot access a property or
 method of a null object reference.
 i know this because the array has not been
 populated..but how come it works on my local
 machine?
 and can somebody told me how to detect the array is
 ready for filtering?or some solution...
 
 thank you
 ary
 

__
 Fussy? Opinionated? Impossible to please? Perfect.
 Join Yahoo!'s user
 panel and lay it on us.

http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 

http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 
 
 
 
 
 
 

__
Got a little couch potato? 
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mailp=summer+activities+for+ki
dscs=bz
http://search.yahoo.com/search?fr=oni_on_mailp=summer+activities+for+k
idscs=bz  


 


RE: [flexcoders] filterFunction on ArrayCollection

2007-08-26 Thread Ary
Hi Alex, thx for replying, yes i thought so too...but
if it is...it won't work on local either..but it works
on localhost...

here's the code
private function startFilter(toFilter:String):void {
 categoryString=toFilter;
 tabSwitch(toFilter);
 playlist=userRequest.lastResult.videolink.video
 playlist.filterFunction=processFilter;
 playlist.refresh();
 dgUserRequest.selectedIndex=0;  
}

private function processFilter(item:Object):Boolean
{
var result:Boolean=false;
if (!item.videocategory.length ||
item.videocategory.toUpperCase().indexOf(categoryString)
= 0){
result=true;
}
return result;
}

and here is the httpservice, trigerred on
creationComplete app. userRequest.send();
mx:HTTPService id=userRequest url=_fxrequest.php
useProxy=false method=POST
result=playlist=userRequest.lastResult.videolink.video
 


thanks!
ary


--- Alex Harui [EMAIL PROTECTED] wrote:

 please post some code.  Sounds like you might be
 filtering before the
 results come back from the server.



   

Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/


RE: [flexcoders] filterFunction on ArrayCollection

2007-08-26 Thread Tracy Spratt
Works local but not on server often indicates a security issue.  Are
you sure you are getting your data?

 

Also, this is probably not the best thing:

playlist=userRequest.lastResult.videolink.video

 

Use a result handler function to assign the event.result(don't use
lastResult, it is intended for binding espressions) to a local variable.
The result handler will also let you verify that/when your data result
is returned.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Ary
Sent: Sunday, August 26, 2007 6:07 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] filterFunction on ArrayCollection

 

Hi Alex, thx for replying, yes i thought so too...but
if it is...it won't work on local either..but it works
on localhost...

here's the code
private function startFilter(toFilter:String):void {
categoryString=toFilter;
tabSwitch(toFilter);
playlist=userRequest.lastResult.videolink.video
playlist.filterFunction=processFilter;
playlist.refresh();
dgUserRequest.selectedIndex=0; 
}

private function processFilter(item:Object):Boolean
{
var result:Boolean=false;
if (!item.videocategory.length ||
item.videocategory.toUpperCase().indexOf(categoryString)
= 0){
result=true;
}
return result;
}

and here is the httpservice, trigerred on
creationComplete app. userRequest.send();
mx:HTTPService id=userRequest url=_fxrequest.php
useProxy=false method=POST
result=playlist=userRequest.lastResult.videolink.video


thanks!
ary

--- Alex Harui [EMAIL PROTECTED] mailto:aharui%40adobe.com  wrote:

 please post some code. Sounds like you might be
 filtering before the
 results come back from the server.

__
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/ http://travel.yahoo.com/ 

 



Re: [flexcoders] filterFunction on ArrayCollection

2007-08-26 Thread Arpit Mathur
make sure you have a crossdomain.xml file on ur server

On 8/26/07, Tracy Spratt [EMAIL PROTECTED] wrote:

Works local but not on server often indicates a security issue.  Are
 you sure you are getting your data?



 Also, this is probably not the best thing:

 playlist=userRequest.lastResult.videolink.video



 Use a result handler function to assign the event.result(don't use
 lastResult, it is intended for binding espressions) to a local variable.
 The result handler will also let you verify that/when your data result is
 returned.



 Tracy


  --

 *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On
 Behalf Of *Ary
 *Sent:* Sunday, August 26, 2007 6:07 PM
 *To:* flexcoders@yahoogroups.com
 *Subject:* RE: [flexcoders] filterFunction on ArrayCollection



 Hi Alex, thx for replying, yes i thought so too...but
 if it is...it won't work on local either..but it works
 on localhost...

 here's the code
 private function startFilter(toFilter:String):void {
 categoryString=toFilter;
 tabSwitch(toFilter);
 playlist=userRequest.lastResult.videolink.video
 playlist.filterFunction=processFilter;
 playlist.refresh();
 dgUserRequest.selectedIndex=0;
 }

 private function processFilter(item:Object):Boolean
 {
 var result:Boolean=false;
 if (!item.videocategory.length ||
 item.videocategory.toUpperCase().indexOf(categoryString)
 = 0){
 result=true;
 }
 return result;
 }

 and here is the httpservice, trigerred on
 creationComplete app. userRequest.send();
 mx:HTTPService id=userRequest url=_fxrequest.php
 useProxy=false method=POST
 result=playlist=userRequest.lastResult.videolink.video
 

 thanks!
 ary

 --- Alex Harui [EMAIL PROTECTED] aharui%40adobe.com wrote:

  please post some code. Sounds like you might be
  filtering before the
  results come back from the server.

 __
 Need a vacation? Get great deals
 to amazing places on Yahoo! Travel.
 http://travel.yahoo.com/

  




-- 
Arpit Mathur
Lead Software Engineer,
Comcast Interactive Media
---
post your flex tips on
http://flextips.corank.com


Re: [flexcoders] filterFunction on ArrayCollection

2007-08-26 Thread Ary
Hi Guys,

make sure you have a crossdomain. xml file on ur
server could you explain me more details on this?
:)thank you

Also, this is probably not the best thing:
playlist=userReques t.lastResult. videolink. video 
yes im getting my data, since at first its not
filtered and it return all the data, errors came when
i try to filter it, ok i will try to use result
handler function to assign the event..thx tracy




--- Arpit Mathur [EMAIL PROTECTED] wrote:

 make sure you have a crossdomain.xml file on ur
 server
 
 On 8/26/07, Tracy Spratt [EMAIL PROTECTED]
 wrote:
 
 Works local but not on server often indicates
 a security issue.  Are
  you sure you are getting your data?
 
 
 
  Also, this is probably not the best thing:
 
  playlist=userRequest.lastResult.videolink.video
 
 
 
  Use a result handler function to assign the
 event.result(don't use
  lastResult, it is intended for binding
 espressions) to a local variable.
  The result handler will also let you verify
 that/when your data result is
  returned.
 
 
 
  Tracy



   

Moody friends. Drama queens. Your life? Nope! - their life, your story. Play 
Sims Stories at Yahoo! Games.
http://sims.yahoo.com/  


[flexcoders] filterFunction issue with shared array collection in model / shared list

2007-03-26 Thread scott_flex

I have a shared arraycollection of value objects.  Singeton, only one 
instance of this array collection.

Dfferent views (in a tab navigator) are generated using this shared 
array collection but each view filters the data in a datagrid list with 
different criteria.

So.. in each view i utilized the filterFunction to correctly filter the 
array collection and only display what i needed into my datagrid.  That 
works great.

However, when i set the filter function and refresh the arrayCollection 
all my other views (tab windows) change as well because they are all 
databound to the shared array collection...

This does make sense... but not what i want.  Maybe i need to put the 
filter on the datagrid for each view, not the array collection.

Am i going about this wrong? I'm a newbie cairngorm and i believe this 
is an issue that others would run into.






RE: [flexcoders] filterFunction issue with shared array collection in model / shared list

2007-03-26 Thread Alex Harui
create another arraycollection and assign its source to the other
arraycollection's source



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of scott_flex
Sent: Monday, March 26, 2007 8:11 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] filterFunction issue with shared array collection
in model / shared list




I have a shared arraycollection of value objects. Singeton, only one 
instance of this array collection.

Dfferent views (in a tab navigator) are generated using this shared 
array collection but each view filters the data in a datagrid list with 
different criteria.

So.. in each view i utilized the filterFunction to correctly filter the 
array collection and only display what i needed into my datagrid. That 
works great.

However, when i set the filter function and refresh the arrayCollection 
all my other views (tab windows) change as well because they are all 
databound to the shared array collection...

This does make sense... but not what i want. Maybe i need to put the 
filter on the datagrid for each view, not the array collection.

Am i going about this wrong? I'm a newbie cairngorm and i believe this 
is an issue that others would run into.



 


RE: [flexcoders] filterFunction issue with shared array collection in model / shared list

2007-03-26 Thread Paul Williams
Take a look at the ListCollectionView class - you can pass your 'master'
ArrayCollection into its constructor (because ArrayCollection implements
IList). You can then set filter options on your ListCollectionView
without affecting the 'master'. So you'd probably want to create a
ListCollectionView for each of your individual views:

 

http://livedocs.adobe.com/flex/2/langref/mx/collections/ListCollectionVi
ew.html

 

You can use a ListCollectionView as a dataProvider for your datagrid
controls because it implements the required interfaces (just like
ArrayCollection). The ListCollectionView will also listen for changes to
the underlying 'master' list and update accordingly.

 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of scott_flex
Sent: Monday, March 26, 2007 4:11 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] filterFunction issue with shared array collection
in model / shared list

 


I have a shared arraycollection of value objects. Singeton, only one 
instance of this array collection.

Dfferent views (in a tab navigator) are generated using this shared 
array collection but each view filters the data in a datagrid list with 
different criteria.

So.. in each view i utilized the filterFunction to correctly filter the 
array collection and only display what i needed into my datagrid. That 
works great.

However, when i set the filter function and refresh the arrayCollection 
all my other views (tab windows) change as well because they are all 
databound to the shared array collection...

This does make sense... but not what i want. Maybe i need to put the 
filter on the datagrid for each view, not the array collection.

Am i going about this wrong? I'm a newbie cairngorm and i believe this 
is an issue that others would run into.

 



[flexcoders] filterFunction and List selection problem

2007-03-20 Thread frank_sommers
I have a List with an ArrayCollection as the data provider. When I set a filter 
function on the 
collection, a strange thing happens: When clicking on a list item, the list 
elements re-arrange 
themselves in a strange way. The item selection occurs, but the selected item 
moves to 
another list position. When no filter function is set on the list, this does 
not occur. Any help 
or suggestions as why this is happening, would be appreciated. 

Thanks, 

- -Frank



[flexcoders] Filterfunction on a XMLListCollection is misbehaving

2007-02-27 Thread iko_knyphausen

Here is the deal... I have an XMLListCollection as a dataProvider for a
dataGrid, so that I can use custom sort and filterfunctions. My
application provides for editing selected items (=rows)  in the Grid,
and when an edit is done, I update the Grid, by setting values of the
selectedItem, e.g.

myGrid.selectedItem.dataField = newValue;

This works fine, if I have no filterFunction defined for the
XMLListCollection. The updates happen inplace, the Grid is updated and
the selectedItem (=row) is still highlighted, i.e. selected.

The moment, I specify a filterFunction (one that returns true for all
records, mind you), any update to a field in the current selectedItem
will resort the Grid (no sort object specified, and the dataGrid column
sort is set to false), and the item is always sorted second last in the
grid. At the same time the selectedItem property is lost (set to null).

I know how to disable and enableAutoUpdate (to avoid loosing the
selectedItem), but it still does not explain, why the grid data gets
resorted

Any insight from the pros?

Thanks

Iko



[flexcoders] filterFunction

2007-02-09 Thread kumarpal jain
Hi All,
   
  Can some one help me in filterFunction method of listcollectionView or Array 
Collection ..
   
  I am looking for some examples on the same which will help .
   
  I am a bit confused in this I want to filter some records in array collection 
and can we use this method for this...
   
  Thanks
  Kumar
   


-
 Here’s a new way to find what you're looking for - Yahoo! Answers 

Re: [flexcoders] filterFunction

2007-02-09 Thread Clint Tredway

I have what I call filter functions that will find items and remove them or
if not found add them.. not sure what you are meaning by filter...

On 2/9/07, kumarpal jain [EMAIL PROTECTED] wrote:


  Hi All,

Can some one help me in filterFunction method of listcollectionView or
Array Collection ..

I am looking for some examples on the same which will help .

I am a bit confused in this I want to filter some records in array
collection and can we use this method for this...

Thanks
Kumar


--
Here's a new way to find what you're looking for - Yahoo! 
Answershttp://us.rd.yahoo.com/mail/in/yanswers/*http://in.answers.yahoo.com/

 





--
http://indeegrumpee.spaces.live.com/


[flexcoders] filterFunction between ViewStack MXML components

2006-10-30 Thread pioplacz
Hi! 

I was just wondering is it possible to make a filterfunction work between 
ViewStack 
components. What i mean is i'm calling the HTTP service in my main.mxml but 
showing 
the results in MovieView.mxml passing the data works fine. But i can't figure 
out where i 
should write the filter function:

// Filter function 
public function movieFilter(item:Object):Boolean
{
var result:Boolean=false;
if (!item.title.length
|| item.title.toUpperCase().indexOf(filterInput.text.toUpperCase()) 
= 0)
if (!item.genres.length
|| 
item.genres.toUpperCase().indexOf(genresInput.selectedItem.data.toUpperCase
()) = 0)
result=true;

return result;
 }

and where i should put:

movieCollection.filterFunction=movieFilter;

From the beginning i had all that in my Main.mxml and it worked fine. Can 
somebody help 
me, if you even get what i mean ?




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/