This discussion is archived
6 Replies Latest reply: May 9, 2012 3:54 AM by umesh.agarwal RSS

Rendering a selectOneChoice from a bean using Shays example

871235 Explorer
Currently Being Moderated

I have extended Shays excellent [Creating Dynamic ADF Input Forms with Iterator|] example to incorporate other components.

I am having a problem with the selectOneChoice component

I have included a List variable as part of the "Field" class and populate it within the constructor but no matter what I put in my page it will not populate the list elements of the selectOneChoice

I am able to access all the other values e.g. name, type, title, style etc using EL, just not the listOfItems2 (the list is rendered but with no elements in it)

Getters and setters exist, I have included the code below with two examples of how I have tried to get the page to render it, any help would be greatly appreciated

I'm using JDeveloper

(I did post a question on Shays blog last week but it seems to have got lost in the system)

public class Field {

    public Field() {
String name;
String type;
String title;
Boolean visible;
Boolean buttonVisible;
String value;
String style;
*List listOfItems2;*

public Field(String name,  String title, String type, String visible, String buttonVisible, String value, String style, List list2){ 

        super(); = name;
        this.type = type;
        this.title = title;
        this.visible = visible.contentEquals("Y");
        this.buttonVisible = buttonVisible.contentEquals("Y");
        this.value = value; = style;

        *List listOfItems = new ArrayList();*

        *listOfItems.add(new SelectItem("Y", "Yes"));*
        *listOfItems.add(new SelectItem("N", "No"));*
        *listOfItems.add(new SelectItem("M", "Maybe"));*

        *this.listOfItems2 = listOfItems;*
   <af:selectOneChoice value="#{var.value}" id="soc2"
           <af:selectItem id="si1" value="#{var.listOfItems2}"/>
   <af:selectOneChoice value="#{var.value}" id="soc2"
       <af:forEach items="#{var.listOfItems2}"
           <af:selectItem id="si1" value="#{lov.value}"
Edited by: Keyser on May 9, 2012 10:54 AM


  • Correct Answers - 10 points
  • Helpful Answers - 5 points