You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Angel Miralles Arevalo <an...@yahoo.es> on 2008/07/01 07:55:43 UTC

Re: sandbox + facelets

Hi Simon, could you please send me an example of <s:modalDialog>? I got started almost all the sandbox components but modal dialog doesn't work correctly, for example, it is display on screen always. I have the same configuration you have. This is my code:
1. Create "sandbox.taglib.xml"
2. Define it on "web.xml":
        <context-param><param-name>facelets.LIBRARIES</param-name><param-value>/WEB-INF/tomahawk.taglib.xml;/WEB-INF/sandbox.taglib.xml</param-value> 
3. Specify tags:
 <tag>    <tag-name>modalDialog</tag-name>    <component>        <component-type>org.apache.myfaces.ModalDialog</component-type>        <renderer-type>org.apache.myfaces.ModalDialog</renderer-type>    </component> 
4. Use tag:
 <
 <ui:composition>    <s:modalDialog dialogId="FormUsuario" dialogVar="dojoDialogUsuario"                        dialogAttr="bgColor='white' bgOpacity='0.5' toggle='fade' toggleDuration='250'"                       hiderIds="guardar" styleClass="">    <h:form id="AutorizacionUsuarioForm">        <h:panelGrid cellpadding="0" cellspacing="0" border="0" columns="1" styleClass="porcen60">            <h:panelGroup>                <t:outputText value="#{msg.autorizacion_usuario_usuario}"></t:outputText>                <t:inputText value="#{autorizacionUsuarioBean.strUsuario}" size="25"/>            </h:panelGroup>            <h:panelGroup>                <t:commandButton id="guardar" forceId="true" value="#{msg.boton_guardar}" onclick="dojo.widget.byId('FormUsuario').hide();"/>           
 </h:panelGroup>        </h:panelGrid>    </h:form> 
    h:form id="AutorizacionForm">
    <
            .......
            <t:commandLink onclick="dojoDialogUsuario.show();">                    <h:graphicImage value="/img/detalles/candado.gif" styleClass="mano"/>            .........    </h:form></</ui:composition>jsp:root>            </t:commandLink>    </s:modalDialog>jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"    xmlns:ui="http://java.sun.com/jsf/facelets"    xmlns:h="http://java.sun.com/jsf/html"    xmlns:f="http://java.sun.com/jsf/core"     xmlns:t="http://myfaces.apache.org/tomahawk"    xmlns:s="http://myfaces.apache.org/sandbox"    xmlns:xxx="/WEB-INF/xxx.tld"    version="2.0"></tag></context-param>
<!-- Tomahwak/Sandbox con facelets -->



----- Mensaje original ----
De: "simon.kitching@chello.at" <si...@chello.at>
Para: MyFaces Discussion <us...@myfaces.apache.org>
Enviado: lunes, 30 de junio, 2008 17:18:32
Asunto: Re: sandbox + facelets

Angel Miralles Arevalo schrieb:
> Hi everybody, someone using both of them? Sandbox and facelets? I'd 
> like to check if is there anyone getting started all the sandbox 
> components. I can't use modalDialog correctly.
Yes, we are using these together:
* myfaces-1.2.x
* tomahawk 1.1.x
* sandbox
* s:modalDialog
* facelets
and it all works ok.

Regards,
Simon


      ______________________________________________ 
Enviado desde Correo Yahoo! La bandeja de entrada más inteligente.

Re: sandbox + facelets

Posted by Saeid Moradi <sa...@gmail.com>.
Hi,

I don't know  how to integrate sandbox with facelets .
I provide below config for showing simplicity between facelets and
components ! ;)

my.taglibs.xml :

<?xml version="1.0"?>
<!DOCTYPE facelet-taglib PUBLIC "-//Sun Microsystems, Inc.//DTD
Facelet Taglib 1.0//EN"
  "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
<facelet-taglib>
    <namespace>http://app.company.com/foo</namespace>
    <tag>
        <tag-name>sayHello</tag-name>
        <component>
            <component-type>com.company.app.SayHello</component-type>
            <renderer-type>com.company.app.SayHelloRenderer</renderer-type>
        </component>
    </tag>
...
then

xmlns:bar="http://app.company.com/foo"

<bar:sayHello />

faces-config.xml :
<faces-config>
   <component>
        <component-type>com.company.app.SayHello</component-type>

<component-class>com.company.app.tutorial.sayhello.SayHello</component-class>
  </component>
  <render-kit>
        <renderer>
              <component-family>javax.faces.Output</component-family>

<renderer-type>com.company.app.SayHelloRenderer</renderer-type>

