0

I develop an with the following settings: - Client validation is off - I use 1.6 and 8.5.3

There are only two on the page, with required=true attribute.

`

<xp:this.resources>
    <xp:dojoModule name="dijit.form.ValidationTextBox"></xp:dojoModule>
</xp:this.resources>
<xp:this.data>
    <xp:dominoDocument var="document1" formName="form1"></xp:dominoDocument>
</xp:this.data>
<xp:inputText id="inputText1"
    dojoType="dijit.form.ValidationTextBox"
    value="#{applicationScope.test}">
    <xp:this.dojoAttributes>
        <xp:dojoAttribute name="required" value="true"></xp:dojoAttribute>
    </xp:this.dojoAttributes>
</xp:inputText>
<xp:button value="Label" id="button1">
    <xp:eventHandler event="onclick" submit="true"
        refreshMode="complete">
        <xp:this.action>
            <xp:saveDocument var="document1"></xp:saveDocument>
        </xp:this.action>
    </xp:eventHandler>
</xp:button>
<xp:br></xp:br>
<xp:inputText id="inputText2"
    dojoType="dijit.form.ValidationTextBox">
    <xp:this.dojoAttributes>
        <xp:dojoAttribute name="required" value="true"></xp:dojoAttribute>
    </xp:this.dojoAttributes>
</xp:inputText> 
</xp:view>

`

By clicking on the Submit the document is saved to the database.

If I add a from the [tag:extension library], that prevents the submission, the required inputs should be filled first.

`

<xp:this.resources>
    <xp:dojoModule name="dijit.form.ValidationTextBox"></xp:dojoModule>
</xp:this.resources>
<xp:this.data>
    <xp:dominoDocument var="document1" formName="form1"></xp:dominoDocument>
</xp:this.data>
<xp:inputText id="inputText1"
    dojoType="dijit.form.ValidationTextBox"
    value="#{applicationScope.test}">
    <xp:this.dojoAttributes>
        <xp:dojoAttribute name="required" value="true"></xp:dojoAttribute>
    </xp:this.dojoAttributes>
</xp:inputText>
<xp:button value="Label" id="button1">
    <xp:eventHandler event="onclick" submit="true"
        refreshMode="complete">
        <xp:this.action>
            <xp:saveDocument var="document1"></xp:saveDocument>
        </xp:this.action>
    </xp:eventHandler>
</xp:button>
<xp:br></xp:br>
<xp:inputText id="inputText2"
    dojoType="dijit.form.ValidationTextBox">
    <xp:this.dojoAttributes>
        <xp:dojoAttribute name="required" value="true"></xp:dojoAttribute>
    </xp:this.dojoAttributes>
</xp:inputText>
<xe:djNumberSpinner id="djNumberSpinner1"></xe:djNumberSpinner></xp:view>

`

Does anybody know how to fix this?

Any help is appreciated.

Jozsef Lehocz
  • 330
  • 3
  • 21

1 Answers1

0

Have you set dojoParseOnLoad to "true" on the XPage? It sounds like you may not have done, in which case the xp:inputTexts are not converted to Dojo Validation TextBoxes.

However, as soon as you add the Extension Library Number Spinner, that control automatically adds dojoParseOnload to the XPage even if you haven't specified it. And so your Validation Text Boxes would also immediately work.

Also, because you're using Dojo controls, switching Client Side Validation off is irrelevant. Dojo validation can only work client side. You cannot use a Dojo control and run the validation server side.

Paul Stephen Withers
  • 15,699
  • 1
  • 15
  • 33
  • Thank you for the answer. I have set up the parseonload true, this stackoverflow editor cuts the first lines of the source code.

    Everything occures on the client side including the validation which prevents the submission.

    – Jozsef Lehocz Aug 25 '12 at 18:32
  • I have added another question about this problem with the html source of the xpage. For me it seems, that Xtension library automatically adds dijit.form.Form to the form of the page in the browser and this seems prevent the saving of the document or a partial refresh. – Jozsef Lehocz Aug 25 '12 at 19:35