【问题标题】:how to move rich modal panel如何移动富模态面板
【发布时间】:2012-11-18 06:22:08
【问题描述】:

我无法移动模态面板。
尽管我使用的是可移动的="true" 属性。 我在该模式面板中包含了一个 jsp 页面。

main.jsp

<f:view>
   <html>
     <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     </head>
     <body>
        <h:form id="modalPanelForm">
                <a4j:outputPanel id="outputPanel">
                        <a4j:commandButton value="Show Modal Panel" onclick="#{rich:component('modalPanel')}.show();"/>
                </a4j:outputPanel> 
        </h:form> 
                 <rich:modalPanel id="modalPanel" moveable="true">
                       <f:subview id="jobSchedulerSubView">
                            <jsp:include page="test1.jsp" flush="true"/>
                       </f:subview> 
                 </rich:modalPanel> 

</body></html></f:view>

test1.jsp

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
  <f:verbatim>
     <html>
        <head>
           <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        </head>
        <body>
  </f:verbatim>
           <h:form id="testForm"> 
               <rich:panel id="testRichPanel"> 
                  <f:facet name="header">
                      <h:outputText value="SecondModalpanel"/>
                  </f:facet> 

                     <a4j:outputPanel id="testOutputPanel">
                          <a4j:commandButton value="Close Modal Panel" 
                                      onclick="#{rich:component('modalPanel')}.hide();"
                                      reRender="modalPanel"/>
                     </a4j:outputPanel> 
               </rich:panel>
</h:form>

<f:verbatim></body></html><f:verbatim>

我有很多页面,例如 first.jsp、second.jsp、third.jsp、fourth.jsp 等......
每个页面都有模态面板,每个模态面板都包含“test1.jsp”页面。
这就是我喜欢使用的原因

<rich:modalpanel ....>             
      <f:subview ....>
          <jsp:include page="test1.jsp" .../> 
      </f:subview>         
</rich:modalpanel>

帮帮我。 提前致谢。

【问题讨论】:

    标签: richfaces move modalpopup


    【解决方案1】:

    将标题facet 添加到您的modalPanel。 moveable属性的默认值为true,无需手动设置为true。

    <rich:modalPanel id="modalPanel">
       <f:facet name="header"> 
         <h:panelGroup>
           <h:outputText value="PO-Select Supplier"></h:outputText>
         </h:panelGroup>
       </f:facet>
      ...more.............
    </rich:modalPanel>
    

    【讨论】:

    • 感谢 prageeth。现在我更新我的问题。我有很多页面(例如 100 页)。每个页面都有 modalpanel 并包含“test1.jsp”页面。根据您的想法,我需要将 标记放在每个页面的每个模式面板中。重复代码写入更多页面。将来,我决定更改模式面板标题,那时我需要在 100 页中修改标题名称。这项工作需要更多时间。我希望你能给出一些其他的想法
    • 尝试在test1.jsp 页面中添加&lt;f:facet name="header"&gt; 部分,而不是在&lt;rich:modalPanel&gt; 标记中。
    • 如果我把那个 部分放在 test1.jsp 页面中,那么我不能移动模态面板。这是我原来的问题。
    • 我认为这个问题超出了我的认知。我没有使用&lt;jsp:include&gt; 标签。但是我使用&lt;ui:include&gt; 没有任何问题,而&lt;f:facet name="header"&gt; 标签在页面内(而不是&lt;rich:modalPanel&gt; 标签)。你不能使用&lt;ui:include&gt;标签吗?命名空间是xmlns:ui="http://java.sun.com/jsf/facelets"
    • 感谢您的回复。我没有在我的应用程序中使用 facelet。
    猜你喜欢
    • 2011-05-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-04
    • 2013-07-30
    相关资源
    最近更新 更多