calling bean method on image onClick event
===

I have image and would like to call a method that is store in bean. I was thinking of 

    <h:graphicImage value="DisplayImage?id=1&amp;stuff=photo&amp;mainID=main" 
     onclick="
              alert('clicked me 1');
              #{PersonalInformationDataBean.doSaveImage()};
              alert('clicked me 2');
             " styleClass="modal"/>

I was expecting `#{PersonalInformationDataBean.doSaveImage()};` to work, however this is not working. I am only getting alert as `clicked me 1`

Any idea how to get this done?