Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Display values in LOV.

SuganyaJan 30 2013 — edited Jan 30 2013
Hi All,

I am using jdev 11.1.2.2.0. I have a page which contains

<af:selectOneChoice value="#{viewScope.valueBean.selectedValues}" id="soc1" label="value" binding="#{viewScope.valueBean.soc1}"/>

this LOV taking values from bean.Default value of this LOV is null.My requirement is if it contains only one value that should be displayed as default in the lov.if it contains more than one value the lov should allow user to select the value.

Can anybody help me on this???

Thanks in advance,
Suganya.

Comments

Frank Nimphius-Oracle
Hi,

use an af:inputText fiedl and an af:selectOneChoice component both having their value property pointing to #{viewScope.valueBean.selectedValues} . Then use EL and configure the rendered property to
access the managed bean to determine the length of bean.Default. If this is <=1 return true for theinput text fields, if it is >1 then return true for the select one choice. When you access the length (setter/getter methods in the managed bean) ensure if the outcome is "1", the value is written to #{viewScope.valueBean.selectedValues} so the default value is set

Frank
Suganya
Hi Frank,

Thanks for your reply.it is taking value like this in bean
String selectedValues = (String)JSFUtils.getFromSession("selectedLob");

how can i get the length of this ?? can you suggest some way??


Thanks,
Suganya.
1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Feb 27 2013
Added on Jan 30 2013
2 comments
118 views