-
1. Re: modalPanel as confirm dialog
eicki May 30, 2008 6:50 PM (in response to bostone)try onsubmit as oncomplete is called when the ajax request comes back.
-
2. Re: modalPanel as confirm dialog
bostone May 30, 2008 8:06 PM (in response to bostone)"eicki" wrote:
try onsubmit as oncomplete is called when the ajax request comes back.
Sorry I didn't mention it - that's how I started, with onsubmit. Problem with that is - the JS code gets stuffed after the AJAX.Submit so it has no effect -
3. Re: modalPanel as confirm dialog
nbelaevski May 31, 2008 6:57 AM (in response to bostone)Hello,
onsubmit is primarily used for invisible components, such as a4j:support, and a4j:commandButton doesn't have onsubmit attribute. Use onclick instead. -
4. Re: modalPanel as confirm dialog
rhancke Jun 2, 2008 9:05 AM (in response to bostone)bostone,
Have you already read this solution?
http://wiki.jboss.org/wiki/RichFacesConfirmationOnClick"bostone" wrote:
I need to display delete confirmation pop-up when user clicks "Delete" button. I would like to use modalPanel for that purpose but I even stuck with regular JS prompt. Here's what I'm trying and it's not working<a4j:commandButton id="deleteDevice" value="Delete Device" rendered="false" oncomplete="if(!window.confirm('Are you sure?'){return false}" actionListener="#{deviceMasterFormBean.deleteDevice}" reRender="deviceTabs,updateControls"/>
Basically I need to display confirmation and if user confirms to arrive to my actionListener method. Can someone share a quick example? -
5. Re: modalPanel as confirm dialog
bostone Jun 2, 2008 12:23 PM (in response to bostone)Thanks guys - the trick was to use "onclick". Now I need to figure out how to hook-up modalPanel into it but that should be relatively easy
-
6. Re: modalPanel as confirm dialog
eicki Jun 2, 2008 12:43 PM (in response to bostone)Can you post your solution than, if you managed to integrate modal panel. I doubt that this is as easy as one might think.
Problem is that you must at first cancel submitting the form, then open the modal panel and submit the original button if the user presses ok in the modal panel. -
7. Re: modalPanel as confirm dialog
jhaley May 14, 2009 8:43 AM (in response to bostone)I also have an interest in this solution. In regard to eicki's last comment, I am able to cancel the submitting form and open the modalPanel, but I can't figure out how to re-submit the original action. I have multiple action that will trigger this, so I'm not clear on what action triggered the modal confirm. Is there a way to pull this from facesContext?
-
8. Re: modalPanel as confirm dialog
nbelaevski May 14, 2009 11:04 AM (in response to bostone)Hi,
Please take a look: http://www.jsfone.com/blog/max_katz/2008/11/richfaces_confirmation_dialog.html -
9. Re: modalPanel as confirm dialog
dobreden1 May 14, 2009 11:28 AM (in response to bostone)Max Katz's solution doesn't work as the facelets component will not accept a binding EL Expression (a common requirement of commandbuttons).
-
10. Re: modalPanel as confirm dialog
jhaley May 14, 2009 11:57 AM (in response to bostone)I don't think this will work. I have multiple commandButtons and panelMenu actions on my page. When I intercept with my confirm modal, I don't know what action was clicked. My confirm modal will exist on a couple dozen pages so I was hoping to pull the action that triggered the modal from facesContext, or have the modalPanel have return type like the window.confirm()
-
11. Re: modalPanel as confirm dialog
max.katz May 14, 2009 3:27 PM (in response to bostone)"dobreden1" wrote:
Max Katz's solution doesn't work as the facelets component will not accept a binding EL Expression (a common requirement of commandbuttons).
What kind of EL do you need to pass? See comment from November 19th, 2008, maybe that will help: http://mkblog.exadel.com/ria/richfaces-confirmation-dialog-3/
Max
http://mkblog.exadel.com -
12. Re: modalPanel as confirm dialog
jhaley May 15, 2009 1:46 PM (in response to bostone)I'm not sure if EL will do what I need. I trying to resume or find the action launched at the time the modal confirm was clicked.