Fire loading when Calendar is filled

Asked

Viewed 30 times

0

I have a calendar that when I have both dates filled in, I need to trigger the loading/loading and also update the status field with (*). The problem that I can’t load in Calendar follows code below.

Summary: Dates filled in - trigger the loading - update the status field

calendario.xhtml

<rich:calendar enableManualInput="true" datePattern="dd/MM/yyyy" cellWidth="24px" cellHeight="22px" style="width:65px"
               value="#{value}" inputSize="10" inputClass="#{inputClass}" immediate="true" ajaxSingle="true" 
               converterMessage="#{label}: Deve ser uma data válida." showWeeksBar="false" disabled="#{disabled eq null ? false : disabled}">
    <f:convertDateTime pattern="dd/MM/yyyy"/>
    <a4j:support event="onchanged" action="#{action[metodoOnDateSeleted]}" ajaxSingle="true" rendered="#{metodoOnDateSeleted ne null}"
                             onsubmit="showModal();" oncomplete="hideModal();" reRender="#{reRenderOnDateSelected}, value"/>
    <a4j:support event="oninputchange" action="#{action[metodoOnDateSeleted]}" ajaxSingle="true" rendered="#{metodoOnDateSeleted ne null}"  
                             onsubmit="showModal();" oncomplete="hideModal();" reRender="#{reRenderOnDateSelected}"/>
</rich:calendar>
<rich:jQuery selector=".#{inputClass}" timing="onload" query="mask('99/99/9999',{placeholder:' '})" />

another.xhtml

<h:panelGrid columns="2" columnClasses="textoTabelaRelatorio, textoTabela">     
        <h:panelGroup>
            <h:outputText value="Datas:"/>  
        </h:panelGroup>
        <h:panelGroup id="panelCalendar">
            <ui:include src="/calendario.xhtml">
                    <ui:param name="value"                      value="#{bean.dataInicio}" />
                    <ui:param name="inputClass"                 value="maskDate1" />
                    <ui:param name="label"                      value="Data Início" />
                    <ui:param name="reRenderOnDateSelected"     value="situacao" />
            </ui:include>
        
            <h:outputText value=" à "/>     
            
            <ui:include src="/calendario.xhtml">
                    <ui:param name="value"                      value="#{bean.dataTermino}" />
                    <ui:param name="inputClass"                 value="maskDate1" />
                    <ui:param name="label"                      value="Data Fim" />
                    <ui:param name="reRenderOnDateSelected"     value="situacao" />
            </ui:include>
        </h:panelGroup>
        
        <h:panelGroup id="panelSituacao">
            <h:outputText value="Situação:" />
            <h:outputText id="situacao" value="*" styleClass="asterisco" 
                rendered="#{bean.dataInicio ne null and bean.dataTermino ne null}" />
        </h:panelGroup>

    </h:panelGrid>

1 answer

0


I was able to solve it this way:

<ui:param name="metodoOnDateSeleted "       value="dummyMethod" />
<ui:param name="reRenderOnDateSelected"     value="panelSituacao" />
<ui:param name="action"                     value="#{aqui passei minha classe bean}" />

dummyMethod - metodo criado no bean que não faz nada;
panelSituacao id do panel a ser atualizado;
action - classe bean

No outputText eu adicionei a regra:
rendered="#{bean.dataInicio ne null and bean.dataTermino ne null}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.