Include de Paginas Usando JSF

3 respostas
lblanco

Bom dia Amigos,

Tenho as seguintes paginas em JSP.

Pagina 1:

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="r" uri="http://richfaces.ajax4jsf.org/rich"%>
<%@taglib prefix="a" uri="http://richfaces.org/a4j"%>

<f:view>  
    <html>
        <head>
            <title><h:outputText value="#{bundle.textUsPedra}"/></title>
        </head>
        <body>
            <h:form>
                <h:panelGrid width="100%">
                    <r:tabPanel id="tabPane1">
                        <r:tab id="tab1"                        
                               label="#{bundle.textColhedora}"
                               ajaxSingle="true">
                         
                         
                         <f:subview id="colhedoraView">
                             /*
                              * GOSTARIA DE INCLUIR A PAGINA 2 AQUI.
                              * POREM TODAS AS MINHAS TENTATIVAS CAUSARAM ERRO.
                              */
                         </f:subview>
                         
                            
                        </r:tab>
                         ......

Pagina 2:

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib prefix="r" uri="http://richfaces.ajax4jsf.org/rich"%>

<f:view>  
    <html>
        <head>
            <title><h:outputText value="#{bundle.textUsPedra}"/></title>
        </head>
        <body>
            <h:form id="FormColhedora">
                <h:panelGrid width="100%">
                    <r:dataTable value="#{plantioWebController.caPlantioGprsCtrList}" 
                                 var="grid"
                                 id="grid"
                                 rows="8"
                                 onRowMouseOver="this.style.backgroundColor='#F1F1F1'"
                                 onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
                        
                        
                        <r:column sortBy="#{grid.idapontamento}">
                            <f:facet name="header">
                                <h:outputText value="#{bundle.textId}"/>
                            </f:facet>
                            <h:outputText value="#{grid.idapontamento}"/>
                        </r:column>  
                        
                    </r:dataTable>
                    <br>
                    <r:datascroller for="grid" maxPages="5"/> 
                </h:panelGrid>
            </h:form>
        </body>
    </html>
</f:view>

Gostaria de efetuar o include da pagina 2 dentro da pagina 1 no trecho <f:subview id=“colhedoraView”>.
Alguém tem uma luz ?

Minhas tentativas foram:

1 - <jsp:directive.include file="/colhedora/colhedora.jsp"/>
2 - <%@include file="/colhedora/colhedora.jsp"%>

Aguardo.
Obrigado a todos.

3 Respostas

anderson.bonavides

.

proteus_adi

Subviews...
é como o tronco duma arvore...
quando ele monta a árvore de objetos acho que só pode ter uma view...

View só pode ter uma...
Mas, se vc tiver uma subview você pode dar includes...
:lol:

[que seria de nós sem os includes?!]

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>   
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>   
<%@taglib prefix="r" uri="http://richfaces.ajax4jsf.org/rich"%>   
  
<f:subview id="blablabla">     
    //<html>   
     // <head>   
     //       <title><h:outputText value="#{bundle.textUsPedra}"/></title>   
      //  </head>   
      //  <body>   
            <h:form id="FormColhedora">   
                <h:panelGrid width="100%">   
                    <r:dataTable value="#{plantioWebController.caPlantioGprsCtrList}"   
                                 var="grid"   
                                 id="grid"   
                                 rows="8"   
                                 onRowMouseOver="this.style.backgroundColor='#F1F1F1'"   
                                 onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">   
                           
                           
                        <r:column sortBy="#{grid.idapontamento}">   
                            <f:facet name="header">   
                                <h:outputText value="#{bundle.textId}"/>   
                            </f:facet>   
                            <h:outputText value="#{grid.idapontamento}"/>   
                        </r:column>     
                           
                    </r:dataTable>   
                    <br>   
                    <r:datascroller for="grid" maxPages="5"/>   
                </h:panelGrid>   
            </h:form>   
     //   </body>   
    //</html>   
</f:subview>
lblanco

Valew galera…
Funfou aqui.

Criado 30 de outubro de 2008
Ultima resposta 30 de out. de 2008
Respostas 3
Participantes 3