I'm facing the following problem:
The Primefaces remoteCommand is not executing, does it depend on the lifecycle of my portlet?
<h:form id="controllayer">
.
.
.
<p:remoteCommand name="updatePageId" actionListener="#{formView.updatePageId}" />
</h:form>
<script>
var pageID;
Liferay.on('eventFire', function(event)
{
console.log("Recieved");
console.log(event.name);
pageID = event.name;
update();
});
function update() {
console.log("Recieved PageID: " + pageID);
updatePageId({newPageId: pageID});
}
</script>
I also tried it without a parameter but even this isn't working.
@SessionScoped
@ManagedBean(name="formView")
public class MainViewBean implements PagesUploadCallback, PageUploadCallback, PageActionCallback, Serializable
{
.
.
.
public void updatePageId()
{
LOG.info("Update Page ID");
String pageIdString = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("newPageId");
long pageId = Long.valueOf(pageIdString);
LOG.debug("Setting Page: " + pageId);
pageService.setActivePage(pageId);
}
.
.
.
}
My JavaCode is never called.