This content has been marked as final.
Show 2 replies
-
1. Re: a4j:commandLink onclick return value affects behaviour
mkuehle May 2, 2007 4:47 AM (in response to mkuehle)I found the answer to solve this problem.
The answer ist not to return a return value if the confirmation returned true. Because if the custom javascript in onclick attribute returns a value the following javascript which is added automatically by ajax4jsf framework to submit the form wouldn't be executed (as normal behaviour if there is a return statement... ;).
So if i change the onclick javascript to the following it works like i expect it.<a4j:commandLink action="#{MyBB.doit}" reRender="myComp" onclick="if(!confirm('Confirm it')){return false;}">Delete Entry</a4j:commandLink>
I found this solution through the "Custom Java Script together with Ajax4jsf" Example (http://livedemo.exadel.com/a4j-jsEvents/).
Maybe someone needs this information... -
2. Re: a4j:commandLink onclick return value affects behaviour
sergeysmirnov May 2, 2007 1:56 PM (in response to mkuehle)Yes, you are right here. Actually, I answered a similar question in another thread, but missed your question. Sorry. I was very simple to answer.