Modal Dialog, Form and Closure

525 views
Skip to first unread message

Gilbert

unread,
Jun 11, 2010, 5:30:24 AM6/11/10
to struts2-jquery
Hi

I'm using the Struts 2 jquery modal dialog and putting a standard
struts form inside it. The form is displayed and posts to my action as
expected. However the user is still able to dismiss the form by
closing the dialog with the X in the top right hand corner. How do I
switch this off - as I need to force the user to react to the form?

Regards

Weles Siqueira

unread,
Jun 11, 2010, 2:45:59 PM6/11/10
to struts2...@googlegroups.com
Hi Gilbert!

I am using the modal form too. I don't have the answer that you need. But i would like ask you. Please
how i do save my form and send it for my action?

Thank you!

2010/6/11 Gilbert <roger....@googlemail.com>

--
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.




--
Weles Saggiorato Siqueira
Analista de Sistemas
(11) 8574-0333

Gilbert

unread,
Jun 14, 2010, 2:07:28 AM6/14/10
to struts2-jquery
Weles,

Just put your struts form inside the <sj:dialog tags>. Then just
process your form in your action just as you would normally. I've
posted an example below - hope that this helps.

Regards

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<head><sj:head/></head>

<sj:dialog
id="mymodaldialog"
modal="true"
overlayColor="#903"
overlayOpacity="0.8"
title="Model Dialog and Form"
position="['right','top']"
>
<img id="indicator" src="images/indicator.gif"
alt="Loading..."/>
<s:form action="set-vin" method="post" theme="simple">
<label for="name">First Name</label>
<s:textfield name="name" value="%{firstName}"/>
<s:submit type="button" label="Continue"/>
</s:form>
</sj:dialog>


On Jun 11, 9:45 pm, Weles Siqueira <kwe...@gmail.com> wrote:
> Hi Gilbert!
>
> I am using the modal form too. I don't have the answer that you need. But i
> would like ask you. Please
> how i do save my form and send it for my action?
>
> Thank you!
>
> 2010/6/11 Gilbert <roger.var...@googlemail.com>
>
>
>
> > Hi
>
> > I'm using the Struts 2 jquery modal dialog and putting a standard
> > struts form inside it. The form is displayed and posts to my action as
> > expected. However the user is still able to dismiss the form by
> > closing the dialog with the X in the top right hand corner. How do I
> > switch this off - as I need to force the user to react to the form?
>
> > Regards
>
> > --
> > 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<struts2-jquery%2Bunsu...@googlegroups.com>
> > .

Gilbert

unread,
Jun 15, 2010, 6:32:13 AM6/15/10
to struts2-jquery
Anyone? I know it's possible because the JQuery UI Demo site shows an
example of a modal form without the X in the top left hand corner, I
just can't work out how to do it with the plugin. None of the
properties seem appropriate - or is this functionality missing. If so,
how do I request it?

Regards

jogep

unread,
Jun 15, 2010, 6:52:19 AM6/15/10
to struts2-jquery
which example is it? I can't see it.

Currently I don't see an option for this Issue.
But maybe you can use a css solution.

.ui-dialog-titlebar .ui-icon {
display : none;
}

I hope this work.

Best Regards

Johannes Geppert

---
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

Gilbert

unread,
Jun 15, 2010, 11:10:30 AM6/15/10
to struts2-jquery
It's at http://jqueryui.com/demos/dialog/#modal-form. I'll try your
css solution, but it would be nice to have it as an attribute.

Regards

jogep

unread,
Jun 15, 2010, 11:39:39 AM6/15/10
to struts2-jquery
hmmm, the jQuery UI example has also an X in the top right corner
when I try it out.

Best Regards

Johannes Geppert

---
web: http://www.jgeppert.com
twitter: http://twitter.com/jogep

On 15 Jun., 17:10, Gilbert <roger.var...@googlemail.com> wrote:
> It's athttp://jqueryui.com/demos/dialog/#modal-form. I'll try your
Reply all
Reply to author
Forward
0 new messages