All,
I am using prototype windows ( http://prototype-window.xilinus.com/) for
creating a modal dialog window. I am declaring a div in the page with
style=display:none and then passing the div id to prototype window to
display the contents of the div tag in modal window. . Most of the time the
modal window shows up fine with right size specified and at the right place
- center because I use setContent(id,true,true). Once in a while the modal
window shows up very tiny in the center of the page. upon investigation the
height and width of this window is 0. I am using .99 version of this
windows.js. Has you seen this problems before? Any insight or any ideas
about how I should fix the problem. I appreciate your help on this. My code
is attached herewith.
Thanks,
Bashir
My code has two jsp files calling.jsp and script.jsp. When calling.jsp is
rendered, it calls modalDialog with id of div as a parameter and window gets
drawn nicely with the contents inside div. Sometimes widows gets drawn with
height 0 and width 0 and I don't know why? I can't hardcode height and width
of wondow because script.jsp is used by many modules. Why is it that window
gets drawn with height 0 and width 0 sometimes while as most of time height
and width is of right size?
------------------------------------------------------------------
calling.jsp
-------------------------------------------------------------------
<[EMAIL PROTECTED] file="script.jsp"%>
<f:subview id="mysubview">
<t:div id="outer-div" forceId="true" style="display:none">
<h:form id="myform">
<h:panelGrid columns="1"
cellpadding="0"
cellspacing="0">
</h:panelGrid>
// lot of JSP code here that gets rendered in modal window
</t:div>
</f:subview>
<t:div id="xyz" forceId="true" style="display:none">
<f:verbatim>
<script type="text/javascript" defer="defer">
if (self.modalDialog)
{
modalDialog('outer-div','name');
}
else
{
alert("Error: modalDialog not defined");
}
</script>
</f:verbatim>
</t:div>
-------------------------------------------------------------------
-------------------------------------------------------------------
script.jsp
-------------------------------------------------------------------
<script type="text/javascript">
var win1 = null;
function modalDialog(id,titleStr) {
if (!win1) {
win1 = new Window('modalDialog', {
className: "alphacube",
closable : false,
maximizable : false,
top:206,
left:147,
hideEffect:Element.hide,
showEffect:Element.show,
wiredDrag : true
});
win1.setContent(id,true,true);
}
else
{
alert("problem win is not null");
}
win1.setDestroyOnClose();
win1.toFront();
win1.showCenter(true);
}
</script>
---------------------------------------------------------------------
_________________________________________________________________
Invite your Hotmail contacts to join your friends list with Windows Live
Spaces
http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
_______________________________________________
Javawin mailing list
[email protected]
http://mail.xilinus.com/mailman/listinfo/javawin_xilinus.com