My problem is when i click on the close icon on the panel the panel closes but the ajax event is not fired
Here my xhtml
Code: Select all
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:body>
<ui:composition template="index_static.xhtml" >
<ui:define name="content">
<h:form>
<!-- wenn kein GET-Parameter -->
<!-- Output-Container für die News-Liste -->
<p:dataGrid value="#{newsController.newsList}" var="news"
id="_newsContainer#{news.newsID}" columns="1" rows="10"
paginator="true" paginatorPosition="bottom"
paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"
paginatorAlwaysVisible="false"
style="min-height: 650px"
rendered="#{newsController.news == null}">
<!-- Output-Container für je eine News -->
<p:growl id="growl" showDetail="true"/>
<p:panel toggleable="false" closable="true" id="_news#{news.newsID}" header="#{news.titel}"
widgetVar="panel" visible="#{news.aktiv}">
<p:ajax event="close" listener="#{newsController.deleteNews}" update="growl"/>
<h:outputText value="#{news.inhalt}" />
<br />
<br />
<!-- TODO FIX THIS-->
<h:outputText style="text-align: right" >
von #{news.autor} am ...
</h:outputText>
</p:panel>
</p:dataGrid>
<p:panel rendered="#{newsController.news != null}"
header="#{newsController.news.titel}">
<h:outputText value="#{newsController.news.inhalt}" />
<br />
<br />
<p align="right" >von
<a href="profile.xhtml?uid=#{newsController.news.autor.userID}">#{newsController.news.autor}</a></p>
<!-- TODO Kommentare -->
</p:panel>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
Code: Select all
@ManagedBean
@RequestScoped
public class NewsController implements Serializable{
....
...
public void deleteNews(CloseEvent ce){
System.out.println("sewasd");
}
}
and thanks in advance!