You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by HBKTron <ma...@gmail.com> on 2008/01/24 23:26:38 UTC

Drawing error with Tapestry Dojo Dialog Component

Hi,

I'm having a drawing error while trying to learn how to use the Tapestry
Dialog component from Dojo.

http://tapestry.apache.org/tapestry4.1/components/dojo/dialog.html

Basically I have an initially hidden dialog box that I'd like to show after
a DirectLink component is clicked.  The dialog box appearing works fine, but
any content I put inside the box is drawn outside of it by browsers (tested
with Firefox 2.0.0.11 and Safari 3.0.4).  If I refresh the page manually,
then the dialog box content appears inside correctly.  I have read the above
link carefully, but still can't see what I'm doing wrong.  Ideally I'd like
to have something simple like the "Show Dialog" DirectLink in the
TimeTracker application.
http://opencomponentry.com:8080/timetracker/app

Below is my code, any help would be greatly appreciated thanks :)

NOTE: Although I wouldn't make the boolean that decides whether or not the
dialog is hidden a "HomePage" class attribute in practice, I did in this
example to simplify the code. Thanks again! 

Home.html
<html jwcid="@Shell" title="Basic AJAX Page">
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css"> .dialog { background-color: white; width: 400px;
height: 300px; } </style>
</head>

<body jwcid="@Body">

Show Dialog 

<div jwcid="testDialog@Dialog" hidden="ognl:dialogHidden"
style="display:none;">
    <p class="dialog">Sample dialog content</p>
</div>

</body>
</html>

HomePage.java
package pages;

import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.html.BasePage;

public abstract class HomePage extends BasePage {

	private boolean dialogHidden = true;
	
	public boolean getDialogHidden() {
		return dialogHidden;
	}
	
	public void setDialogHidden(boolean flag) {
		dialogHidden = flag;
	}
	
	public void onShowDialog(IRequestCycle cycle) {
		setDialogHidden(false);
	}
	
	public void onHideDialog(IRequestCycle cycle) {
		setDialogHidden(true);
	}

}
-- 
View this message in context: http://www.nabble.com/Drawing-error-with-Tapestry-Dojo-Dialog-Component-tp15076602p15076602.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org