Win a copy of Spring Boot in Practice this week in the Spring 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

retrieving data from table and saving into database

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,

I have used Table and passed it to a TableEditor element.
I have a few text boxes and combo from which the user enters data.
Then there is a editable table using which user is allowed to enter data into table directly.
I want to know how to know how many rows have the user entered data when they click on the save button.
also how to save multiple rows to the db at the same time ie on click of save button. my code doesnt seem to work
There is also a delete and edit button. Please help.
Here is my code.




 
Sheriff
Posts: 22667
127
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ItDoesntWorkIsUseless. Does the code throw an error? Does it get called at all? What exactly is not working?
 
Anita Nair
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my code is as given below..
now i want to allow users to enter data directly into the table..
on the click of save button i want to know how many rows the user has entered so that i can save it into my database using for loop
now i am doing it by reading a textbox which asks the user for the number of rows they want to enter.
Though this is very inefficient i dont know what else to do? Please help


 
Bartender
Posts: 1104
10
Netbeans IDE Java Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anita, Welcome to the Ranch!

You have to first write your own TableModel from which you can get the number of rows and all the data. My sugeestion would be to start reading the tutorial about tables.

You have posted code of 400 lines with db code which doesn't really help. You should create a SSCCE and post the code.
 
Anita Nair
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks..
another question is that one of my column in the table is a droprdownbox based on the value of which i want to hide /show another column.
how do i do this?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic