File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes How to set the value of bean property (type java.util.Set) form JSF page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "How to set the value of bean property (type java.util.Set) form JSF page " Watch "How to set the value of bean property (type java.util.Set) form JSF page " New topic
Author

How to set the value of bean property (type java.util.Set) form JSF page

deepan thiagu
Greenhorn

Joined: May 15, 2007
Posts: 18
Hi,

I have 2 tables category and product. they have one-to-many relation in them.

Category : cat_id(PK),cat_name,cat_desc
Product : prod_id(PK),prod_name,prod_desc,cat_id(FK)

As both have one to many relation so i have declared a set in Category Table.


-----------------------------------------------


class Category implements Serializable
{
........
Set products;
@OneToMany(mappedBy="cat_id")
public void setProducts(Set prod)
{
this.products = prod;
}
public Set getProducts()
{
return products;
}
......
}

--------------------------------------------

i need to refer the result list of Category entity bean from my JSF view page.
here my problem is i cant diplay the set value in my JSF page, becaause no one JSF component to support to display the Set value
so i convert the Set value into List and then i can diplay it, as in

http://sfjsf.blogspot.com/2006/03/usings-sets-with-uidata.html#c2983217366300626078

here the same proble will arrives when i need to set the value to Category entity bean,

i dont know how to set the property value of "products" Category class from my JSF page

Please any one help to how to set the value to "Category" class property "products"

By
Thiagu.m
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to set the value of bean property (type java.util.Set) form JSF page
 
Similar Threads
Spring: Configuring bean property
First day == help
"Set" or "List" for storing foreign key objects
one-to-many relation
Problem while creating Struts application