弹出对话框未正确显示

时间:2016-04-06 19:49:07

标签: jsf oracle-adf

我有以下弹出窗口,里面有一个对话框:

<af:popup childCreation="immediate" id="p1" autoCancel="enabled" clientComponent="true">
                        <af:dialog id="d1" type="yesNo"
                                   dialogListener="#{patientModalityValidator.mydialog_listener}"
                                   cancelTextAndAccessKey="Cancel" title="Alert" closeIconVisible="false"
                                   shortDesc="ShortDesc" clientComponent="true"">
                            <af:outputText value="Are you sure?" id="myid"
                                           clientComponent="true"/>
                        </af:dialog>
                    </af:popup>

使用以下代码调用此弹出窗口:

RichPopup popup= (RichPopup)JSFUtils.findComponentInRoot("p1");
popup.show(new RichPopup.PopupHints());

问题是弹出窗口显示非常小(如5px宽和5px高),当我进入浏览器开发人员控制台时,我没有看到任何内部对话框内容。如果我将autoCancel设置为disabled,它可以正常工作,但如果用户在回答对话框之前关闭弹出窗口,我需要autoCancel来处理。我使用的是jdev11.1.2.4

更新:这是一个布局问题。这就是弹出窗口的html:

<div style="top:auto;right:auto;left:auto;bottom:auto;width:auto;height:auto;position:relative;" id="r1:0:pt:p1::content">
    <div id="r1:0:pt:d1" title="ShortDesc" class="af_dialog">
        <div class="af_dialog_inactive-background" _afrpanelwindowbackground="1" style="display: none;"></div>
        <div class="af_dialog_inactive-background" _afrpanelwindowbackground="1" style="display: none;"></div>
        <div class="af_dialog_inactive-background" _afrpanelwindowbackground="1" style="display: none;"></div>
        <div class="af_dialog_inactive-background" _afrpanelwindowbackground="1" style="display: none;"></div>
        <table cellpadding="0" cellspacing="0" border="0" summary="" class="af_dialog_main">
            <tbody>
                <tr>
                    <td class="p_AFResizable af_dialog_header-start" id="r1:0:pt:d1::_hse">&nbsp;</td>
                    <td class="p_AFResizable af_dialog_header" id="r1:0:pt:d1::_hce">
                        <table style="cursor:default" cellpadding="0" cellspacing="0" border="0" width="100%" summary="">
                            <tbody>
                                <tr>
                                    <td>
                                        <div id="r1:0:pt:d1::_ticn" class="af_dialog_icon-region" style="display:none"></div>
                                    </td>
                                    <td class="af_dialog_header-content-center" id="r1:0:pt:d1::tb" style="-webkit-user-select: none;">
                                        <div id="r1:0:pt:d1::_ttxt" class="af_dialog_title">Alert</div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                    <td class="p_AFResizable af_dialog_header-end" id="r1:0:pt:d1::_hee">&nbsp;</td>
                </tr>
                <tr>
                    <td class="p_AFResizable af_dialog_content-start" id="r1:0:pt:d1::_cse">&nbsp;</td>
                    <td class="p_AFResizable af_dialog_content" id="r1:0:pt:d1::contentContainer">
                        <div id="r1:0:pt:d1::_ccntr" class="af_dialog_content-center" style="width:250px;height:250px;position:relative;overflow:hidden;"><span id="r1:0:pt:pgl1" class="af_panelGroupLayout" style="position:absolute;width:auto;height:auto;top:0px;left:0px;bottom:0px;right:0px"><span id="r1:0:pt:myid">Are you sure?</span></span>
                        </div>
                    </td>
                    <td class="p_AFResizable af_dialog_content-end" id="r1:0:pt:d1::_cee">&nbsp;</td>
                </tr>
                <tr>
                    <td class="p_AFResizable af_dialog_footer-start" id="r1:0:pt:d1::_fse">
                        <div></div>
                    </td>
                    <td class="p_AFResizable af_dialog_footer" id="r1:0:pt:d1::_fce">
                        <table cellpadding="0" cellspacing="0" border="0" width="100%" summary="">
                            <tbody>
                                <tr>
                                    <td class="p_AFResizable af_dialog_footer-content" id="r1:0:pt:d1::_fcc">
                                        <button id="r1:0:pt:d1::yes" class="af_dialog_footer-button p_AFTextOnly" onclick="return false;" _afrpdo="yes">Yes</button>
                                        <button id="r1:0:pt:d1::no" class="af_dialog_footer-button p_AFTextOnly" onclick="return false;" _afrpdo="no">No</button>
                                    </td>
                                    <td align="left" valign="bottom">
                                        <div class="p_AFResizable af_dialog_resize-icon-region">
                                            <a tabindex="-1" class="af_dialog_resize-icon-style" id="r1:0:pt:d1::_ree" title="Resize"></a>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                    <td class="p_AFResizable af_dialog_footer-end" id="r1:0:pt:d1::_fee">
                        <div></div>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</div>

