3 Replies Latest reply on Sep 30, 2009 4:46 AM by Ilya Shaikovsky

    Confirmation Dialog Problem

    Justin G Newbie

      I have a web application that uses confirmation dialogs on several commandButton's using the following convention:

      onclick="if(!confirm('Are you sure?')) return false;"


      However, I now need to dynamically set the text of the confirmation dialog based on the state of some backing bean. I thought this would be possible by doing something like this:
      <a4j:commandButton value="Submit" id="submitButton"
       action="#{myBean.submitAction}"
       data="#{myBean.confirmationText}"
       onclick="if (!confirm(data)) return false;"/>
      

      This doesn't work the way I expect and firebug tells me that "data is not defined". Is there any way to accomplish this using confirm()?

      Thanks.

      justin