I have a combo that shows a list of a catalog that is in the database
<h:outputText value="#{datospersonalesmsgs['datospersonales.descuento.title']}:" />
<p:selectOneMenu id="catBeneficio" value="#{DatosPersonalesComponent.solicitudeses.sysBeneficios.idSysBeneficio}" required="false" valueChangeListener="#{DatosPersonalesComponent.obtenerDescuento}">
<p:ajax event="change" update="catBeneficio,dialogBeneficio,dialogDiscapacidad, dialogAgricola" />
<f:selectItem itemLabel="Seleccione" />
<f:selectItems value="#{SysBeneficiosComponent.listSysBeneficioss()}" var="descuentos" itemValue="#{descuentos.idSysBeneficio}" itemLabel="#{descuentos.descripcion}">
</f:selectItems>
</p:selectOneMenu>
And send a call to a method with the Valuelistener, what I want you to do is that if in the combo you select option 5 or 10 that is the id of the catalog, the boolean is true and send me a dialog depending on the option, that dialogue I'm calling in the ajax with the update, but NullPointer tells me in the if and I do not know why it is?
public void obtenerDescuento(ValueChangeEvent event) {
System.out.println("ENTRA A OBTENER DESCUENTO");
if (solicitudeses.getSysBeneficios() != null) {
if (solicitudeses.getSysBeneficios().getIdSysBeneficio().equals(5)) {
System.out.println("ES PERSONA CON DISCAPACIDAD");
msjdiscapacitado = true;
}
if (solicitudeses.getSysBeneficios().getIdSysBeneficio().equals(10)) {
System.out.println("ES TRABAJADOR AGRICOLA");
msjtrabajadoraagricola = true;
}
}
}