aspose file tools*
The moose likes Beginning Java and the fly likes Storing into a list from a model for a 'specific status' only ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Storing into a list from a model for a Watch "Storing into a list from a model for a New topic
Author

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

Vinod Vinu
Ranch Hand

Joined: Aug 30, 2009
Posts: 217
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 ?


Vinod Kumar Nair
"Any fool can write code that a computer can understan. Good programmers write code that humans can understand."
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39436
    
  28
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

Joined: Aug 30, 2009
Posts: 217
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
Sheriff

Joined: Oct 13, 2005
Posts: 39436
    
  28
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Storing into a list from a model for a 'specific status' only ?