Templates in networks

How to create templates on mobile networks since the root tag is f: view, not html.

+3


source to share


1 answer


The root XML element is irrelevant. It just contains the XML namespace declarations. The key is that you must have <f:view renderKitId="PRIMEFACES_MOBILE">

a master in your template. So the following example of a starter template should work as well:

<f:view 
    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"
    xmlns:pm="http://primefaces.org/mobile"
    renderKitId="PRIMEFACES_MOBILE"
>
    <ui:insert name="some" />
</f:view>

      



The template client looks the same as usual:

<ui:composition template="/WEB-INF/template.xhtml"
    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"
    xmlns:pm="http://primefaces.org/mobile"
>
    <ui:define name="some">
        ...
    </ui:define>
</ui:composition>

      

+5


source







All Articles