Saving data model when using dataTable in jsf

I wanted to create a command line column in p: dataTable so that I can delete rows from the table. so I added this column to the table:

<p:column>
  <p:commandLink process="@form" update=":growl @form"  action="#{cityManagedBean.deleteCity(cityItem)}">
    <h:graphicImage library="images" name="icon/delete.png"/>
  </p:commandLink>
</p:column>

      

according to these threads: How to pass parameter to commandLink inside datatable?

CDI bean List in datatable is null to send from JSF

I understand that the datamodel used in the dataTable needs to be stored in the post request processing. and when I changed the scope of the support bean to chaining for conversation everything works fine.

but my questions are:

  • why datamodel should be saved. I mean what's going on under the hood in the jsf lifecycle, do I need to store the datamodel of the dataTable?

  • in the primefaces demo site in the tutorialTable section, the converter is not used when selecting and working with POJOs in dataTable. what's going on under the hood that makes it unnecessary to convert objects to strings and vice versa?

  • if it is possible to pass POJOs from facelets to bean backups without converters why is it necessary to define converters when working with selectOneMenu and SelectManyMenu components?

+3


source to share





All Articles