The function just replaces newlines (\n) in the text value with <p> tags i.e. it converts the text into paragraphs. But why does that mean that selection doesn't work?
I have tried putting the h:outputText inside a p:outputPanel, a h:panelGrid and a h:panelGroup but nothing seems to work.
Any help would be greatly appreciated.
Here is the code for my datatable:-
Code: Select all
<p:dataTable id="productsTable" var="product" value="#{productsBean.products}"
rowStyleClass="white" selected="#{productsBean.selectedProduct}" selectionMode="single"
rowSelectListener="#{productsBean.onRowSelect}" rowUnselectListener="#{productsBean.onRowUnselect}"
onRowSelectUpdate="productsPanel,confirmMessage" onRowUnselectUpdate="productsPanel,confirmMessage"
selection="#{productsBean.selectedProduct}">
<p:column headerText="Name">
<h:outputText value="#{product.name}"/>
</p:column>
<p:column headerText="Description">
<h:outputText value="#{web:formatParagraphsWithClass(product.description, 'no-padding')}" escape="false"/>
</p:column>
<p:column headerText="Task Prefix">
<h:outputText value="#{product.taskPrefix}"/>
</p:column>
</p:dataTable>