4 Replies Latest reply on Jun 19, 2007 3:24 AM by Mihai Anescu

    Question: how to make confirmation box work with h:commandLi

    Mihai Anescu Newbie


      !!!Possible bug???

      I have a "delete" button, and I want to make a "confirmation" box, so that the user can be sure he want's to delete the entity.

      I have stumbled upon some sort of bugs:

      The code is this:

      <s:link styleClass="welcome"
       id="fakeDelete" rendered="#{abcHome.managed}"
       <h:graphicImage value="img/delete.png" height="16" width="16"
      <h:commandLink id="delete" action="#{abcHome.remove}" style="display:none">
      function deleteConfirm()
       var answer = confirm( "Do you want to delete this entity?" );
       if( answer )
       alert( 'delete!' );
       var btn = document.getElementById( "abc:delete" );
       alert( btn );

      Now, I am on the AbcEdit page, and I have in the AbcEdit.page.xml this part:
      <navigation from-action="#{abcHome.remove}">
       <redirect view-id="/AbcList.xhtml"/>

      Before I made the modification, and used the normal button to do the delete, after I deleted one entity I was returned to the entity List. Now, 2 things happen.
      If I leave the code as above, I still remain on the AbcEdit page. If I add this part to the fakeButton:

      then it goes to the AbcList, but it will go there always, even if the user doesn't click on Ok, but on Cancel. So this I think is a bug from the Seam framework???

      Any way, my question is if anybody has done this sort of thing with Seam?
      PS: I also tried this solution here, which doesn't work.