jsf - Update object in bean without reload -
on page have form data database. want implement, default behaviour, writing changes db.
found such example
<h:selectonemenu value="#{bean.options}" onchange="submit()" var="#{bean.options}" valuechangelistener="#{bean.changelisternmethod}"> <f:selectitem itemvalue="1" itemlabel="option1" /> <f:selectitem itemvalue="2" itemlabel="option2" /> <f:selectitem itemvalue="3" itemlabel="option3" /> </h:selectonemenu>
but not call listener method , reload page. can't reload page on every inputtext edit or menu selection change. have idea how achieve such behaviour? update objects in bean without page reload.
<f:ajax listener="#{bean.changelisternmethod}" render="@form" event="valuechange"/>
this how implement partial submit, or in words: update objects in bean without page reload. line typed fire ajax , update (only) form whenever value selected , different previous selected.
for more info:
https://docs.oracle.com/javaee/6/javaserverfaces/2.1/docs/vdldocs/facelets/f/ajax.html
Comments
Post a Comment