• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
It's a tiny ad only because the water is so cold.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic