• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Storing into a list from a model for a 'specific status' only ?

 
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi, on a jsp there are two checkboxes : -

Ordered
Not Ordered

since such no fields are there in a actual table of a db. Iam getting a complete list irrespective of the status which is getting stored in a resultModel of the form.

Now iam able to get that data from a model and place it on jsp of differnt model. But all the records are getting shown.

I want to filter it by the status.

what i want from you guyz is to just give me some hint on it.

i want to take data from model and store it in a list first like:-


and it printing for Ordered only.
But how to store it inside the list which contains 'specific status' data and then print it on jsp

any idea ?
 
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That looks pretty disastrous, using == to compare Strings, and creating a new List as a local variable inside the "if" block.

And please be careful about spellings; some people who didn't learn English as children may have difficulty with "guyz".
 
Vinod Vinu
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

That looks pretty disastrous, using == to compare Strings, and creating a new List as a local variable inside the "if" block.



i know it is not a good idea to compare two such strings but i was doing this just on temporirly basis but actual implementation will done later.
 
Campbell Ritchie
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your temporary code will find its way into production code; because you have omitted correct practice at this stage you will have much more work sorting it out later.
 
reply
    Bookmark Topic Watch Topic
  • New Topic