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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -