Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2007

Tip: Looking for answers? Try searching our database.

Darstellung von Set-Elementen in JSF

Thread view: 
Michael Plate - 29 Apr 2007 21:16 GMT
Hallo Leute!

ich hab ein Problem und brauche eure fachliche Kompetenz zur Lösung.

Folgendes:
Ich hab ein Object A mit einen Set an weiteren Objects B und wird als Liste
per Hibernate aus der DB geladen.

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

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

In der JSP mit JSF-Tags kommt <h:dataTable zum Einsatz um eine komplette
Liste darzustellen. Ich bin soweit, dass alle Properties aus A angezeigt
werden, aber mein Problem ist die Darstellung aller B Elemente (Set). Bis
jetzt erhalte ich nichts zurück oder eine Fehlermeldung. Die Objekte werden
von Hibernate komplett eingelesen. Ein Problem mit Lazy-Loading gibt es
nicht.

<h:dataTable ....>
<h:column>
<f:facet name="header">
<h:outputText value="#{msgs.a_description}" />
</f:facet>
<h:outputText value="#{record.description}" />
</h:column>
...
<h:column>
<f:facet name="header">
<h:outputText value="#{msgs.b_description}" />
</f:facet>
                                     Hier sollte was stehen, um alle
Descriptions aus B anzuzeigen.  <----------------------
</h:column>
...

Ich bin mit meinen Gedanken am Ende und weiß nicht mehr weiter.

Viele Dank für eure Hilfe und einen schönen Tag

Gruss
Michael
DeoXMAN - 29 Apr 2007 22:48 GMT
On Apr 29, 10:16 pm, "Michael Plate" <michael.pla...@ewetel.net>
wrote:
> Hallo Leute!
>
[quoted text clipped - 49 lines]
> Gruss
> Michael

This group is english languaged, so i suggest you should try to use
english ;)
Michael Plate - 30 Apr 2007 06:33 GMT
Hello DeoXMAN,

thank you for your special note. :-)

here the translation of my previous contribution:

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:outputText value="#{msgs.a_description}" />
</f:facet>
<h:outputText value="#{record.description}" />
</h:column>
...
<h:column>
<f:facet name="header">
<h:outputText 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.