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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

how to display List of items in a outputtext in adf

user8696578Jul 28 2013 — edited Jul 29 2013

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

Comments

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

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

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

Thanks Arun. It Worked

1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 26 2013
Added on Jul 28 2013
4 comments
825 views