Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 选择日期后尝试填充h:SelectOne菜单_Jsf_Primefaces - Fatal编程技术网

Jsf 选择日期后尝试填充h:SelectOne菜单

Jsf 选择日期后尝试填充h:SelectOne菜单,jsf,primefaces,Jsf,Primefaces,此时,我的代码正常工作,但如果我想获得正确的信息,我必须选择两次日期。我试图将ajax事件更改为dateSelect,但它在我的URL中添加了一个哈希,什么也不做。我只想保持它当前的行为,但只选择一次日期 提前谢谢 <h:form> <h:panelGrid columns="2"> <h:outputLabel for="medico" value="Médico:" /> <h:inputText id="med

此时,我的代码正常工作,但如果我想获得正确的信息,我必须选择两次日期。我试图将ajax事件更改为dateSelect,但它在我的URL中添加了一个哈希,什么也不做。我只想保持它当前的行为,但只选择一次日期

提前谢谢

<h:form>
   <h:panelGrid columns="2">
        <h:outputLabel for="medico" value="Médico:" />
        <h:inputText id="medico" value="#{pacienteControlador.pacienteActual.medico.nombre} #{pacienteControlador.pacienteActual.medico.apellidos}" disabled="true"/>
        <p:outputLabel for="fecha" value="Fecha:" />
        <p:calendar id="fecha" value="#{pacienteControlador.calendarManagedBean.date}" pattern="dd/MM/yyyy">
            <f:ajax event="blur" listener="#{pacienteControlador.citasDisponibles()}" render="hora" />
        </p:calendar>
        <p:outputLabel for="hora" value="Hora:" />
        <h:selectOneMenu id="hora" value="#{pacienteControlador.horaCita}">
            <f:selectItems value="#{pacienteControlador.listaHorasLibres}" />
        </h:selectOneMenu>
    </h:panelGrid>
    <h:commandButton value="Crear" action="#{pacienteControlador.crearCita()}"/>
</h:form>

解决方案:

使用p:ajax代替f:ajax

<p:ajax event="dateSelect" listener="{pacienteControlador.citasDisponibles()}" update="hora" />