0

I have a controller named clController. This controller has code property and I want to send this code property a value.

<h:form>
    <h:inputHidden value="#{item.code}" />
    <h:commandLink action="#{clController.getByCode()}" value="#{item.code}" />
</h:form>

above code is in a datatable. How can i send item.code value to this property?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555

1 Answers1

2

You can either use a

<f:setPropertyActionListener target="#{clController.code}" value="#{item.code}">

if you use JSF 2.0, or simply change the signature of your action method to getByCode(YourClass code) and pass the value as a parameter

<h:commandLink action="#{clController.getByCode(item.code)}" value="#{item.code}" />
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Jan Piel
  • 540
  • 2
  • 6
  • Stop using `` tags and read message formatting rules behind the `[?]` icon in the message editor :) – BalusC Apr 19 '13 at 12:53