I'm trying to create a dynamic player with Primefaces 5.1, JSF 2.2.3 and Spring 4.1.1. The component should possibly work for both a normal and a mobile web page.
A p:selectOneMenu component let the user select the song he wants to play, plus he has a next and prev button. A listener updates a backing bean and then an ajax event refresh the html5 audio component that will play the chosen song.
Code: Select all
<h:panelGroup >
<div id="playlist_audio_title">
<h:commandButton id="playlist_audio_prev" actionListener="${playListManager.playListNextPrev(-1)}" process="@this" update="playlist_audio_panel" value="prev"/>
<h:outputText value="${playListManager.currentFile.title}"/>
<p:selectOneMenu id="playlist_audio_select"
value="#{playListManager.currentFile}"
effect="fade"
required="true"
converter="uploadedFileConverter">
<f:selectItems value="#{playListManager.currentPlayList.uploadedFiles}" var="uf" itemLabel="#{uf.title}" itemValue="#{uf}" />
<p:ajax update="@this playlist_audio_panel" process="@this" listener="${playListManager.selectFile()}"/>
</p:selectOneMenu>
<h:commandButton id="playlist_audio_next" actionListener="${playListManager.playListNextPrev(1)}" process="@this" update="playlist_audio_panel" value="next"/>
</div>
<h:panelGroup id="playlist_audio_panel">
<audio id="playlist_audio"
controls="controls"
src="${playListManager.currentFile.fullPath}"
onended="fireLink('contentForm:playlist_audio_next')"/>
</h:panelGroup>
</h:panelGroup>
NotFoundError: Node was not found jquery.js?ln=primefaces line 25
and the component is not refreshed correctly.
The java code of the listener is very simple, it just changes an index on a list and work correctly on every case.
Please have you any idea of what I'm doing wrong with the mobile version? should I change the component structure? let me know if you need more informations, thanks.