You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by prashanth2 <mu...@gmail.com> on 2008/08/12 21:58:55 UTC

DOJO Dialog Problem? Please help me

Hi,
I am using s2 2.0.11 version, I am able to display the dojo dialog, but the
contents that supposed to appear on the dialog are appearing on the jsp that
iam calling from. I tried many possible ways but endup writing this question
here.
Well I have one more question, instead of displaying a div tag in the dojo
dialog, is there a way to call the server and pass some variables, and based
on the variables i would like to display some content on the dialog in a new
jsp. 
Please find the attached output, you can find "name-text box", that actually
should appear on the Dialog.And also please help me in passing some
variables to the dialog, so that i can display a new jsp based on the server
response. http://www.nabble.com/file/p18951580/Doj-Dialog.JPG Doj-Dialog.JPG 
Here is my jsp as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<title>Dojo: Hello World!</title>
<script type="text/javascript" src="<s:url
value='/js/thickBox/jquery.js'/>"></script>
<script type="text/javascript" src="<s:url
value='/js/thickBox/thickbox-compressed.js'/>"></script>

<link href="<s:url value='/theme/main.css'/>" rel="stylesheet"
type="text/css"/>
<link rel="stylesheet" href="<s:url value='/theme/thickbox.css'/>"
type="text/css" media="screen" />
<link
	href="<s:url value='/js/dojo-1.1.1/dijit/themes/tundra/tundra.css'/>"
	rel="stylesheet" type="text/css" />
<link href="<s:url value='/js/dojo-1.1.1/dojo/resources/dojo.css'/>"
	rel="stylesheet" type="text/css" />
<!-- SECTION 1 -->

<script type="text/javascript" src="js/dojo-1.1.1/dojo/dojo.js"
	djConfig="parseOnLoad: true"></script>
<script type="text/javascript">
       // Load Dojo's code relating to the Button widget
       dojo.require("dojo.parser");
       dojo.require("dijit.form.Button");
       dojo.require("dijit.Dialog");
       dojo.require("dijit.form.TextBox");
    </script>

</head>
<body class="tundra">
<s:form action="detailedInfo" method="post">
	<s:actionerror/>
	<s:fielderror/>
	<button dojoType="dijit.form.Button"
onclick="dijit.byId('dialog1').show()">Show Dialog</button>

	<div dojoType="dijit.Dialog" id="dialog1" title="First Dialog"
		 onfocus="console.log('user focus handler')"
		 onblur="console.log('user blur handler')"
		 execute="alert('submitted w/args:\n' + dojo.toJson(arguments[0],
true));">
		<table>
			<tr>
				<td><label for="name">Name: </label></td>
				<td><input dojoType=dijit.form.TextBox type="text" name="name"
id="name"></td>
			</tr>
		</table>
	</div>


</s:form>
</body>
</html>
-- 
View this message in context: http://www.nabble.com/DOJO-Dialog-Problem--Please-help-me-tp18951580p18951580.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: DOJO Dialog Problem? Please help me

Posted by Dustin Pearce <du...@yahoo.com>.
It sounds like you want your iFrame to put up a modal? dialog on the  
page that contains the iframe?  This can be difficult if the pages are  
served from different servers.  You are getting into cross-site  
scripting issues.  If I remember there are ways to sign or secure  
scripts these days so you can "trust" a script from a frame like  
that.  I am sure the dojo list has a lot of experts who know that  
pattern in detail.

-D


On Aug 19, 2008, at 6:04 AM, prashanth2 wrote:

>
> I would like to know how and if it is possible to call a dialog box  
> from a
> iframe? Or have the dialog box pop out from an iframe? and how can i  
> pass
> variables from dialog box to my struts action class, if so how to  
> retrieve
> them in my action, do i need to get the values using  
> "httpservletrequest"?
> inbuilt dojo0.4 with s2 is not supportive, so i started using  
> dojo1.1.1. Is
> this helpful. Your comments, questions anything would be appreciated?
>
> Thanks
> Prashanth
> -- 
> View this message in context: http://www.nabble.com/DOJO-Dialog-Problem--Please-help-me-tp18951580p19048300.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: DOJO Dialog Problem? Please help me

Posted by Dave Newton <ne...@yahoo.com>.
--- On Tue, 8/19/08, prashanth2 <mu...@gmail.com> wrote:
> I would like to know how and if it is possible to call a
> dialog box from a iframe? Or have the dialog box pop out 
> from an iframe? and how can i pass variables from dialog 
> box to my struts action class, if so how to retrieve
> them in my action, do i need to get the values using
> "httpservletrequest"? inbuilt dojo0.4 with s2 is not 
> supportive, so i started using dojo1.1.1. Is this 
> helpful. Your comments, questions anything would be
> appreciated?

All but one of your questions would be better asked on a Dojo or HTML forum or mailing list.

> [...] and how can i pass variables from dialog 
> box to my struts action class, if so how to retrieve
> them in my action, do i need to get the values using
> "httpservletrequest"?

You "pass them" by making an HTTP request to your Struts application. You access them in your application the same way as any other request parameters, generally by creating action properties with the same name as the request parameters. The Struts documentation, the showcase app, various online tutorials, and several books all cover this.

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: DOJO Dialog Problem? Please help me

Posted by prashanth2 <mu...@gmail.com>.
I would like to know how and if it is possible to call a dialog box from a
iframe? Or have the dialog box pop out from an iframe? and how can i pass
variables from dialog box to my struts action class, if so how to retrieve
them in my action, do i need to get the values using "httpservletrequest"?
inbuilt dojo0.4 with s2 is not supportive, so i started using dojo1.1.1. Is
this helpful. Your comments, questions anything would be appreciated?

Thanks
Prashanth
-- 
View this message in context: http://www.nabble.com/DOJO-Dialog-Problem--Please-help-me-tp18951580p19048300.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org