Hallo wie der Titel schon verrät werden meine Beans in meiner xhtml einfach nicht ausgeführt, also garnicht einfach ignoriert!!
Ich bitte um Hilfe ich suche schon etwa 3 Wochen daran
Hier mein Code:
[XML]<?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
="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 onload="container.toggle();">
<ui:composition template="index_static.xhtml" >
<ui:define name="content" >
<h:form>
<p:fieldset collapsed="true" legend="Neue News"
toggleable="true" widgetVar="container"
rendered="#{userBean.loggedIn != null}"
>
<h
anelGrid columns="2">
<h
utputLabel for="name" value="Titel: " rendered="#{userBean.loggedIn != null}" />
<p:inputText id="name" value="#{newsController.news_new.titel}"/>
<h
utputLabel for="text" value="Text: " />
<p:inplace label="Editor öffnen" saveLabel="Übernehmen"
cancelLabel="Abbrechen"> <p:editor rendered="true" id="text" value="#{newsController.news_new.inhalt}"/></p:inplace>
<h
utputLabel for="category" value="Kategorie: " />
<p:selectOneMenu id="category" >
<f:selectItems id="galerie" value="#{newsController.categories}" var="g" itemLabel="#{g.kategoriename}"/>
</p:selectOneMenu>
<h
utputLabel for="active" value="Nur intern sichtbar: " rendered="#{userBean.loggedIn != null}" />
<p:selectBooleanCheckbox id="active" value="#{newsController.news_new.intern}" rendered="#{userBean.loggedIn != null}"/>
<p:commandButton style="text-align:right" actionListener='#{newsController.newNews}' id="new" value="Anlegen" oncomplete="container.toggle();" update=":contentPanel"/>
</h
anelGrid>
</p:fieldset>
<!-- wenn kein GET-Parameter -->
<!-- Output-Container für die News-Liste -->
<p:dataGrid value="#{generalInfoBean.latestNews}" widgetVar="newscon" var="news"
id="_newsContainer#{news.newsID}" columns="1" rows="10"
paginator="true" paginatorPosition="bottom"
paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"
paginatorAlwaysVisible="false"
rendered="#{newsController.news == null}">
<!-- Output-Container für je eine News -->
<p:commandLink style="text-decoration: none;" actionListener="#{newsController.test}" oncomplete="window.location.href = 'news_view.jsf'">
<p
anel id="_news#{news.newsID}" header="#{news.titel}"
widgetVar="panel" rendered="#{news.aktiv}"
closable="#{userBean.loggedIn != null}">
<p:ajax event="close" listener="#{newsController.test}" update=":contentPanel"/>
<h
utputText value="#{news.inhalt}" />
<br />
<br />
<!-- TODO FIX THIS-->
<h
utputText style="text-align: right" >
von #{news.autor} am ...
</h
utputText>
</p
anel>
</p:commandLink>
</p:dataGrid>
<p
anel rendered="#{newsController.news != null}"
header="#{newsController.news.titel}">
<h
utputText value="#{newsController.news.inhalt}" />
<br />
<br />
<p align="right" >von
<a href="profile.xhtml?uid=#{newsController.news.autor.userID}">#{newsController.news.autor}</a></p>
</p
anel>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
[/XML]
In diesem Code der actionListner im commandbutton mit der id = new
und das Ajax Event close
Danke einmal im Vorraus!
Ich bitte um Hilfe ich suche schon etwa 3 Wochen daran
Hier mein Code:
[XML]<?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
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 onload="container.toggle();">
<ui:composition template="index_static.xhtml" >
<ui:define name="content" >
<h:form>
<p:fieldset collapsed="true" legend="Neue News"
toggleable="true" widgetVar="container"
rendered="#{userBean.loggedIn != null}"
>
<h
<h
<p:inputText id="name" value="#{newsController.news_new.titel}"/>
<h
<p:inplace label="Editor öffnen" saveLabel="Übernehmen"
cancelLabel="Abbrechen"> <p:editor rendered="true" id="text" value="#{newsController.news_new.inhalt}"/></p:inplace>
<h
<p:selectOneMenu id="category" >
<f:selectItems id="galerie" value="#{newsController.categories}" var="g" itemLabel="#{g.kategoriename}"/>
</p:selectOneMenu>
<h
<p:selectBooleanCheckbox id="active" value="#{newsController.news_new.intern}" rendered="#{userBean.loggedIn != null}"/>
<p:commandButton style="text-align:right" actionListener='#{newsController.newNews}' id="new" value="Anlegen" oncomplete="container.toggle();" update=":contentPanel"/>
</h
</p:fieldset>
<!-- wenn kein GET-Parameter -->
<!-- Output-Container für die News-Liste -->
<p:dataGrid value="#{generalInfoBean.latestNews}" widgetVar="newscon" var="news"
id="_newsContainer#{news.newsID}" columns="1" rows="10"
paginator="true" paginatorPosition="bottom"
paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"
paginatorAlwaysVisible="false"
rendered="#{newsController.news == null}">
<!-- Output-Container für je eine News -->
<p:commandLink style="text-decoration: none;" actionListener="#{newsController.test}" oncomplete="window.location.href = 'news_view.jsf'">
<p
widgetVar="panel" rendered="#{news.aktiv}"
closable="#{userBean.loggedIn != null}">
<p:ajax event="close" listener="#{newsController.test}" update=":contentPanel"/>
<h
<br />
<br />
<!-- TODO FIX THIS-->
<h
von #{news.autor} am ...
</h
</p
</p:commandLink>
</p:dataGrid>
<p
header="#{newsController.news.titel}">
<h
<br />
<br />
<p align="right" >von
<a href="profile.xhtml?uid=#{newsController.news.autor.userID}">#{newsController.news.autor}</a></p>
</p
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>
[/XML]
In diesem Code der actionListner im commandbutton mit der id = new
und das Ajax Event close
Danke einmal im Vorraus!