i have a JSF datatable and few fields below the table. Also i have a [Save] button with backing bean.My requirement is i should enter the values in those fields and on click of Save, the values should be stored in DB and the Datatable should be updated. Without the Onclick event, datas are stored in Database. if i include the script i am not even able to save the data.
Can any one suggest an idea to update the Datatable as well Data Base(Back end) on click of Save button? Thanks in advance,.
Are you using Rich faces, if yes you can <a4j:jsFunction> or other <a4j: > action mehtods so that you can update dynamically without refreshing the page.
Also, i am experiencing one more issue. If the click the Save button, the newly generated value is refreshed,i.e. it is cleared. Does the newly generated value is mapped to any one of the bean property ?
Bind the each input text field with one bean property so that on form submit values will be updated to the bean and the values wont be cleared.
Hope it may solve your problem. Let me know if you have any confusion.
"Bind the each input text field with one bean property so that on form submit values will be updated to the bean and the values wont be cleared. "
please buy my thing and then I'll have more money:
Free, earth friendly heat - from the CodeRanch trailboss