Hi,

I'm trying to access the window that open's my dialog using Javascript
with window.opener, but this reference is null. What I'm trying to do
is the following:

1. User selects items in a table on main page
2. User clicks button which opens dialog page containing a print view
of the items
3. User closes the dialog page, once a javascript confirm passes, the
main page submits to the backing bean which performs some processing,
and the main page is then reloaded with the updated items

1 and 2 is fine, I have that working, its step 3 that I am having
trouble with... it doesn't seem possible with the Trinidad Dialog
Framework (maybe by design).

Maybe some more clarification:

========
main page:
========
...
<script type="text/javascript">
function callBack() {
  alert('called');
  if (confirm('Proceed')) {
    // submit page to allow backing bean to process items
  }
}
</script>
...
  <tr:commandButton id="printButtonId"
                    styleClass="button"
                    text="Process"
                    action="dialog:print"
                    partialSubmit="true"
                    useWindow="true"
                    windowWidth="700"
                    windowHeight="500"
          />
...

=====
dialog
=====
...
<head>
<script>
function doOnunload() {
  alert('doOnunload');
  window.opener.callBack();
}
</script>
</head>
<f:view>
<body onunload="doOnunload();">
...

---------------------------

The alert('doOnunload') popup shows fine, so the javascript is being
run, the problem is that window.opener is null. Anyone have any ideas
how I can get my desired outcome? I hope I'm not being too vague.

Thanks in advance,

James Barrow

Reply via email to