• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Problem in Creating Check Box and Passing Entire Row Data to Servlet

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the Data From database is displayed correctly but i need to a check box in front of each row and when i check that check box entire row date has to be selected and passed to servlet can any one please help me out with detailed code .Thanks in Advance ..

Here is the displayed Code


 
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,


first of all please use code tag to post a code, due to that easy to read code you pasted.

I dont see form tag start in your JSP & also there is no checkbox in your jsp.
Is this the same jsp you wanted a checkbox?
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi nikitha,
I take the liberty of editing your post to apply code tag, see how cool is that now! please follow the same technique in future. thanks :)
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In terms of data structure design, I think you could do a lot better than an array list of individual properties.
Why not use an Object with those 11 or so properties you want to display, and have a list of those objects?
That would make the page a lot simpler - removing the need for all of those if statements, and the tracking of i/j/k.

In terms of adding a checkbox, the approach I would take is to have a standard checkbox, the value being something which can identify the row.
I wouldn't necessarily pass all the information in that same row, just the value required to identify which one is being worked with.
Normally that would just be an id of some sort. Would the Order Number suffice?



 
These are the worst of times and these are the best of times. And this is the best tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic