This content has been marked as final.
Show 1 reply
-
1. Re: Problems with facelets template layout and a4j:commandButton
julbon Nov 14, 2012 2:28 AM (in response to julbon)This are the layout and layout-client:
' <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html"> <h:head> <link href="./../resources/css/default.css" rel="stylesheet" type="text/css" /> <link href="./../resources/css/cssLayout.css" rel="stylesheet" type="text/css" /> <title>RESPUESTA INCIDENTES</title> </h:head> <body> <div> <div id="top"> <ui:insert name="top" /> </div> <div> <div id="left"> <ui:insert name="left" /> </div> <div id="content" class="left_content"> <ui:insert name="content" /> </div> </div> <div id="bottom"> <ui:insert name="bottom" /> </div> </div> </body> </html>
Layout-Client:
<?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <body style="z-index: 0;"> <ui:composition template="./layout.xhtml"> <ui:define name="top"> <ui:include src="./../header.xhtml" /> </ui:define> <ui:define name="left"> <ui:include src="./../sideBar.xhtml" /> </ui:define> <ui:define name="content"> <h:form> <rich:panel style="background-color:transparent;border-width:0px"> <ui:include src="#{pageViewIdGenerator.includedPage}" style="background-color:transparent;border-width:0px" /> </rich:panel> </h:form> </ui:define> <ui:define name="bottom"> <ui:include src="./../footer.xhtml" /> </ui:define> </ui:composition> </body> </html>
and the xhtml loaded into the content:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <h:outputStylesheet> .outhello { font-weight: bold; } </h:outputStylesheet> <h:form> <h:panelGrid columns="3"> <h:outputText value="Name:" /> <h:inputText value="#{tipoIncidenteBean.nombreTipoIncidente}" /> <a4j:commandButton value="Say Hello" render="out" execute="@form" /> </h:panelGrid> </h:form> <br /> <a4j:outputPanel id="out"> <h:outputText value="Hello #{tipoIncidenteBean.nombreTipoIncidente} !" rendered="#{not empty tipoIncidenteBean.nombreTipoIncidente}" styleClass="outhello" /> </a4j:outputPanel> </ui:composition>
I tried use <html> instead <ui:composition> and isnt work!!
Thks!!!