Forum Stats

  • 3,872,668 Users
  • 2,266,452 Discussions
  • 7,911,278 Comments

Discussions

how to display List of items in a outputtext in adf

user8696578
user8696578 Member Posts: 483
edited Jul 29, 2013 7:03AM in JDeveloper and ADF

Hi ADF Experts,

My question is I am able to get the selected items from a List<String> on click of a button. How can I display each item as a outputtext inside a panelbox.

Thanks,

Rahul

Answers

  • Arunkumar Ramamoorthy-Oracle
    Arunkumar Ramamoorthy-Oracle Member Posts: 5,880 Employee

    Rahul,

    Always mention your JDev version.

    Your usecase is not clear to me. If you want to split the array and display the strings in the output text, check out if you could use af:forEach / af:iterator (with an output text inside it).

    -Arun

  • user8696578
    user8696578 Member Posts: 483

    Hi Arun,

    Yes you are correct I am using af:foreach.

    Can you tell me what would the value of the outputtext point to(since it is a String). As the iterator is pointing to a list of items. and it also has a var property as items.

    Jdeveloper 11.1.1.7.0

    Regards,

    Rahul

  • Arunkumar Ramamoorthy-Oracle
    Arunkumar Ramamoorthy-Oracle Member Posts: 5,880 Employee

    Rahul,

    Here is a simple ex:

    JSPX :

    <af:panelBox id="pb1">
    <af:forEach var="items" items="#{viewScope.MyBean.stringList}">
    <af:outputText id="ot1" value="#{items}"/>
    </af:forEach>
    </af:panelBox>

    Bean :

    public class MyBean {
    private List<String> stringList;
        public void setStringList(List<String> stringList) {
            this.stringList = stringList;
        }     public List<String> getStringList() {
            return stringList;
        }     public MyBean() {
            super();
            stringList = new ArrayList<String>();
            stringList.add("One");
            stringList.add("Two");
            stringList.add("Three");
            stringList.add("Four");
            stringList.add("Five"); } }

    -Arun

    B

  • user8696578
    user8696578 Member Posts: 483

    Thanks Arun. It Worked

This discussion has been closed.