myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conway. Fintan \(IT Solutions\)" <>
Subject RE: JSF Value Binding Technique
Date Thu, 26 Apr 2007 08:29:39 GMT
Hi Bansi,

Is B a managed bean as well?

You might have to explicitly call the getter for id in B

i.e. value="#{backingBean.A.B.getId()}"

-----Original Message-----
From: bansi [] 
Sent: 25 April 2007 18:47
Subject: JSF Value Binding Technique

Wondering if its feasible to set the values for java.util.Set using JSF
value binding expression

For example

<h:selectOneMenu id="contact" value="#{backingBean.model.contacts}"> 
<f:selectItems value="#{backingBean.contactList}" /> 

Please note contacts is defined as java.util.Set in model

I have one more question on Value Binding
Here is the situation
I have two model/pojo classes
Class A{
private B b;

Class B{
private long id;

The jsf page has following snippet
<h:selectOneMenu id="ptrType" value="#{backingBean.A.B}" >
<f:selectItems value="#{backingBean.ptrTypeList}" /> 

Here is backing bean snippet
List<SelectItem> ptrTypeList = new ArrayList<SelectItem>(); 
ptrTypeList.add(new SelectItem("10","Primary PTR")); ptrTypeList.add(new
SelectItem("20","No PTR")); return ptrTypeList;

So the JSF page shows a dropdown list of values. When i pick a value
from the list it should set the value to the "id" attribute in Class B
i.e. <h:selectOneMenu id="ptrType" value="#{}" > 

I am getting error "Target is Unreachable"

I have setter/getter methods in both Class A & B
Please note hibernate mapping file shows the relationship between A and
B as the id in class A is foreign key and references id as the primary
key of class B

Any pointers/suggestions will be highly appreciated
View this message in context:
Sent from the MyFaces - Users mailing list archive at

* ** *** ** * ** *** ** * ** *** ** *
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed.
Any views or opinions presented are solely those of the author, and do not necessarily
represent those of ESB.
If you have received this email in error please notify the sender.

Although ESB scans e-mail and attachments for viruses, it does not guarantee
that either are virus-free and accepts no liability for any damage sustained
as a result of viruses.

Company Registration Information:
* ** *** ** * ** *** ** * ** *** ** *

View raw message