title: <p:commandLink> is not working when i use onClick event
body: <p>Hope you all will be fine. The scenerio is that i have a page on which you upload picture and then remove it. I used code like this</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;h:panelGrid columns="5"
               border=""
               width="20%"
               style="position: absolute; top: 50px;"
               columnClasses="asteriskColumns, nameColumns" &gt;
  
      &lt;h:outputText value="*" /&gt;
      &lt;h:outputText value="Map: " /&gt;
      &lt;p:fileUpload id="cityMap"
                    description="Image"
                    update="city messages"
                    allowTypes="*.jpg;*.png;*.gif;*.jpeg;"
                    auto="true"
                    fileUploadListener="#{cityDetail.imageUpload}" &gt;
  
      &lt;/p:fileUpload&gt;
  
      &lt;p:graphicImage id="city"
                      value="#{cityDetail.imagePath}"
                      width="80"
                      height="50"
                      cache="false"&gt;
  
          &lt;f:event type="preRenderComponent" listener="#{cityDetail.putImage}" /&gt;
  
      &lt;/p:graphicImage&gt;
  
      &lt;p:commandLink update="city"
                     action="#{cityDetail.removeImage}"
                     style="color: #0d5b7f;text-decoration: underline"
                     onclick=""&gt;
  
          &lt;h:outputText value="remove" /&gt;
  
      &lt;/p:commandLink&gt;
  
      &lt;h:outputText value="*" /&gt;
      &lt;h:outputText value="Image1: " /&gt;
      &lt;p:fileUpload id="cityImage1"
                    description="Image"
                    update="Image1 messages"
                    allowTypes="*.jpg;*.png;*.gif;*.jpeg;"
                    auto="true"
                    fileUploadListener="#{cityDetail.imageUpload}" &gt;
  
      &lt;/p:fileUpload&gt;
  
      &lt;p:graphicImage id="Image1"
                      value="#{cityDetail.imagePath}"
                      width="80"
                      height="50"
                      cache="false" &gt;
  
          &lt;f:event type="preRenderComponent" listener="#{cityDetail.putImage}" /&gt;
  
      &lt;/p:graphicImage&gt;
  
      &lt;p:commandLink update="Image1"
                     action="#{cityDetail.removeImage}"
                     style="color: #0d5b7f;text-decoration: underline"
                     onclick="if (!confirm('Are you sure, you want to delete the picture?')) { return false; }; return true;"&gt;
  
          &lt;h:outputText value="remove" /&gt;
  
      &lt;/p:commandLink&gt;
  
      &lt;h:outputText value="*" /&gt;
      &lt;h:outputText value="Image2: " /&gt;
      &lt;p:fileUpload id="cityImage2"
                    description="Image"
                    update="Image2 messages"
                    allowTypes="*.jpg;*.png;*.gif;*.jpeg;"
                    auto="true"
                    fileUploadListener="#{cityDetail.imageUpload}" &gt;
  
      &lt;/p:fileUpload&gt;
  
      &lt;p:graphicImage id="Image2"
                      value="#{cityDetail.imagePath}"
                      width="80"
                      height="50"
                      cache="false" &gt;
  
          &lt;f:event type="preRenderComponent" listener="#{cityDetail.putImage}" /&gt;
  
      &lt;/p:graphicImage&gt;
  
      &lt;p:commandLink update="Image2"
                     action="#{cityDetail.removeImage}"
                     style="color: #0d5b7f;text-decoration: underline"
                     onclick="if (!confirm('Are you sure, you want to delete the picture?')) { return false; }; return true;"&gt;
  
          &lt;h:outputText value="remove" /&gt;
  
      &lt;/p:commandLink&gt;
  .....
  </code></pre>
  
  <p>The problem is every thing is working fine if i use </p>
  
  <pre><code>onclick=""
  </code></pre>
  
  <p>But when I use </p>
  
  <pre><code>onclick="if (! confirm('Are you sure, you want to delete the picture?') ) { return false;}; return true; "
  </code></pre>
  
  <p>Then the remove not work. Why? Please tell me what I am doing wrong.</p>
  
  <p>I am using PrimeFaces 2.2</p>