You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Rafael Nami <ra...@gmail.com> on 2005/10/21 19:11:24 UTC

javascript in onclick for h:commandLink

Hi everyone. I was trying to use a simple confirm javascript in the
h:commandLink, like this:

*<h:commandLink action="#{pc_AcoesAtendimento.doAtenderChamado}"*

*value="Atender Chamado" **onclick="return confirm('Deseja atender este
chamado?');"*

*rendered="#{pc_DetalhesChamado.renderedAtenderChamado}"/>*
But a strange behavior is happening. If I put in the onclick the return,
nothing happens if the user
click "yes" or "no". But if I don't put the return, both the "yes" and "no"
buttons execute.
 PS - When I looked at the source code, I've seen TWO onclick in the same
component - one
with my confirm and lotsa other JSF things, and other just with my confirm.
Why is this happening?
 Thanks in advance, and Best Regards
 Rafael Mauricio Nami