Can JSF Facelets be used to include xhtml content in xforms?

classic Classic list List threaded Threaded
2 messages Options
DL
Reply | Threaded
Open this post in threaded view
|

Can JSF Facelets be used to include xhtml content in xforms?

DL

I'm pursuing ways of including content - dynamically - in an xform view.html

An earlier thread I started explored php for scripting but that doesn't work yet.

I raise a new question now .. can JSF 2.0 Facelets be used to include content in xhtml?

I found these posts ..

http://stackoverflow.com/questions/4792862/how-to-include-another-xhtml-in-xhtml-using-jsf-2-0-facelets

http://www.roseindia.net/jsf/include.shtml

First I added a new app in /WEB-INF/resources/apps/ .. jsf-includes .. and created this test view.html with accompanying page-flow.xml.

<ui:composition 
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets">
    <h2>Include page</h2>
    <p>Include page blah blah lorem ipsum</p>
</ui:composition>
Next I took the standard xforms-hello app and amended it thus to include content returned from .. /jsf-includes/
<xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"ludes/ 
      xmlns:xforms="http://www.w3.org/2002/xforms"
      xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
      xmlns:ev="http://www.w3.org/2001/xml-events"
      xmlns:xs="http://www.w3.org/2001/XMLSchema"
      xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
      
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets" >
       
    <xhtml:head>
        <xhtml:title>XForms Hello</xhtml:title>
        <xforms:model>
            <xforms:instance>
                <first-name xmlns=""/>
            </xforms:instance>
        </xforms:model>
    </xhtml:head>
    <xhtml:body>
        
    <ui:include src="http://localhost:8080/orbeon/jsf-includes/" />

<!-- the ui-include is immediately after <xhtml:body> -->

<!-- the remainder of view.xhtml remains unchanged -->

This url .. http://localhost:8080/orbeon/jsf-includes/

delivers the include content but it does not appear in the rendered xform ..

http://localhost:8080/orbeon/xforms-hello/

What else must I do to include/embed content in an xform app?

Reply | Threaded
Open this post in threaded view
|

Re: Can JSF Facelets be used to include xhtml content in xforms?

Erik Bruchez
Administrator
DL,

I have no idea about facelets, but the answer probably lies in the
order in which things happen. That is, when is <ui:include> processed
wrt XForms processing? I assume, since things are not working, that
the order is 1) XForms processing 2) Facelet processing. But I am not
sure! And you probably want 1) Facelet processing 2) XForms
processing.

-Erik

On Tue, May 1, 2012 at 12:05 PM, DL <[hidden email]> wrote:

> I'm pursuing ways of including content - dynamically - in an xform view.html
>
> An earlier thread I started explored php for scripting but that doesn't work
> yet.
>
> I raise a new question now .. can JSF 2.0 Facelets be used to include
> content in xhtml?
>
> I found these posts ..
>
> http://stackoverflow.com/questions/4792862/how-to-include-another-xhtml-in-xhtml-using-jsf-2-0-facelets
>
> http://www.roseindia.net/jsf/include.shtml
>
> First I added a new app in /WEB-INF/resources/apps/ .. jsf-includes .. and
> created this test view.html with accompanying page-flow.xml.
>
> <ui:composition
>     xmlns="http://www.w3.org/1999/xhtml"
>     xmlns:f="http://java.sun.com/jsf/core"
>     xmlns:h="http://java.sun.com/jsf/html"
>     xmlns:ui="http://java.sun.com/jsf/facelets">
>     <h2>Include page</h2>
>     <p>Include page blah blah lorem ipsum</p>
> </ui:composition>
>
> Next I took the standard xforms-hello app and amended it thus to include
> content returned from .. /jsf-includes/
>
> <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"ludes/
>       xmlns:xforms="http://www.w3.org/2002/xforms"
>       xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
>       xmlns:ev="http://www.w3.org/2001/xml-events"
>       xmlns:xs="http://www.w3.org/2001/XMLSchema"
>       xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
>
>       xmlns:f="http://java.sun.com/jsf/core"
>       xmlns:h="http://java.sun.com/jsf/html"
>       xmlns:ui="http://java.sun.com/jsf/facelets" >
>
>     <xhtml:head>
>         <xhtml:title>XForms Hello</xhtml:title>
>         <xforms:model>
>             <xforms:instance>
>                 <first-name xmlns=""/>
>             </xforms:instance>
>         </xforms:model>
>     </xhtml:head>
>     <xhtml:body>
>
>     <ui:include src="http://localhost:8080/orbeon/jsf-includes/" />
>
> <!-- the ui-include is immediately after <xhtml:body> -->
>
> <!-- the remainder of view.xhtml remains unchanged -->
>
> This url .. http://localhost:8080/orbeon/jsf-includes/
>
> delivers the include content but it does not appear in the rendered xform ..
>
> http://localhost:8080/orbeon/xforms-hello/
>
> What else must I do to include/embed content in an xform app?
>
>
> ________________________________
> View this message in context: Can JSF Facelets be used to include xhtml
> content in xforms?
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing
> list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws