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.
Thanks
Srini