0

I have the following component on the xhtml:

            <p:outputLabel for="concept" value="Concept" />
        <p:selectOneMenu id="concept" value="#{dIGRCController.digrc.qconce}"
            requiredMessage="Debe de seleccionar un concepto."
            required="#{request.getParameter('validate')}">

            <f:selectItem itemLabel="Concept" itemValue="" />
            <f:selectItems value="#{cCRX1Controller.ccrx1.concepts.entrySet()}"
                var="concepts" itemValue="#{concepts.key}"
                itemLabel="#{concepts.value}" />

            <p:ajax event="change" execute="@this" listener="#{dIGRCController.testing()}" />

        </p:selectOneMenu>

The values are coming correctly from the cCRX1Controller class. However, when I select an option, I am trying to display the value. the #{dIGRCController.testing()} looks like this:

public void testing()
{
    System.out.println("sdfsd");
}

What am I doing wrong? I checked this question but could't figure out what the problem is.

Community
  • 1
  • 1
Erick
  • 823
  • 16
  • 37

1 Answers1

1

Try with this

<p:ajax process="@this" listener="#{dIGRCController.testing()}" />

I think the default of ajax event of Primefaces select one menu is valueChange event. So, try with using also

<p:ajax event="valueChange" process="@this" listener="#{dIGRCController.testing()}" />
Zaw Than oo
  • 9,651
  • 13
  • 83
  • 131
Mthk
  • 118
  • 1
  • 2
  • 10