我想创建一个移动网页(基于 PrimeFaces Mobile),如下所示:
图像及其下方 - 两个按钮。
我为此编写了以下 xhtml 页面:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
xmlns:pm="http://primefaces.org/mobile">
<f:view renderKitId="PRIMEFACES_MOBILE"/>
<h:head>
</h:head>
<f:event listener="#{main.loadFirstImage}" type="preRenderView" />
<h:body id="body">
<pm:page id="page">
<pm:header title="myapp">
</pm:header>
<pm:content id="content">
<h:form>
<p:panelGrid columns="2">
<p:row>
<p:column colspan="2">
<p:graphicImage id="image" rendered="false" value="#{main.currentImage()}"
cache="false">
</p:graphicImage>
</p:column>
</p:row>
<p:row>
<p:column colspan="1">
<p:commandButton id="hotButton"
value="Button 1"/>
</p:column>
<p:column colspan="1">
<p:commandButton id="notButton"
value="Button 2"/>
</p:column>
</p:row>
</p:panelGrid>
</h:form>
</pm:content>
<pm:footer title="m.myapp.info"></pm:footer>
</pm:page>
</h:body>
</html>
但相反,我得到了这个观点:
如何更改我的 xhtml 文件以获得所需的布局?