0

<p:spinner>値が設定範囲内にあるかどうかを検証する必要があります。

<p:spinner id="minutes" min="0" max="1000" value="#{printerSettings.t}"  size ="1">
    <f:validateLongRange minimum="0" maximum="1000" />
    <p:ajax update="NewTime"/>
</p:spinner>
<h:message for="minutes" style="color:red" /> 

<p>Number of copies (Max of 50) :
    <p:spinner id ="Copies" min="1" max="50" value="#{printerSettings.p}" size ="1"> <!-- allows the user a choice of up to 50, this is more than enough for any situation, if needed this can be removed or raised -->
        <p:ajax update="p"/>
        <f:validateLongRange minimum="1" maximum="50" />
    </p:spinner>
    <div class="whiteSpace"/>   
    <h:outputText value="Copies that will be printed: &nbsp; #{printerSettings.p}" id="p"/>

    <h:message for="Copies" style="color:red" />
</p>

これは以前は機能していましたが、現在は検証もエラーも発生しません。これはどのように発生し、どのように解決できますか?

編集

 <div id="site_content">
        <div id="content">
            <h:body>


                <h:form onsubmit="return validateForm()"> 
                    <p>

                    In how many minutes time would you like to have your job sent to the printer ?  
                    <div class="whiteSpace"/>
                    <p:spinner id="minutes" min="0" max="1000" value="#{printerSettings.t}"  size ="1">
                        <p:ajax update="NewTime"/>
                        <f:validateLongRange minimum="1" maximum="1000" />
                    </p:spinner>

                    <h:message for="minutes" style="color:red" />

                    <br></br>
                    <br></br>

                    The time the print job will be sent to the printer will be : 
                    <!--<p:button actionListener="{otherBean.setTValue(printerSettings.t)}" value="Set Val" /> Currently causing an error -->
                    <br></br>
                    <h:outputText value="#{printerSettings.getNewTime()}" id="NewTime"/>
                    <br></br>
                    <br></br>
                    <p:commandButton  type="submit" action="#{email.mail(printerSettings.t, printerSettings.p, printerSettings.paperSize, printerSettings.duplex, printerSettings.orienation, printerSettings.printer)}" onclick="Thankyou()" value="Print" />

<p:button outcome="index" value="Homepage" icon="ui-icon-home">  
                    </p:button>  

                </h:form>
            </h:body>
        </div>
    </div>
    <script type="text/javascript">

                    function Thankyou()
                    {
                        alert("Sent to the printing holding queue, you may close this app now or carry on using this app, your work will still print out ");
                        //location.href = 'index.xhtml';

                    }

それは大丈夫ですか ?私のコメントで述べたように、必要に応じてさらにコードを投稿できます。検証は機能しているようです。現在表示されているのはエラーメッセージだけです

編集

                <p:commandButton  type="submit" update ="minutes2 Copies2"  action="#{email.mail(printerSettings.t, printerSettings.p, printerSettings.paperSize, printerSettings.duplex, printerSettings.orienation, printerSettings.printer)}" onclick="Thankyou()" value="Print" />
4

1 に答える 1