Consider the following JSF (& jQuery Mobile) markup:
<h:form>
            <a href="#login" data-rel="popup">Please login</a>
            <h:outputText id="greeting" value="Welcome, you have logged in" rendered="#{sessionScope.login == null ? false : true}"/>
            <div id="login" data-role="popup">
            <h:inputText value="#{requestScope.userName}"/>
            <h:inputHidden value="#{requestScope.password}"/>
            <h:commandButton value="login" action="#{loginBacking.processLogin}">
                <f:ajax execute="@form" render="greeting"/>
            </h:commandButton>
            </div>
</h:form>  
Obviously the above markup will not send the user input to the server, because jQuery Mobile popup needs <h:form/> tag inside popup. But if I put the <h:form/> tag inside popup, I cannot use <f:ajax render="greeting"/> (because the id "greeting" left outside). 
How can I overcome this issue without using boilerplate Javascript codes?
 
     
    