The problem must have something to do with the mobile renderer. If I run a simple view without the mobile renderer everything works fine:
Code: Select all
<!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"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:qs="http://java.sun.com/jsf/composite/components">
<h:head>
</h:head>
<h:body>
<p:growl id="growl" autoUpdate="true" globalOnly="true"
showDetail="true" sticky="false" widgetVar="growl" />
<h:form>
<p:remoteCommand name="newsignal" update=":square" process="@this"
async="true" actionListener="#{signalView.newsignal}" />
<h:button onclick="newsignal(); return;" value="New Signal..."></h:button>
</h:form>
<qs:square id="square"></qs:square>
<p:messages id="messages" redisplay="false"></p:messages>
</h:body>
</html>
But if the same view gets rendered by the mobile renderer, then the remoteCommand cannot find the composite component ":square":
Code: Select all
<!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"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:qs="http://java.sun.com/jsf/composite/components">
<f:view renderKitId="PRIMEFACES_MOBILE" />
<h:head>
</h:head>
<h:body>
<pm:page id="page">
<pm:content>
<p:growl id="growl" autoUpdate="true" globalOnly="true"
showDetail="true" sticky="false" widgetVar="growl" />
<h:form>
<p:remoteCommand name="newsignal" update=":square" process="@this"
async="true" actionListener="#{signalView.newsignal}" />
<h:button onclick="newsignal(); return;" value="New Signal..."></h:button>
</h:form>
<qs:square id="square"></qs:square>
<p:messages id="messages" redisplay="false"></p:messages>
</pm:content>
</pm:page>
</h:body>
</html>
It seems to be that the content container id within a mobile page cannot be set to a static value. So how could I specify the update command to update a composite component within the same content container as the remoteCommand resides in?