the easiest way is to do it like that:

function myConfirmation(question){
        if (confirm(question))
                return true;
        return false;
}

<h:commandButton action="#{bean.deletesth}" value="blah" onclick="return myConfirmation('sure?')" />


confirm(string) is standard JS function that displays dialog box-u must know that box...


returning false will cancel submit propagation.
/*********
Heath - i knew that but i didnt realize that i can use that fact in my problem:P.
im so lame:/


Big thanks AGAIN Heath!
************/


BUT

i u really must do it with special popu window...

u can make on parent page the commandbutton with action that deletes sth. u can hide it by css. u can give id to that button.

form your popup window u can click that button:
window.opener.document.getElementById('formID:delButtonId').click();

slawek

<[EMAIL PROTECTED]> napisał:

I have a delete button on my screen and I would like
to popup a confirmation window to the user and confirm
that the deletion should take place.

I need to the popup window to capture the answer to
the question and then control to pass back to the
parent window to process the delete based on the
answer.

How can I do that in JSF.  I know how to set the
answer back on the parent window using Javascript and
I know how to submit a form from Javascript.  But how
do I tell what action to execute when submitting a
form from Javascript?

Thanks,
Rob Breidecker


__________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/





Reply via email to