Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Contributor
bsd6687
Posts: 9
Registered: ‎08-08-2011
My Device: 9800

how to filter the basicfilteredlist based upon the sign(+ve or -ve) of value.

I have created one autocompletecompletefield, and i added one basicfilteredlist to that. I have added one Dataset to the basicfilteredlist of type integer. My Dataset has contain both negative and positive integer values. When i enter any positive value in autocompletefield, i got both negative values and positive values.Now My requirement is " when i type the "-(Minus)", i want to get the only negative values. when i type positive value i want to get only positive values which starts with with the number which i have entered in autocompletefield".

Here is my code. 

 

 

basicfilteredlist.addDataSet(1,chs2,"Pressure",BasicFilteredList.SORT_BY_SECONDARY_FIELD); AutoCompleteField. acf1 = new AutoCompleteField(bfl1,Field.FIELD_LEFT){  
     public int getPreferredWidth() {
      return 70;
     }
     public int getPreferredHeight() {
      return 30;
     }
   protected void sublayout( int maxWidth, int maxHeight ){
      super.sublayout(70,30);
      setExtent(70,30);
   }
}

 

Please help me ASAP.

 

Thanks in advance.