&#34;你确定&#34;文本和是/否按钮都在那里,但文本没有显示,尽管它在源代码中。

4 个答案:

答案 0 :(得分:0)

Try to add stretchChildren="first" attribute to your dialog

答案 1 :(得分:0)

您可以在af:outputText中添加af:panelGrouplayout,并在面板播放页面的顶部添加样式表。甚至你也可以添加inlineStyle,如下所示

 <af:panelGroupLayout layout="vertical"
                         inlineStyle="margin-top:5px">

     <af:outputText value="Are you sure?" id="myid"
                    clientComponent="true"/>
    </af:panelGroupLayout>

谢谢..

答案 2 :(得分:0)

您必须在af:对话框中指定'contentWidth'属性。 例如:

<af:popup id="submitPopUp">
    <af:dialog id="d1" type="ok"
               title="popup"
               contentWidth="400">
      <af:outputText value="text"
                     id="ot3"/>
    </af:dialog>
  </af:popup> 

答案 3 :(得分:0)

尝试使用此输出标签添加文字

<af:popup binding="#{backingBeanScope.backing_NewBankGurantee.p1}"
                                  id="p1">
    <af:dialog binding="#{backingBeanScope.backing_NewBankGurantee.d2}"
             id="d2" title="DECISION" contentWidth="250"
             contentHeight="100" type="none">
        <af:panelGroupLayout binding="#{backingBeanScope.backing_NewBankGurantee.pgl15}"
                             id="pgl15" layout="horizontal"
                             halign="center">
            <af:outputLabel value="Do you want to Amend this LG"
                              binding="#{backingBeanScope.backing_NewBankGurantee.ol1}"
                              id="ol1"/>
        </af:panelGroupLayout>
        <af:panelGroupLayout binding="#{backingBeanScope.backing_NewBankGurantee.pgl20}"
                             id="pgl20" layout="horizontal"
                             halign="center">
            <af:image binding="#{backingBeanScope.backing_NewBankGurantee.i1}"
                        id="i1" source="/download.jpg"/>
            <af:spacer width="10" height="10"
                     binding="#{backingBeanScope.backing_NewBankGurantee.s5}"
                     id="s5"/>
            <af:commandButton text="NO"
                            binding="#{backingBeanScope.backing_NewBankGurantee.cb4}"
                            id="cb4"/>
            <af:spacer width="10" height="10"
                     binding="#{backingBeanScope.backing_NewBankGurantee.s3}"
                     id="s3"/>
            <af:commandButton text="YES"
                            action="#{backingBeanScope.backing_NewBankGurantee.newactionamend}"
                            binding="#{backingBeanScope.backing_NewBankGurantee.cb5}"
                            id="cb5"/>
        </af:panelGroupLayout>
    </af:dialog>
</af:popup>