Primefaces 7.0 commandButton dans un dataScroller qui ne répond pas
Bonjour, j'utilise un dataScroller pour afficher des 'posts' qui s'affiche au fur a mesure, dans chaque item il y a un commandButon qui invoque une méthode d'un managedBean en sessionScoped, les 10 premiers boutons fonctionnent mais pas ceux qui sont chargés à la volé (lazy loading).
code :
Vue :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| <p:dataScroller widgetVar="newsfeed" chunkSize="10" rows="10" lazy="true" value="#{mainBean.model}"
var="tp">
//HTML
<h:panelGroup layout="block" class="post-comment" rendered="#{mainBean.user.tableUsers!=null}">
<img src="#{mainBean.user.tableUsers.avatarUrl}" alt="avatar" class="profile-photo-sm"/>
<h:form>
<p:commandButton icon="fa fa-reply" class="img-circle img-rounded"
action="#{mainBean.actionClickReply(tp)}">
</p:commandButton>
</h:form>
</h:panelGroup>
</div>
</div>
</div>
</p:dataScroller> |
mainBean :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| @ManagedBean
@SessionScoped
public class MainBean extends NewsFeed implements Serializable {
../..
/**
* Creates a new instance of MainBean
*/
public MainBean() {
}
../..
public void actionClickReply(TablePosts tp) {
post.setTablePost(tp);
post.setReply("");
PrimeFaces.current().executeScript("PF('add_reply_dialog').show();");
}
../..
} |
Merci pour votre aide.