<renderer-class>com.company.app.tutorial.sayhello.SayHelloRenderer</renderer-class>
        </renderer>
    </render-kit>
</faces-config>


reference:
https://facelets.dev.java.net/nonav/docs/dev/docbook.html#taglib-create-component


Regards,
Saeid
p.s. modalDialog is a component , and fortunately the source code is
available ...


On Tue, Jul 1, 2008 at 9:25 AM, Angel Miralles Arevalo <an...@yahoo.es>
wrote:

> Hi Simon, could you please send me an example of <s:modalDialog>? I got
> started almost all the sandbox components but modal dialog doesn't work
> correctly, for example, it is display on screen always. I have the same
> configuration you have. This is my code:
>
>
> 1. Create "sandbox.taglib.xml"
> 2. Define it on "web.xml":
>
>
> <!-- Tomahwak/Sandbox con facelets -->
>
> <context-param>
>
> <param-name>facelets.LIBRARIES</param-name>
>
> <param-value>/WEB-INF/tomahawk.taglib.xml;/WEB-INF/sandbox.taglib.xml</
> param-value>
>
> </context-param>
>
>
>
> 3. Specify tags:
>
>
>
> <
> tag>
>
>     <tag-name>modalDialog</tag-name>
>
>     <component>
>
>         <component-type>org.apache.myfaces.ModalDialog</component-type>
>
>         <renderer-type>org.apache.myfaces.ModalDialog</renderer-type>
>
>     </component>
>
> </tag>
>
>
>
> 4. Use tag:
>
>
>
> <
> jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
>
>     xmlns:ui="http://java.sun.com/jsf/facelets"
>
>     xmlns:h="http://java.sun.com/jsf/html"
>
>     xmlns:f="http://java.sun.com/jsf/core"
>
>     xmlns:t="http://myfaces.apache.org/tomahawk"
>
>     xmlns:s="http://myfaces.apache.org/sandbox"
>
>     xmlns:xxx="/WEB-INF/xxx.tld"
>
>     version="2.0">
>
>
>
> <
> ui:composition>
>
>     <s:modalDialog dialogId="FormUsuario" dialogVar="dojoDialogUsuario"
>
>                        dialogAttr="bgColor='white' bgOpacity='0.5'
> toggle='fade' toggleDuration='250'"
>
>                        hiderIds="guardar" styleClass="">
>
>     <h:form id="AutorizacionUsuarioForm">
>
>         <h:panelGrid cellpadding="0" cellspacing="0" border="0" columns="1"
> styleClass="porcen60">
>
>             <h:panelGroup>
>
>                 <t:outputText value="#{msg.autorizacion_usuario_usuario}"
> ></t:outputText>
>
>                 <t:inputText value="#{autorizacionUsuarioBean.strUsuario}"
> size="25"/>
>
>             </h:panelGroup>
>
>             <h:panelGroup>
>
>                 <t:commandButton id="guardar" forceId="true" value="#{msg.boton_guardar}"
> onclick="dojo.widget.byId('FormUsuario').hide();"/>
>
>             </h:panelGroup>
>
>         </h:panelGrid>
>
>     </h:form>
>
>     </s:modalDialog>
>
>
>
>
>
>     <
> h:form id="AutorizacionForm">
>
>             .......
>
>             <t:commandLink onclick="dojoDialogUsuario.show();">
>
>                     <h:graphicImage value="/img/detalles/candado.gif"
> styleClass="mano"/>
>
>             </t:commandLink>
>
>             .........
>
>     </
> h:form>
>
> </ui:composition>
>
> </
> jsp:root>
>
>
>
>
>
>
> ----- Mensaje original ----
> De: "simon.kitching@chello.at" <si...@chello.at>
> Para: MyFaces Discussion <us...@myfaces.apache.org>
> Enviado: lunes, 30 de junio, 2008 17:18:32
> Asunto: Re: sandbox + facelets
>
>
> Angel Miralles Arevalo schrieb:
> > Hi everybody, someone using both of them? Sandbox and facelets? I'd
> > like to check if is there anyone getting started all the sandbox
> > components. I can't use modalDialog correctly.
> Yes, we are using these together:
> * myfaces-1.2.x
> * tomahawk 1.1.x
> * sandbox
> * s:modalDialog
> * facelets
> and it all works ok.
>
> Regards,
> Simon
>
>
> ------------------------------
> ¿No te gusta tu dirección de correo?
>  Consigue una que te guste de verdad
> <http://es.docs.yahoo.com/mail/nueva_direccion.html> - Millones de
> direcciones de correo disponibles en Yahoo!<http://es.docs.yahoo.com/mail/nueva_direccion.html>
>