如何将丰富的模式面板

问题描述:

我不能移动模式面板。
尽管我使用的是移动=“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> 

帮助我。 在此先感谢。

将标题facet添加到您的modalPanelmoveable属性的默认值是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> 
+0

Thanks prageeth。现在我更新我的问题。我有这么多页面(例如100页)。每个页面都有模态面板并包含“test1.jsp”页面。根据你的想法,我需要在每个页面的每个模式面板中放置标签。复制代码写入更多页面。将来,我决定更改模态面板标题,那时我需要修改100页中的标题名称。这项工作将需要更多时间。我希望你能给一些其他的想法 – Eswar

+0

尝试添加''部分'test1.jsp'页内,而不是内部的''标签。 – prageeth

+0

如果我把那个部分放在test1.jsp页面里,那么我不能移动模态面板。那是我原来的问题。 – Eswar