Faire une recherche par date
j'ai encore un petit problème, mais cette fois ci ça concerne une recherche par date.
En fait dans bean j'ai la fonction suivante :
Code:
1 2 3 4 5 6 7
|
public void searchRow(@SuppressWarnings("unused")
ActionEvent evt) {
searchDAO = new DAO();
results= searchDAO.findByProperty("AcomMonitoringEventLog", "eventType","eventSource","eventSource","eventSource", getCurrentAcomMonitoringEventLog().getEventType(),getCurrentAcomMonitoringEventLog().getEventSource(),getCurrentAcomMonitoringEventLog().getEventSource(),getCurrentAcomMonitoringEventLog().getEventSource());
System.out.println("row number " + results.size());
} |
et dans mon jsf j'ai le code suivant:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
<f:view>
<h:form>
<h:panelGrid border="0" columns="5" width="90%" style="background-color: Gray; height: 18%; width: 90%">
<h:outputText value="Start Date" styleClass="HEADING" style="width:200px"></h:outputText>
<h:inputText value = "#{search_1.currentAcomMonitoringEventLog.eventType}"> </h:inputText>
<h:outputText value="End Date" styleClass="HEADING" style="width:200px"></h:outputText>
<h:inputText value = "#{search_1.currentAcomMonitoringEventLog.eventSource}"></h:inputText>
<h:commandButton value="Search" actionListener= "#{search_1.searchRow}" style="width: 100%"></h:commandButton>
<h:outputText value="Start Time" styleClass="HEADING" style="width: 195px"></h:outputText>
<h:inputText value = "#{search_1.currentAcomMonitoringEventLog.eventSource}"></h:inputText>
<h:outputText value="End Time" styleClass="HEADING" style="width: 199px"></h:outputText>
<h:inputText value = "#{search_1.currentAcomMonitoringEventLog.eventSource}"></h:inputText>
<h:commandButton value="Export" style="width: 100%"></h:commandButton>
</h:panelGrid>
</h:form><br>
<br>
<h:panelGrid border="0" style="height: 20%; width: 90%">
<h:dataTable value="#{search_1.results}" var="res" headerClass="HEADING"
rowClasses="ROW" id="table" border="1" width="100%">
<h:column>
<f:facet name="header">
<h:outputText value="Date/Time" />
</f:facet>
<h:outputText value="#{res.eventDateTime}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Command" />
</f:facet>
<h:outputText value="#{res.description}" />
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Result of the command" />
</f:facet>
<h:outputText value="#{res.actionTaken}" />
</h:column>
</h:dataTable>
</h:panelGrid>
</f:view> |
Le problème c'est que dès que je change ce qu'il ya en rouge par respectivement :
Code:
getCurrentAcomMonitoringEventLog().getEventDateTime()
et
Code:
<h:inputText value = "#{search_1.currentAcomMonitoringEventLog.eventDateTime}">
j'ai une erreur au niveau de la date et ceci pour toutes les valeurs de type date ( sachant que eventDateTime est définie autant que date )
Merci de votre aide