i have dataTable,in therein(dataTable) i have two edits columns of type inputTextarea but when i presse enter key for insert interline in my inputTextarea the data saved. how i can insert interline and how i can replace event="cellEdit" by event="blur"
<p:ajax event="cellEdit" listener="#{beanListTache.onCellEdit}" update=":form:growl" />
<p:column headerText="#{messages.PlanningServiceProgression}" style="width:75px;background-color:##{lineBgColor};">
<p:cellEditor>
<f:facet name="output"><div style="height: 95px;"><h:outputText value="#{tache.progression}" style="white-space:pre-wrap !important;font-size:10px; "/></div></f:facet>
<f:facet name="input"><p:inputTextarea value="#{tache.progression}" style="width:100%;height: 95px !important;" label="Progression"/></f:facet>
</p:cellEditor>
</p:column>
<p:column headerText="#{messages.PlanningServiceObservations}" style="margin-left: -10px;background-color:##{lineBgColor};">
<p:cellEditor>
<f:facet name="output"><div style="height: 95px;"><h:outputText value="#{tache.observation}" style="white-space:pre-wrap !important;font-size: 10px;"/></div></f:facet>
<f:facet name="input"><p:inputTextarea value="#{tache.observation}" style="width:100%;height: 95px !important;" label="Observation"/></f:facet>
</p:cellEditor>
</p:column>
and my bean is:
public void onCellEdit(CellEditEvent event) {
Object oldValue = event.getOldValue();
Object newValue = event.getNewValue();
if(!newValue.equals("") && !newValue.equals(oldValue)) {
Def d=tacheService.trouver(Integer.parseInt(event.getRowKey())).getDef();
if(event.getColumn().getHeaderText().equals("Progression")){
d.setProgression(newValue.toString());
}else{
d.setObservation(newValue.toString());
}
defService.modifier(d);
FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, "Cell Changed", "Commentaire bien enregistrer");
FacesContext.getCurrentInstance().addMessage(null, msg);
}
}