在panelGrid

时间:2016-03-10 15:08:34

标签: jsf primefaces selectonemenu responsiveness panelgrid

在下面的代码中,当我为panelGrid定义属性layout="grid"时,“periodo Letivo”的ajax事件不起作用。它应该加载“cadeira”组件。如果我删除了布局属性,它工作正常,但我失去了响应能力。

如果有人可以帮助我,谢谢。

<p:panelGrid columns="2" layout="grid" style="border:0px !important; background:none;" styleClass="ui-panelgrid-blank ui-fluid">
    <p:outputLabel for="periodoLetivo" value="Período letivo" />
    <p:selectOneMenu id="periodoLetivo"
        value="#{viewForm.periodoLetivo}"
        converter="#{genericConverter}" immediate="true"
        required="true">

        <f:selectItem itemLabel="[-SELECIONE-]"
            noSelectionOption="true" />
        <f:selectItems value="#{periodosLetivos}" var="periodoLetivo"
            itemLabel="#{periodoLetivo.nome}" itemValue="#{periodoLetivo}" />
        <p:ajax event="change" update="cadeira" process="periodoLetivo" />
    </p:selectOneMenu>

    <p:outputLabel for="cadeira" value="Disciplina" />
    <p:selectOneMenu id="cadeira" value="#{viewForm.cadeira}"
        converter="#{genericConverter}" required="true">
        <f:selectItem itemLabel="[-SELECIONE-]"
            noSelectionOption="true" />
        <f:selectItems value="#{viewForm.cadeiras}" />
    </p:selectOneMenu>
</p:panelGrid>

1 个答案:

答案 0 :(得分:0)

我解决了这个问题,用<p:ajax event="change" update="cadeira" process="periodoLetivo" />替换<f:ajax event="change" render="cadeira"></f:ajax>