Here's one of the buttons:
Code: Select all
<p:fieldset legend="Insert" toggleable="true" toggleSpeed="500" collapsed="true" >
<h:panelGrid columns="4" style="margin-bottom:10px" cellpadding="5">
<h:outputText value="Enter formula:" />
<p:inputText placeholder="f(t) = t" value="#{support.userInputFormula}"/>
<p:commandButton id="insert" value="Insert" action="#{support.insert(support.userInputFormula)}" update="displayInsert"/>
<p:ajax event="insert" update="displayTable" listener="#{support.updateTable}"/>
<h:outputText id="displayInsert" value="#{support.outputText}" style="color: #{support.textColor == 'yes' ? 'green' : 'red'};" />
</h:panelGrid>
</p:fieldset>
Code: Select all
<p:dataTable var="table" value="#{dtPaginatorView.formulas}" rows="10"
paginator="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10,15" resizableColumns="true" >
<p:column headerText="Id" style="width:25%">
<h:outputText value="#{table.id}" />
</p:column>
<p:column headerText="Formula" >
<h:outputText value="#{table.formula}" />
</p:column>
</p:dataTable>