Announcement Announcement Module
Collapse
No announcement yet.
Column of HashSet (1:m-relationship) is empty in entities' list HTML-page Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Column of HashSet (1:m-relationship) is empty in entities' list HTML-page

    Example:

    I've got a class book which contains a ONE_TO_MANY relationship with pages.

    The field of the entity would look like this:

    Code:
        @OneToMany(cascade = CascadeType.ALL)
        private Set<Page> pages = new HashSet<Page>();
    When I let display the list of books in the generated web frontend the pages-column is empty.

    How do I get the data of that HashSet in the tag-library (table.tagx) so I can use it to display the book-titles?

  • #2
    You don't need to edit table.tagx; instead you should be editing src/main/webapp/WEB-INF/views/books/list.jspx to add another column to show the required information (e.g. number of pages in each book). If you get stuck, please post the contents of that file.

    Comment


    • #3
      In the following list.jspx-file the service-column isn't filled with data. I'd like to have all Services which belong to it listed there.

      I also examined the object which delivers all the data to the page. The services are simply missing there.

      In the class-declaration Services looks like this:

      Code:
       @OneToMany(cascade = CascadeType.ALL)
          private Set<Service> services = new HashSet<Service>();
      This is the jspx-file:

      Code:
      <?xml version="1.0" encoding="UTF-8" standalone="no"?>
      <div xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:page="urn:jsptagdir:/WEB-INF/tags/form" xmlns:table="urn:jsptagdir:/WEB-INF/tags/form/fields" version="2.0">
          <jsp:directive.page contentType="text/html;charset=UTF-8"/>
          <jsp:output omit-xml-declaration="yes"/>
          <page:list id="pl_com_myproject_BipKomponente" items="${bipkomponentes}" z="/dZhOZH0G5JGQkGfnhUQIhjRYGA=">
              <table:table data="${bipkomponentes}" id="l_com_myproject_BipKomponente" path="/bipkomponentes" z="HNG58aTHKoOwAsxUpUnE9xPwNKU=">
                  <table:column id="c_com_myproject_BipKomponente_versionsnummer" property="versionsnummer" z="E2PyqXRTwpgRLlB6XushMcxt6Tw="/>
                  <table:column id="c_com_myproject_BipKomponente_services" property="services" z="fj5t/jQQ3wsjp0kS++7KtQoVlZk="/>
                  <table:column id="c_com_myproject_BipKomponente_name" property="name" z="IJ2DWj68Td/f6V1ADsw2HfpHOjs="/>
              </table:table>
          </page:list>
      </div>

      Comment

      Working...
      X