Here is my problem. I have a Java EE 6 web-application and the GUI is done in PrimeFaces. We had to switch to Java EE 7 so we could use GlassFish4.
All the conversion was pretty much changing/adding versins/packages in the pom.xml file. But now - doing a search in the databse works as expected - Data is shown in a table, but showing a dialog with data from the search (result table) doesn't work if I don't refresh the page manually.
I will provide some code, once I am at work, but for now is there something I should consider or check?
Thank you in advance.
Update:
To be more clear about the problem:
- Login in the application with username and password - works (database connection is there and is working)
- First page loads with a search form:
Here si the code:
<h:form id="searchform">
...
<p:commandButton value="Search data" action="#{searchDataBean.searchData}" styleClass="button positive" update="@form" >
</p:commandButton>
<p:commandButton value="Clear fields" styleClass="button negative" update="@form" action="#{searchDataBean.clearFields}">
</p:commandButton>
...
<p:dataTable
value="#{searchDataBean.similarData}"
paginator="true"
var="item"
style="width: 100%"
id="alleSucheTreffer"
paginatorTemplate="All: #{searchDataBean.similarData.rowCount} Results {CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
resizableColumns="true"
rows="10"
rowKey="#{item.id}"
selectionMode="single"
rendered="true">
This works till you do the first search, then the drop-down in the form are resetet everytime you select to search Data, and the Datatable is not updated.
In the datatable on every row there is a button:
<p:commandLink styleClass="button positive" update=":detailsDialog" oncomplete="dialog1.show()" actionListener="#{searchDataBean.clearWorkerStatus}">
<span class="ui-icon ui-icon-search"> </span>
<f:setPropertyActionListener value="#{item}" target="#{searchDataBean.details}" />
</p:commandLink>
It has to show the dialog1 - witch contains the full information about the selected row (DataEntity). h:form with id searchform ends before the dialog.
<p:dialog id="detailsDialog" header="Data Details" dynamic="true" widgetVar="dialog1" hideEffect="explode" modal="true">
<f:facet name="header">
<h:outputText value="Data ID: #{searchDataBean.details.id}" style="background: transparent; font-weight: bold; font-size: 1.2em;" />
</f:facet>
<f:facet name="closeIcon">
test
</f:facet>
<h:form>
...
The method searchData from searchDataBean checks the fields from the form, created HashMap and sends it to the DAO, the result is stored in private variable (getter and setter are there) and returned as DataModel (required by PrimeFaces as ListDataModel).
I suspect that the "update" parameter for the button is not working as exptected in Java EE 6?