Code: Select all
<p:dialog header="Bilder" widgetVar="BilderDialog" resizable="true" height="800" width="600">
<p:dataGrid var="bild" value="#{handleShowBilder.bilder}" columns="3"
rows="12" paginator="true" effect="true"
paginatorTemplate="{CurrentPageReport}
{FirstPageLink} {PreviousPageLink} {PageLinks}
{NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="9,12,15">
<p:column>
<p:panel header="#{bild.kuenstler.sNachname}" style="text-align:center">
<h:panelGrid columns="1" style="width:100%">
<p:graphicImage value="#{bild.sBildPfad}"/>
<h:outputText value="#{bild.sTitel}" />
<p:commandLink update="Show_Bild_Detail" oncomplete="ShowOnePicDialog.show()"
title="View Detail">
<p:graphicImage value="/images/search.png"/>
<f:setPropertyActionListener value="#{bild}"
target="#{handleShowBilder.selectedPic}" />
</p:commandLink>
</h:panelGrid>
</p:panel>
</p:column>
</p:dataGrid>
<p:dialog header="Bild Detail" widgetVar="ShowOnePicDialog" width="200" height="175">
<p:outputPanel id="Show_Bild_Detail" style="text-align:center;" layout="block">
<p:graphicImage value="#{handleShowBilder.selectedPic.sBildPfad}"/>
<h:panelGrid columns="2" cellpadding="5">
<h:outputLabel for="Show_Bild_Detail_Titel" value="Titel: " />
<h:outputText id="Show_Bild_Detail_Titel"
value="#{handleShowBilder.selectedPic.sTitel}"/>
</h:panelGrid>
</p:outputPanel>
</p:dialog>
</p:dialog>
Secondly the Pics are not Shown?!? But the path is okay, I checked it. (It´s an Absolute Path that is saved in the database)
At next when I press the button to view the details an then It hasn´t got the data...
Here is the bean:
Code: Select all
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package beans;
import database.dbZugriff;
import information.ormapping.Bild;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author CTK
*/
@ManagedBean
@RequestScoped
public class HandleShowBilder
{
private List<Bild> bilder;
dbZugriff dbConn = new dbZugriff();
private Bild selectedPic;
/** Creates a new instance of HandleShowBilder */
public HandleShowBilder()
{
//Gets all the Pics from the Database
bilder = dbConn.getAllBilder();
}
/**
* @return the bilder
*/
public List<Bild> getBilder() {
return bilder;
}
/**
* @param bilder the bilder to set
*/
public void setBilder(List<Bild> bilder) {
this.bilder = bilder;
}
/**
* @return the selectedPic
*/
public Bild getSelectedPic() {
return selectedPic;
}
/**
* @param selectedPic the selectedPic to set
*/
public void setSelectedPic(Bild selectedPic) {
this.selectedPic = selectedPic;
}
}
lg