<%@page contentType="text/html" pageEncoding="UTF-8"%>

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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<%--
    This file is an entry point for JavaServer Faces application.
--%>
<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title>JSP Page</title>
        </head>
        <body>
            <rich:panel header="Teste Panel RichFaces">
                <rich:dataTable value="#{nomesBean.nomes}" var="nome">
                    <rich:column>
                        <h:outputText value="#{nome}"/>
                    </rich:column>
                    <rich:column>
                        <h:form>
                            <h:commandLink action="#{nomesBean.excluir}" value="Excluir"/>
                        </h:form>
                    </rich:column>
                    <rich:column>
                        <h:form>
                            <a4j:commandLink action="#{nomesBean.mostrarPT}" value="Pontos Turísticos"
                                             reRender="panelPT"/>
                        </h:form>
                    </rich:column>
                </rich:dataTable>
            </rich:panel>

            <rich:panel id="panelPT">
                <rich:dataTable value="#{nomesBean.pontosTuristicos}" var="pontoTuristico">
                    <rich:column>
                        <h:outputText value="#{pontoTuristico}"/>
                    </rich:column>
                </rich:dataTable>
            </rich:panel>
              
        </body>
    </html>
</f:view>
