3 Replies Latest reply on May 29, 2007 1:51 PM by Rados?aw Kosicki

    modal panel not works with myfaces and seam

    Ivan Tufegdzic Newbie

      Hi.
      I have problems with modal panel. I am using SNAPSHOT 3.0.1. ,seam 1.2.1, myfaces and ajax4jsf 1.1.1 and jboss 4.2.0.
      On click nothing happens.
      Problem is <ui:define name="body"> or with template,probably.

      Here is code:

      template.xhtml

      <!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"
      xmlns:sb="http://myfaces.apache.org/sandbox"
      xmlns:t="http://myfaces.apache.org/tomahawk"
      xmlns:trh="http://myfaces.apache.org/trinidad/html"
      xmlns:rich="http://richfaces.ajax4jsf.org/rich"
      xmlns:tr="http://myfaces.apache.org/trinidad"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="https://ajax4jsf.dev.java.net/ajax">
      <ui:include src="/layout/head.xhtml" />
      <trh:body id="someb">
      <h:form id="docform" enctype="multipart/form-data">







      <ui:include src="/layout/common.xhtml" />
      </h:form>
      </trh:body>

      --------------------------------------------
      common.xhtml

      <div xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:trh="http://myfaces.apache.org/trinidad/html"
      xmlns:t="http://myfaces.apache.org/tomahawk"
      xmlns:tr="http://myfaces.apache.org/trinidad">
      <tr:inputHidden id="notifier" binding="#{Notifier.notifier}" />

      <trh:tableLayout width="100%" cellPadding="0" cellSpacing="5">
      <trh:rowLayout>
      <trh:cellFormat>
      <tr:panelGroupLayout layout="vertical">
      <trh:tableLayout styleClass="standardTable_Header">
      <trh:rowLayout>
      <trh:cellFormat>
      <tr:spacer width="5" />
      <h:outputText title="#{user.name}" value="#{navigationHandler.pageInfo}"></h:outputText>
      </trh:cellFormat>
      </trh:rowLayout>
      </trh:tableLayout>

      <t:htmlTag value="br" rendered="#{empty memory.memoryProduct}"> </t:htmlTag>
      <t:panelGrid columns="3" rendered="#{not empty memory.memoryProduct}">
      <tr:selectOneChoice value="#{currentProduct}" autoSubmit="true"
      label="#{messages.select}: ">
      <t:selectItems var="varItem" itemLabel="#{varItem.name}"
      itemValue="#{varItem}" value="#{memory.memoryProduct}"></t:selectItems>
      </tr:selectOneChoice>
      <tr:commandButton text="#{messages.go}" id="as" action="#{selected.redirectProduct(currentProduct)}"
      shortDesc="#{messages.viewselect}"></tr:commandButton>
      </t:panelGrid>

      <h:messages globalOnly="false" showDetail="false" showSummary="true"
      infoClass="info"
      warnClass="warn"
      errorClass="error" />
      <trh:tableLayout width="100%">
      <trh:rowLayout>

      <trh:cellFormat inlineStyle="vertical-align: top" width="17%">
      <ui:insert name="sidebar">
      <ui:include src="/shop/search.xhtml" />
      <ui:include src="/shop/dropzone.xhtml" />
      </ui:insert>
      </trh:cellFormat>

      <trh:cellFormat inlineStyle="vertical-align: top" width="65%">
      <ui:insert name="body">
      BODY
      </ui:insert>
      </trh:cellFormat>

      <trh:cellFormat inlineStyle="vertical-align: top" width="16%">
      <ui:insert name="status">
      <ui:include src="/shop/welcome.xhtml" />
      <ui:include src="/shop/viewBasket.xhtml" />
      <ui:include src="/shop/viewNotepad.xhtml" />
      </ui:insert>
      </trh:cellFormat>

      </trh:rowLayout>
      </trh:tableLayout>
      </tr:panelGroupLayout>
      </trh:cellFormat>
      </trh:rowLayout>
      </trh:tableLayout>

      -------------------------------------
      head.xhtml

      <trh:head id="trhead"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:trh="http://myfaces.apache.org/trinidad/html">
      <meta http-equiv="content-type" content="text/html; charset=windows-1250" />
      #{navigationHandler.pageInfo} #{conversation.id}


      </trh:head>
      -----------------------------------------

      myFile.xhtml

      <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:s="http://jboss.com/products/seam/taglib"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:trh="http://myfaces.apache.org/trinidad/html"
      xmlns:tr="http://myfaces.apache.org/trinidad"
      xmlns:t="http://myfaces.apache.org/tomahawk"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:rich="http://richfaces.ajax4jsf.org/rich"
      xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
      template="/layout/temp.xhtml">
      <ui:define name="body">

      RichFaces Modal Panel is a container that blocks the operation on the base page when the modal
      panel is shown.
      You can show the modal panel using the folowing javascript function: Richfaces.hideModalPanel(id, params).
      For example, <a href="javascript:Richfaces.showModalPanel('mp',{width:450, top:200})">
      Richfaces.showModalPanel('mp',{width:450, top:200})

      </ui:define>
      <rich:modalPanel id="mp" minHeight="200" minWidth="450"
      height="200" width="500" zindex="2000">
      <f:facet name="header">
      <h:outputText value="Modal Panel Title" />
      </f:facet>
      <f:facet name="controls">
      <h:graphicImage value="/images/close.gif" style="cursor:pointer" onclick="Richfaces.hideModalPanel('mp')" />
      </f:facet>
      Any JSF content might be inside the panel. In case of using
      Facelets or JSF 1.2, it might be any mixed content.

      The RichFaces modal panel is good with <a4j:include> to create
      a wizard like behavior.
      The model panel is open and closed from the javascript function
      on Richfaces object. The following code
      <a href="javascript:Richfaces.hideModalPanel('mp')">hide this panel:
      Richfaces.hideModalPanel('mp')

      </rich:modalPanel>
      </ui:composition>

      ---------------------------------------------

      Where is mistake.I am reading tutorial,and many helps, but nothing help me.
      What do I do????
      Thanks.
      it