0

I'm not understanding how <h:dataTable value="#{ManagedBean.all}" /h:dataTable> results in a function within the ManagedBean class getAll() being called.

I understand that <h:form binding="#{ManagedBean.form}" /h:form> calls the constructor of the ManagedBean but not sure how the example above calls a seeming unrelated function.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Mushy
  • 2,535
  • 10
  • 33
  • 54

1 Answers1

1

As per JSF life cycle, during phase 6 i.e Render response. "The values to be shown are retrieved from the value binding getters in the backing bean. Also If a converter is definied, then the value will be passed through the converter getAsString() method and the result will be shown in the form." . Hence to collection to render in datatable with value="#{ManagedBean.all}", the getAll() method is invoked by JSF.

You can refer below link for more info:

Debug JSF lifecycle

Aarati
  • 321
  • 1
  • 10