Code in jsf
Code: Select all
<p:layout>
<p:layoutUnit position="west" size="200" minSize="40" maxSize="200">
....
<p:commandButton value="search" ..../>
</p:layoutUnit>
<p:layoutUnit position="center">
<p:panel id="out">
<p:dataGrid var="biz" value="#{mBean.dataList}" columns="3"
layout="grid" rows="12" paginator="true" id="var"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="6,12,16">
<p:panel style="text-align:center">
<p:graphicImage value="#{mBean.image}" width="300"
height="300" cache="false">
<f:param name="photoId" value="#{var.fullPath}" />
</p:graphicImage>
<h:outputLabel value="#{var.fullPath}" />
..................
</p:panel>
</p:dataGrid>
</p:panel>
</p:layoutUnit>
</p:layout>
Code: Select all
public StreamedContent getImage() {
String fileFullPath = FacesUtil.getRequestParameterValue("photoId");
if (logger.isLoggable(Level.INFO)) {
logger.info("File full path: " + fileFullPath);
}
return FileUtil.genProfileImage(fileFullPath);
}
public static String getRequestParameterValue(String key) {
if (logger.isLoggable(Level.INFO)) {
Set<String> itemKeySet = FacesContext.getCurrentInstance()
.getExternalContext().getRequestParameterMap().keySet();
for (String itemKey : itemKeySet) {
logger.info("itemKey: "
+ itemKey
+ " : value: "
+ FacesContext.getCurrentInstance()
.getExternalContext().getRequestParameterMap()
.get(itemKey));
}
}
return FacesContext.getCurrentInstance().getExternalContext()
.getRequestParameterMap().get(key);
}
I am wondering is it the related to the p:layoutUnit. I found only partial of parameter exists in FacesContext.getCurrentInstance().getExternalContext() .getRequestParameterMap(), and all the existing parameter is located in one of the p:layoutUnit position="west", but all elements in position="center" never appear in the RequestParameterMap.