0

Here is the html code for that:

<h:form>
        <h:selectOneMenu value="#{worldCupData.worldCup}"
            converter="omnifaces.SelectItemsConverter">
            <f:selectItems value="#{worldCupData.worldCups}" var="worldCup"
                itemValue="#{worldCup}"
                itemLabel="#{worldCup.year}, #{worldCup.host}"></f:selectItems>
        </h:selectOneMenu>
        <p></p>
        <h:commandButton id="selectCupButton" value="Submit" action="#{countryData.getCountries(worldCup.year)}">
        </h:commandButton>
    </h:form>

I have a method in my CountryData class called getCountries(String year) that should be called when the submit button is pressed. I am trying to pass the #{worldCup.year} value to the method.

Is this how methods are referenced in EL for JSF? Am I doing this right?

Kingamere
  • 9,496
  • 23
  • 71
  • 110

0 Answers0