2 Replies Latest reply on Jan 30, 2013 11:59 AM by Suganya

    Display values in LOV.

      Hi All,

      I am using jdev 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,
        • 1. Re: Display values in LOV.
          Frank Nimphius-Oracle

          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

          • 2. Re: Display values in LOV.
            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??