Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Find method : Filtering in Gui?

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I understand that in the Data class my find method has to do a OR search with startsWith and in the GUI I need to use a equals / equalsIgnoreCase for exact matches. For this apart from the provided find method in the Data class I have extra methods to do the exact matches fulfilling both AND and OR conditions on name and location. Is this the right approach or should I use TableRowSorter to do filtering? I find using methods more intuitive but would like to use the correct approach. From what I understand the Data class should be separate from the gui layer so having methods in the Dats class to be used in the GUI seems a not right to me.Can anyone please throw some light in this regard?

Thanks,
Regards,
Bably Das
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bably,

The find-method in my business service filters the records returned by the find-method of the Data class. The filtered list is returned to the GUI and displayed in the JTable.
Of course it is just another decision you have to make but using a Sorter to filter records is not a very good idea: a Sorter should be used to sort records in some kind of order.

Kind regards,
Roel
 
Bably Das
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Roel for the quick reply!

The find-method in my business service filters the records returned by the find-method of the Data class. The filtered list is returned to the GUI and displayed in the JTable.



My find method in the business layer is doing exactly that! I am at peace now

Regards,
Bably Das

 
straws are for suckers. tiny ads are for attractive people.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic