0

私はこのようなものが欲しいです。

<h:commandButton value="Submit" onclick="ex.show()"></h:commandButton>


<p:dialog id="dialog1"  widgetVar="ex">
   <h:output Text value="Hi"/>
</p:dialog>

これにより、p:dialog 内に hi テキストを含むポップアップが開きます。しかし、そのポップアップで URL を開く必要があります。どうすればアプローチできますか?

4

1 に答える 1

2

iframeダイアログ内に配置できます

このような :

<h:form prependId="false">
<h:commandButton value="Submit" onclick="ex.show(); return false;"></h:commandButton>

<p:dialog id="dialog1"  widgetVar="ex"  onHide="jQuery('#someId').hide();" onShow="jQuery('#someId').show();">
    <iframe frameborder="0" align="left"
         src="http://www.primefaces.org"
         name="someName" id="someId" scrolling="auto" width="750"
         height="500" marginheight="5" marginwidth="10">
     </iframe>
</p:dialog>

</h:form>

2番目のオプションはp:lightBox iframe="true"、ダイアログ内に配置し、ダイアログを開いているときに次のように開くことです。

<h:form prependId="false">
    <h:commandButton value="Submit" onclick="ex.show(); return false;"></h:commandButton>

    <p:dialog id="dialog1"  widgetVar="ex" onShow="openLink()">
        <p:lightBox iframe="true">  
            <h:outputLink id="mylink" value="http://www.primefaces.org">  
            </h:outputLink>  
        </p:lightBox>  
    </p:dialog>
    <script>
        function openLink(){
            setTimeout("jQuery('#mylink').click();", 50);
        }
    </script>
</h:form>
于 2012-11-28T07:21:09.030 に答える