jsf core tag <f:param> doesnt work with <h:commandButton> but work with <h:commandLink>

J

Janaka Perera

Hi All,

I tried to get a input parameter for the server side using the jsf
core libabray tag 'param' as shown in below with a <h:commandButton>,
but it never worked. The serverside variable was always null. All the
examples i saw on the internet was described using <h:commandLink>. So
when i check the 'param' tag using <h:commandLink> it worked. I got
the value in the serverside properly.

It there a way to use the <param> tag with <h:commandButton> as well.
or is it just for the <h:commandLink>?

Thanks
Janaka


Doesnt Work
<h:commandButton value=" [Remove Package] "
action="#{PackageManagementBean.deletePackage}">
<f:param value="#{package.id}" name="packageIdParam"/>
</h:commandButton >


Working
<h:commandLink value=" [Remove Package] "
action="#{PackageManagementBean.deletePackage}">
<f:param value="#{package.id}" name="packageIdParam"/>
</h:commandLink>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top