The saveData function is called as testSave() action is invoked. However, setcontentString() are not called and modified content is not saved.
This is because you set a4j:jsFunction attribtue "ajaxsingle='true'", if you want to pass the editor's value to server, you should add attribute "process='htmlEditor'" to it.
If I remove <a4j:region> tag around the a4j:commandButton, the content will be saved everytime I click on the button.
I don't think it will run like your description, maybe, you close action do the save action again.
My opinion only!!
Thank you for your reply.
As you pointed it out, "ajaxsingle='true'" caused the problem. After I remove the attribute, it works as expected even without attribute "process='htmlEditor'".
My close action does not save it. I think that the close button submits the form, the server processes the editor component and save the content if there is no a4j:region around it.
That's right, if you remove "ajaxsingle=true", it works normally, but, if you do this, the whole form will be submitted as well, it means that you form has four fields, then four fields's value will be transfered to the server. if you just want to use editor's value, you should add "ajaxsingle=true" and "ajaxsingle=true", then only the editor's value will pass to the server.
I think that the close button submits the form
I don't know your words "the content will be saved everytime" means, your "saved" means server cant read the eidtor's value or the value saved into DB or some other meaning?
Yes, "saved" means setContentString() is called which saved the value in the editor to the DB. Now I put a4j:region around jsFunction and the editor, and I think only these two components are processed when the jsFucntion is invoked.