-1

I am new to JSF2 and having very less idea about front end developement.Currently i am trying to iterate over a list in a text area using JSF2? we have a list of datas like aList[bean1,bean2,bean3,....] and we have to print datas

<h:inputTextarea var ="list" value="#{Bean.value}">
row1-> datas of bean1
row2-> datas of bean2
like all the datas in the list 
</h:inputTextarea>

I vahe searched a lot but did not get proper information, please help me.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
subhashis
  • 4,629
  • 8
  • 37
  • 52
  • 1
    your question as it stands is strange. You want structured data to be displayed in an unstructured **input** component where it can be edited. And the value attribute of the can just point to any text format/style/... you'd like to show. So your question really is not jsf/icefaces related at all, but plain java... – Kukeltje Apr 15 '16 at 07:42
  • we want to print structured data and with read only property so it can not be edited. At controller layer we have a list which contains data in the format i have shown above, so in the view layer we have a list to show in a text area or table, but condition is after printing all the values of one element of list the second element should start from a new row. – subhashis Apr 15 '16 at 09:17
  • 1
    Why do you want to use a textarea then? It is still nothing more than iterating over a list of which stackoverflow has multiple questions and answers – Kukeltje Apr 15 '16 at 14:36

2 Answers2

0

If you want to display different textArea for different rows you can write as:

    <h:form id="test">
           <h:panelGrid value="#{testController.myRows}" var="myVar">
            <h:inputTextarea value="#{myVar}"/>
           </h:panelGrid>    
   </h:form>

Although instead of panelGrid you can use datalist also

techipank
  • 432
  • 4
  • 17
0
<ace:panel id="jPanel5" style="text-align:left;border:0;width:100%;">
                            <h:outputLabel id="message" value="#{msgs['css.Label.message']}" styleClass="css-lebel">
                            </h:outputLabel>

                            <ice:panelSeries var="item" value="#{Bean.searchResultArea}" style="border:1px solid black;width:1150px;height:400px;overflow-y:scroll;overflow-x:scroll;">
                          <h:outputText value="#{item}&lt;br/&gt;&lt;br/&gt;"  style="white-space: nowrap;" escape="false" />

                            </ice:panelSeries>

</ace:panel>

I did like this and get proper output.

subhashis
  • 4,629
  • 8
  • 37
  • 52