I am attempting to use a WebDialogWindow in modal mode from a content page that is displayed inside of a splitter that is on a master page. To say it another way, I have a Master page. Contained in the Master page is a WebSplitter with two panes. Each pane of the splitter is a content pane for the Master page. I have a number of Content pages that provide text for the Content panes. Several of the Content pages include a WebDialogWindow that may be displayed. If the WebDialogWindow is displayed, it is always in modal mode.
This works "ok" except that the only area that is "modal" is the content pane that contains the WebDialogWindow -- the other content pane and any additional items on the Master page are not affected by the modal state and can still be selected. I know that if I define the WebDialogWindows as part of the Master page (outside of the splitter and content panes) that the modal attribute is applied to the entire page, just like I want. So it looks like I need to wire up the WebDialogWindows as part of the Master page.
Unfortunately, I can't just define the WebDialogWindows in the Master page... What I'm looking for is a way to copy/reparent/whatever the dialog definition at run time using Javascript from the Content page to the Master page and then show the Master page version. I played with this some and have the basics working, but I'm having trouble getting everything set up properly.
Any suggestions on how to make this work would be appreciated. Assume that I have a functioning WebDialogWindow along with buttons, text boxes, and event handlers (mostly client-side).
Thanks,
DaveL
It's been a while, but I wanted to let you know that your suggestion got me started in the direction that I needed. I've now got all of my WebDialogWindows from individual pages working as if they were part of the MasterPage, outside of the splitter.
Rather than using document.body as the destination, I actually set up an empty div and did the appendChild to it. When the WebDialogWindow closes, I reversed the copy so the element gets returned to its original location. This was to address having multiple WDW on a single asp.net page. I suspect that I could have left everything in the MasterPage div, but I have not tried it.
Thanks again,
Dave
Hi Dave,
If you do not use iframes (or Target/ContentUrl) or containers of dialog, then you may try to make initial state for dialog invisible, process initialize event, move html element of dialog to another parent like body and show dialog. Below is example.Note: similar action is beyond support and if that "move" will trigger negative side effect, then it should not be used.
<script type="text/javascript">function initDialog(dialog, evtArgs){ var elem = dialog.get_element(); elem.parentNode.removeChild(elem); document.body.appendChild(elem); dialog.show();}</script>
<div style="position:absolute;left:200px;top:200px;width:300px;height:300px;overflow:auto;background:cyan;"> <ig:WebDialogWindow ID="WebDialogWindow1" runat="server" Width="300px" Height="300px" Modal="true" WindowState="Hidden"> <ClientEvents Initialize="initDialog"></ClientEvents> </ig:WebDialogWindow></div>
<div style="position:absolute;left:300px;top:300px;width:300px;height:300px;overflow:auto;background:orange;"></div>
Hello Dave,
Indeed, what you describe is expected since the splitter panes host ASPX pages in each pane (in iframes) and modality of the window will not span outside its respective frame.
Copying/replicating WebDialogWindows from the content pane to the parent Master Page can be tricky and really depends on your scenario and what you are trying to achieve. It really depends on the specifics of the setup - but from what I see it should be made on the client-side with javascript, so maybe a good place to start is the client-side API references (CSOM) located here:
http://help.infragistics.com/NetAdvantage/NET/2008.3/CLR3.5/
and check out all properties/methods available client-side. For example, you can get the instance to the Pane you need and then use set_contentUrl to change the Url of the window dynamically using javascript. This property is documented here:
http://help.infragistics.com/Help/NetAdvantage/NET/2008.3/CLR3.5/html/WebDialogWindow~Infragistics.Web.UI.LayoutPane~contentUrl.html