如何在<p:dialog>

时间:2018-05-02 02:19:49

标签: validation jsf primefaces

所以,基本上我只是想设置inputTextArea验证不是null / required = true,但是当我设置它时,它也会影响其他按钮。所以,我应该设置参数,它不会影响其他按钮。

但是,它使验证无效。这是我的代码:

    <p:dialog id="ajaxdialogs" header="Hapus Data" modal="true" widgetVar="dlg1" showEffect="fade" hideEffect="fade" closable="true"> 
    <p:messages id="errorx"></p:messages>
    <h:panelGrid columns="1">
        <p:outputLabel value="Anda yakin ingin menghapus #{empGradeBacking.selectedEmp.empGradeName}?"></p:outputLabel>
        <h:panelGrid styleClass="reasonDown">
            <p:outputLabel value="Alasan "></p:outputLabel> 
            <p:inputTextarea required="#{param['form:inputtext']==null} true" value="#{empGradeBacking.selectedEmp.deletedReason}" cols="40" rows="5" minQueryLength="1" counter="display" maxlength="200" autoResize="false"  counterTemplate="{0} karakter tersisa" validatorMessage="alasan tidak boleh kosong"></p:inputTextarea>
            <h:outputText id="display" styleClass="charremaining"></h:outputText>
        </h:panelGrid>
    </h:panelGrid>
    <h:panelGrid styleClass="addDeleteDown" columns="2">
        <p:commandButton id="inputtext" ignoreAutoUpdate="true" value="#{UIBundle['text.page.button.yes']}" actionListener="#{empGradeBacking.deleteEmpGrade}" icon="ui-icon-check" oncomplete="if (!args.validationFailed) PF('dlg1').hide()" update="errorx @([id$=empB])"></p:commandButton>
        <p:commandButton value="#{UIBundle['text.page.button.no']}" type="button" onclick="PF('dlg1').hide()" icon="ui-icon-close" immediate="true"/>
    </h:panelGrid>
</p:dialog>
    </p:tab>
</p:tabView>

0 个答案:

没有答案