open dialog with window.showModalDialog i n ops

classic Classic list List threaded Threaded
2 messages Options
hcr
Reply | Threaded
Open this post in threaded view
|

open dialog with window.showModalDialog i n ops

hcr
Hi,
    I want to use 'window.showModalDialog' to opening a model dialog, then I have a problem: How can I pass xforms instance between 'main page' and 'dialog page'?
    This is like xxforms:dialog, but this method have a problem: the main page and dialog page is in same page, so the page is more big, so I want to use 'window.showModalDialog'.
    The Main page is like that:
<head> 
 <xforms:model>
  <xforms:instance id=”init”></xforms:instance>
  <xforms:instance id=”result”></xforms:instance>
  <xxfroms:dialog-submission id=”dialog1”
    ref=”instance(‘init’)/ data”
    replace=”instance”
    instance=”instance(‘result’)/data”
    action=”/dialog”/>
 </xforms:model>
</head>
<body>
 <xforms:trigger>
  <xforms:label>Show Dialog</xforms:label>
  <xforms:action ev:event=”DOMActitive”>
   <xxforms:xx-dialog type="modal-dialog"  dialog-submission=”dialog1”/>
  </xforms:action>
 </xforms:trigger>
</body>
 
 
 The Dialog Page is like that:
<head> 
 <xforms:model>
  <xforms:instance id=”dialog-instance”></xforms:instance>
 </xforms:model>
</head>
<body>
 <xforms:trigger>
  <xforms:label>Close Dialog</xforms:label>
  <xforms:action ev:event=”DOMActitive”>
   <xxforms:script>
    window.result = xxforms:instance(‘dialog-instance’);
    window.close();
   </xxforms:script>
  </xforms:action>
 </xforms:trigger>
</body> 
 
 
 
 







你 邮 箱 里 居 然 有 积 分 , 这 你 知 道 吗 ?
邮 箱 积 分 居 然 能 换 20 元 钱 , 这 你 也 知 道 吗 ? 点 此 兑 换 20 元 >>

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: open dialog with window.showModalDialog i n ops

Erik Bruchez
Administrator
See a related post here:

  http://mail-archive.objectweb.org/ops-users/2006-11/msg00066.html

Obviously you can't use what you have here:

  <xxforms:xx-dialog type="modal-dialog"
                     dialog-submission="dialog1"/>

There is no such thing in Orbeon Forms at the moment. If you want to
do something like this, you will have to use JavaScript. You can use
the xxforms:script action to run script, e.g.:

  <xxforms:script>
    doSomethingInJavaScript();
    window.showModalDialog();
  </xxforms:script>

Note that window.showModalDialog() is completely different from the
current implementation of xxforms:dialog. The former in fact opens a
new browser window (albeit modal), and the latter just shows a new
part of the HTML page, in the same HTML DOM, which was previously
hidden. So xxforms:dialog currently does not suffer from the issue of
sharing information with the calling page, since it is running in fact
in the same page.

-Erik

> Hi,
>     I want to use 'window.showModalDialog' to opening a model dialog,
> then I have a problem: How can I pass xforms instance between 'main
> page' and 'dialog page'?
>     This is like xxforms:dialog, but this method have a problem: the
> main page and dialog page is in same page, so the page is more big, so I
> want to use 'window.showModalDialog'.
>     The Main page is like that:
> <head>
>  <xforms:model>
>   <xforms:instance id="init"></xforms:instance>
>   <xforms:instance id="result"></xforms:instance>
>   <xxfroms:dialog-submission id="dialog1"
>     ref="instance('init')/ data"
>     replace="instance"
>     instance="instance('result')/data"
>     action="/dialog"/>
>  </xforms:model>
> </head>
> <body>
>  <xforms:trigger>
>   <xforms:label>Show Dialog</xforms:label>
>   <xforms:action ev:event="DOMActitive">
>    <xxforms:xx-dialog type="modal-dialog"  dialog-submission="dialog1"/>
>   </xforms:action>
>  </xforms:trigger>
> </body>
>
>
>  The Dialog Page is like that:
> <head>
>  <xforms:model>
>   <xforms:instance id="dialog-instance"></xforms:instance>
>  </xforms:model>
> </head>
> <body>
>  <xforms:trigger>
>   <xforms:label>Close Dialog</xforms:label>
>   <xforms:action ev:event="DOMActitive">
>    <xxforms:script>
>     window.result = xxforms:instance('dialog-instance');
>     window.close();
>    </xxforms:script>
>   </xforms:action>
>  </xforms:trigger>
> </body>
--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws