getting inputText on only the first row of a (Primefaces) dataTable, with dynamic columns and rows
<p>I have a Primefaces (5.0) Datatable with dynamic columns as well as dynamic rows.
In brief, my problem is how do I set it up so that the cells of the first row are a series of inputText's or inputTextarea's, while the rows below the first are outputText?</p>

<p>To elaborate, the xhtml (following BalusC's response to <a href="https://stackoverflow.com/questions/13970285/creating-and-populating-a-datatable-dynamically-in-jsf2-0/13970491#13970491">Creating and populating a DataTable dynamically in JSF2.0</a>) is as follows:</p>

<pre><code>&lt;p:dataTable var="rowMap" value="#{reviewController.rowMapList}" scrollable="true" scrollWidth="900px"  &gt;
            &lt;p:columns value="#{reviewController.columnNameList}" var="columnName" headerText="#{columnName}"&gt;
                &lt;f:facet name="header" &gt;#{columnName}&lt;/f:facet&gt;
                &lt;f:facet name="header"&gt;&lt;p:inputTextarea  value="#{rowMap[columnName]}"  /&gt;&lt;/f:facet&gt;
                &lt;h:outputText value="#{rowMap[columnName]}"  /&gt;
            &lt;/p:columns&gt;
        &lt;/p:dataTable&gt; 
</code></pre>

<p>So I'm thinking, likely there is a problem in using facets for the row with the inputTexts, because the facet doesn't seem to take part in the dataTable data  iteration.
So how do I put the first row in as a "normal" row (rather than a facet if that is part of the problem) -- but still apply inputTextarea's to that first row, without applying inputTextareas to all the rows?</p>

<p>For the purposes of getting it working, I've set it up statically with a @PostConstruct on reviewController, as follows.</p>

<pre><code>@Named
@ViewScoped
public class ReviewController implements Serializable {

private List&lt;String&gt; columnNameList;
private ArrayList&lt;Map&lt;String, Object&gt;&gt; rowMapList;
private Map&lt;String, Object&gt; rowMap;

@PostConstruct
public void init() {
     columnNameList = new ArrayList&lt;&gt;();
     rowMapList = new ArrayList&lt;&gt;();

     columnNameList.add("Source Report");
     columnNameList.add("Overview");
     columnNameList.add("Question 1");
     columnNameList.add("Question 2");
     columnNameList.add("Question 3");

     Map&lt;String, Object&gt; m = new HashMap&lt;&gt;();
     m.put(columnNameList.get(0), "Assessor1");
     m.put(columnNameList.get(1), "Assessor1 overview text");
     m.put(columnNameList.get(2), "Assessor1 comment on Q1");
     m.put(columnNameList.get(3), "Assessor1 comment on Q2");
     m.put(columnNameList.get(4), "Assessor1 comment on Q3");
     rowMapList.add(m);
     m = new HashMap&lt;&gt;();
     m.put(columnNameList.get(0), "Assessor2");
     m.put(columnNameList.get(1), "Assessor2 overview text");
     m.put(columnNameList.get(2), "Assessor2 comment on Q1");
     m.put(columnNameList.get(3), "Assessor2 comment on Q2");
     m.put(columnNameList.get(4), "Assessor2 comment on Q3");
     rowMapList.add(m);
     //etc
}
</code></pre>

<p>Visually it turns out like this:</p>

<p><a href="https://i.stack.imgur.com/S7Pr5.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S7Pr5.jpg" alt="enter image description here"></a></p>

<p>What I want is to have the first row being a row of InputTextarea's, so the user can add comments in each first row cell in response to the content of the rows beneath it. I've achieved it visually - but as I remark above, it doesn't work in that the inputTextareas (I presume because they're in facets) are not hooked into the rowMap and columnName iterations</p>

<p>I have looked at the primefaces editable datatable (<a href="http://www.primefaces.org/showcase/ui/data/datatable/edit.xhtml" rel="nofollow noreferrer">http://www.primefaces.org/showcase/ui/data/datatable/edit.xhtml</a>) - which is somewhat along the lines of what is required. However it makes all rows editable, not just the first. There is the further complexity in this case that both columns and rows will be dynamically applied.</p>

<p>Any comment or assistance appreciated. Thanks.</p>