Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with p:graphicImage and f:param  RSS feed

 
D. Formenton
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a table with a column showing an image:

<p:dataTable value="#{articoliController.items}" var="item" >
...
<p:column style="width: 30px;" >
<p:graphicImage value="#{articoliController.dynamicImg}"
height="30px" width="30px">
<f:param name="itemId" value="#{item.id}" />
</p:graphicImage>
</p:column>
</p:dataTable>


and the backing bean:

@ManagedBean(name = "articoliController")
@SessionScoped
public class ArticoliController implements Serializable {
...
public StreamedContent getDynamicImg() {
Map<String,String> params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
String sId = params.get("itemId"); <---- Break point to see params contents
...
}
}

The problem is that the value returned from params is null. I.e. params map has no row with key = "itemId", it seems that <f:param... /> does not work.

Where the mistake is?
I spent a couple of days without find it.

Thank you and Merry Christmas!

Domenico
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hint:at what event you want this param on backing bean?
 
D. Formenton
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I don't know wich event I have to choice, I wold like that image will show as other fields in the table.

To show text fields I don't have to choice any event, the rows flows one after other, why is not possible to show an image in the same manner?

Thank you.

Domenico
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!