Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with p:graphicImage and f:param

 
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
 
Weeds: because mother nature refuses to be your personal bitch. But this tiny ad is willing:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!