can't show a Set in dataTable (JSF)

Discussion in 'Java' started by Michael Plate, Apr 30, 2007.

  1. Hello,

    i have a problem and need your help.

    follow:
    i had a object A with a set of objects B and that will be loaded completely
    by hibernate. hibernate presents a collection of objects A.

    class B {
    int id;
    String description;
    //getter and setter
    }

    class A{
    int id;
    String description;
    Set<B> listOfBs;
    //getter and setter
    }

    my jsp page with JSF tags using <h:dataTable for illustrate the collection
    comes from hibernate. at moment i can show all description from object A. i
    can't access or show the description of object b on my screen. an problem
    with lazy-loading by hibernate are solved and the objects will loading
    completely. i'm an newbie at JSF and my main problem is finding the correct
    statement for present 'description' of B's.

    the following table should appeared:
    ---------------------------------
    | a1.description | b1.description |
    | a1.description | b2.description |
    ---------------------------------
    | a2.description | b1.description |
    ---------------------------------

    <h:dataTable ....>
    <h:column>
    <f:facet name="header">
    <h:eek:utputText value="#{msgs.a_description}" />
    </f:facet>
    <h:eek:utputText value="#{record.description}" />
    </h:column>
    ...
    <h:column>
    <f:facet name="header">
    <h:eek:utputText value="#{msgs.b_description}" />
    </f:facet>
    // statements for show descriptions
    from object B . <----------------------
    </h:column>
    ...

    i haven't an idea and can't find a solution for my problem.

    thank you very much for answers.

    best regards
    Michael
    Michael Plate, Apr 30, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ersin Gençtürk
    Replies:
    1
    Views:
    3,478
    Ersin Gençtürk
    Oct 6, 2004
  2. dudu
    Replies:
    0
    Views:
    371
  3. Sebastian Fey

    JSF debugging / JSF newsgroup

    Sebastian Fey, Apr 7, 2006, in forum: Java
    Replies:
    1
    Views:
    7,622
    Danno
    Apr 7, 2006
  4. BlackIce
    Replies:
    1
    Views:
    17,162
  5. gbattine
    Replies:
    0
    Views:
    874
    gbattine
    Jul 6, 2006
Loading...

Share This Page