0 Replies Latest reply on Nov 23, 2007 10:41 AM by Artyom Vorobyev

    RichFaces and tiles

    Artyom Vorobyev Newbie

      Hi!

      When I put in one of my tile JSP pages the following code:

      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %>
      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
      <%@ taglib uri="http://richfaces.org/rich" prefix="rich" %>
      
      <f:view>
      <rich:modalPanel id="leftmenu_leftMenuPanel" width="350" height="130" style="overflow:visible">
       <f:facet name="header">
       <h:outputText value="New revision"/>
       </f:facet>
       <h:form id="leftmenu_VersionsListForm">
       <h:panelGrid columns="2">
       <h:outputLabel value="Revision version"/>
       <h:inputText value="#{leftMenuBarBean.newRevisionTitle}"/>
       <h:outputLabel value="Revision date"/>
       <rich:calendar style="overflow:visible;" zindex="200"/>
       <h:commandButton value="Add revision" onclick="Richfaces.hideModalPanel('panel');"
       action="#{leftMenuBarBean.addRevision}">
       <a4j:support
       oncomplete="if (#{leftMenuBarBean.addRevision}==1) Richfaces.hideModalPanel('panel');"/>
       </h:commandButton>
       <h:commandButton value="Cancel" onclick="Richfaces.hideModalPanel('panel');">
       <a4j:support event="onclick" reRender="revisions"/>
       </h:commandButton>
       </h:panelGrid>
       </h:form>
      </rich:modalPanel>
      
      <rich:modalPanel id="leftmenu_baselineVersionPanel" height="115" onshow="document.getElementById('leftmenu_newVersionForm:ifVersionValidId').value=0">
       <f:facet name="header">
       <h:outputText value="Baseline version"/>
       </f:facet>
       <h:form id="leftmenu_newVersionForm">
       <h:panelGrid columns="3">
       <h:outputLabel value="Version:"/>
       <h:inputText value="#{leftMenuBarBean.newVersionTitle}" required="true" id="newVersionTitle">
       <f:validator validatorId="NewVersionDialogValidator"/>
       </h:inputText>
       <rich:message id="versionTitleValidMessage" for="newVersionTitle">
       <f:facet name="errorMarker">
       <h:graphicImage url="../images/ajax/error.gif"/>
       <h:outputText value="error"/>
       </f:facet>
       </rich:message>
       <h:outputLabel value="Revision:"/>
       <h:selectOneMenu id="leftMenuRevisionId"
       value="#{leftMenuBarBean.defaultRevisionId}" style="width:150px;">
       <f:selectItems value="#{leftMenuBarBean.revisionsForNewVersion}"/>
       </h:selectOneMenu>
       <h:inputHidden value="#{leftMenuBarBean.newVersiondialogCanBeClosed}" id="ifVersionValidId"/>
       <a4j:commandButton value="Add version" id="addVersionCommandButton"
       action="#{leftMenuBarBean.addVersion}" oncomplete="if (document.getElementById('newVersionForm:ifVersionValidId').value == 1) { Richfaces.hideModalPanel('baselineVersionPanel');}" reRender="baselineVersionPanel, newVersionTitle, leftMenuVerisonsId, ifVersionValidId">
       </a4j:commandButton>
       <a4j:commandButton value="Cancel" onclick="Richfaces.hideModalPanel('baselineVersionPanel');"
       reRender="newVersionTitle">
      
       </a4j:commandButton>
       </h:panelGrid>
       </h:form>
      </rich:modalPanel>
      
      
      <h:panelGrid columns="1">
       <rich:panel header="Versions" bodyClass="inpanelBody" style="width:200px;">
       <h:outputLabel value="New version" onclick="Richfaces.showModalPanel('leftMenu_testModalPanel');"/>
       <rich:dataList var="versions" value="#{leftMenuBarBean.versions}" id="leftMenuVerisonsId">
       <h:outputText value="#{versions.name}"/><br/>
       </rich:dataList>
       </rich:panel>
       <rich:panel header="Revisions" style="width:200px;">
       <h:outputLabel value="New revision"
       onclick="if (#{leftMenuBarBean.validationKey}==2) {alert('Yo');}Richfaces.showModalPanel('panel');"
       rendered="#{leftMenuBarBean.revisionCanBeCreated}"/>
       <h:outputLabel value="Baseline revision" onclick="Richfaces.showModalPanel('panel');"
       rendered="#{!leftMenuBarBean.revisionCanBeCreated}"/>
       <rich:dataList var="revisions" value="#{leftMenuBarBean.revisions}" id="leftMenuRevisions">
       <h:outputText value="#{revisions.version}"/><br/>
       </rich:dataList>
       </rich:panel>
      </h:panelGrid>
      </f:view>


      I have errors like ModalPanel is not defined (I'm using FireBug as the debugger and struts.jar from Struts 1.x.x as the Tiles library). Could you please tell me what is the reason of this problem and if RichFaces 3.1.x should work with Tiles? I'm using JSF 1.1 implementation from Sun.

      Thanks in advance!

      Best wishes, Artyom.