This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Oct 8, 2014, 10:50 PM
13 Posts
topic has been resolvedResolved

Validation fields only when save button is clicked

  • Category: Other
  • Platform: Windows
  • Release: 9.0.1
  • Role: Developer
  • Tags: Validation
  • Replies: 4

Hello All.

I have designed an xPage with 4 combo boxes, 3 djNumberSpinners and 3djTextAreas that are validate. There is a TabPanel with 4 tabs in this xpages too.

When I click on any tab all error messages display and I can't switch to any tab I wan to validate these fields only when save button is clicked and not on any other event.

I tried with  submittedBy('id_save_button') but it doesn't work in this case. 

One more question  I have a Rich Text in this xpages.How can I validate this rich text.

 Below is cod of validated combo box:

<xp:comboBox

value="#{document1.Customer}" id="customer1"
style="width:114.0px">
<xp:this.validators>
<xp:validateExpression
message="Please select a customer.">
<xp:this.expression><![CDATA[#{javascript:!getComponent("customer1").getSubmittedValue().equalsIgnoreCase("-Please select-")}]]></xp:this.expression>
</xp:validateExpression>
</xp:this.validators>
<xp:selectItem id="selectItem1"
itemLabel="-Please select-">
</xp:selectItem>
 
 
For djNumberSpinner I put requied to true and for djTextArea I used the following code

 

<xe:djTextarea
id="djTextarea1">
<xe:this.required><![CDATA[#{javascript:if (getComponent("djTextarea1").getValue()!=='') {
return true;
}}]]></xe:this.required>
<xe:this.validators>
<xp:validateRequired
message="Please write a request.">
</xp:validateRequired>
</xe:this.validators>
</xe:djTextarea>
 

Thanks in advance.

 

 
 
Oct 12, 2014, 9:56 PM
453 Posts
I have struggled with the validation stuff

In Native Note applications I have generally done all of the field validation in the QuerySave. As yet I have not been able to get the validation in XPages to do what I want which is pretty much what you want as well. I have pretty much come to the same conclusion that I'll do the validation in the querySave event.

Oct 14, 2014, 2:25 PM
586 Posts
well...

Well I've not done much with validation myself yet...  so can't comment on that...

But the basic problem you're having comes from the Tab control.  You're using the built in XPages Tab Control.  What this does is it only send the contents of 1 tab at a time to the browser.  So each type you change tabs causes a partial refresh / round trip to the server. this is why the validation is kicking in.

Use the Dojo Tab control.  That will send everything to the browser and CSJS is used to show the correct tab.  That should eliminate the validation from triggering on a tab change.

Oct 15, 2014, 1:05 AM
13 Posts
Thanks David Leedy for your best answer

It works fine now.

I have a Rich Text in this xpages too. How can I validate this rich text?

Oct 15, 2014, 1:42 AM
13 Posts
Thanks Bill Fox

                                                                                                               


This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal