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

Save list in database

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have problems with one project. I have two tables Publisher and SubPublisher(id, publisher_id, name), when i add publisher in that form i have dynamic input fields for subPublishers. I get list of subPublishers and then i need to save them in table subPublisher with id of publisher.

Here is my code:

Publisher




SubPublisher




PublisherRepository



SubPublisherRepository



PublisherResource



SubPublisherResource



PublisherService



PublisherController




PublishersController



PublisherConverter



SubPublisherConverter



publishers-edit.html



Problems are:
1. When i open form for adding new publisher there is no fields for adding subpublishers.
2. If i add manually publisher and subpublisher in database and when i try edit them ther is subpublisher field but they are empty, it doesn't list subpublishers that are in database.
3. In PublisherController i don't know how to setSubPublishers.

It would be great if someone can help me with these problems.
Thanks
 
a fool thinks himself to be wise, but a wise man knows himself to be a fool - shakespeare. foolish tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic