Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

f:param not working as advertised  RSS feed

 
Ian Dunsirn
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a command button coded as follows:

<h:commandButton image="images/DeleteButton.gif"
rendered="#{fieldList.systemDefined == false && fieldList.inUse == false}"
action="#{projectListener.deleteUIFields}">
<f:param id="deleteThis" value="{#fieldList.fieldID}"/>
</h:commandButton>

According to several examples I have found searching online, I supposedly can retrieve this param by using this code in my listener:

String deleteThis = context.getExternalContext().
getRequestParameterValuesMap().get("deleteThis").toString();

However, when I run my program I get a null pointer exception. I took a look at what context.getExternalContext().
getRequestParameterValuesMap() returns and I do not see "deleteThis" in there at all.

What does one have to do to get f:param to work as all these examples I run across says it should?

Thanks,
* Dunsirn
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

That's not valid EL. And using f:param in a commandButton isn't going to work. Use f:attribute instead, or rather use h:inputHidden so that the fieldID is available in the next request.

Wild guess (and looking to your other topics) is that you're using a datatable, if this is the case, then there are much better ways to retrieve the selected row. I already have posted that in your other topics.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!