How to pass parameters to sj:dialog?

203 views
Skip to first unread message

Gilbert

unread,
Jan 5, 2011, 8:58:25 AM1/5/11
to struts2-jquery
Hi

I am using the sj:dialog to open a modal confirmation screen when a
user selects an item for deletion. However I need to pass the id of
the item so that a) The message in the dialog says "Are you sure that
you want to delete item XYZ" and b) I can pass it to the function
attached to the OK button so my action knows which item to delete.

How do I pass parameters to the dialog widget?

<script type="text/javascript>
function doDelete(itemId) {
$('#confirm_delete').dialog('open');
}

function cancelButton() {
$('#confirm_delete').dialog('close');
}

function continueButton() {
????????
}
</script>


<sj:dialog id="confirm_delete"
title="Confirm Delete"
autoOpen="false"
modal="true"
width="400"
buttons="{
'Continue':function() {continueButton();},
'Cancel':function() {cancelButton();}
}"
>
Do you really want to delete user xyz?
</sj:dialog>

Yuping Jin

unread,
Jan 8, 2011, 8:24:54 AM1/8/11
to struts2...@googlegroups.com
One way is to set the Id in the dialog before opening it. This can be done in the onClick handler of the link/button to open the dialog for the item.

Yuping Jin

Gilbert

unread,
Jan 10, 2011, 10:35:09 AM1/10/11
to struts2-jquery
Any chance of a code example, as I'm not sure that I understood your
reply?

Regards

Muneer Malik

unread,
Mar 2, 2011, 11:22:57 PM3/2/11
to struts2...@googlegroups.com
Did you ever get this working ?
I need an example as well

Thanks

> --
> You received this message because you are subscribed to the Google Groups "struts2-jquery" group.
> To post to this group, send email to struts2...@googlegroups.com.
> To unsubscribe from this group, send email to struts2-jquer...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/struts2-jquery?hl=en.
>
>

--
Confidentiality Notice
-------------------------------


THIS INFORMATION IS INTENDED ONLY FOR THE USE OF THE ADDRESSEE AND MAY
CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM
DISCLOSURE UNDER APPLICABLE LAW. IF YOU ARE NOT THE INTENDED
RECIPIENT, OR THE EMPLOYEE OR AGENT RESPONSIBLE FOR DELIVERING THIS
MESSAGE TO THE INTENDED RECIPIENT, YOU ARE HEREBY NOTIFIED THAT ANY
DISSEMINATION, DISTRIBUTION OR COPYING OF THE COMMUNICATION IS
STRICTLY PROHIBITED. IF YOU HAVE RECEIVED THIS COMMUNICATION IN
ERROR, PLEASE NOTIFY IMMEDIATELY AT tutt...@gmail.com OR BY TELEPHONE
AT 817-458-1764.


THANK YOU.

Reply all
Reply to author
Forward
0 new messages