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



Apr 4, 2011, 10:55 AM
9 Posts

Validation on an XPage

  • Category: Other
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: Tabbed panel,validation
  • Replies: 2
 
Dumb question time...
 
I  have a tabbed panel and in one of the tabs there is a control that submits data. If I use the built in 'required field' validation for the edit boxes, I can't navigate away from the tab unless I submit.
 
How can I easily stop the validation triggering when I want to navigate away to another tab? Or should I just forget about using the built in required field validation'?
 
Thanks
Apr 4, 2011, 4:51 PM
1 Posts
Re: Validation on an XPage
I used the Dojo Tab Container and Tab Panel control from the XPages Extension Library to solve this problem.
http://extlib.openntf.org/
 
I wanted a save as draft option on a page that has the lotus tab control. However, when I click on a tab it submits the validation for the page. Even when you set disableValidators="true".
 
Besides the Dojo layout controls I added these buttons for the save as draft and submit.
Save as draft button
    <xp:button value="Save as Draft" id="buttonSaveAsDraft"
        styleClass="lotusBtnSpecial"
        rendered="#{javascript:document1.isEditable()}">
        <xp:eventHandler event="onclick" submit="true"
            refreshMode="complete" immediate="false" save="true"
            disableValidators="true" />
    </xp:button>

Submit button
    <xp:button value="Submit" id="button1" styleClass="lotusBtnSpecial"
        rendered="#{javascript:document1.isEditable()}">
        <xp:eventHandler event="onclick" submit="true"
            refreshMode="complete" immediate="false" save="true" />
    </xp:button>
 
There could be better options for handling this issue but the above worked for me.
Apr 5, 2011, 10:39 PM
122 Posts
Re: Validation on an XPage
The problem is the XPages Tabbed Panel is doing a partial refresh to load the separate tab (if you view the source you'll see only the current tab is passed to the server).
 
If you use the manual Dojo TabContainer (rather than the extension library one or the XPages one) I think that will also allow you to navigate between tabs without validation. However, be careful that the validation triggers and works as you want it to when you finally submit. With the Dojo TabCotainer outside of XPages in Dojo 1.3.2 I had problems that it couldn't correctly validate content on a tab that wasn't visible. Equally the client-side validation in XPages tries to put focus into the invalid field, which may not be possible if it's on a tab that's not visible. Server-side validation may work if your Error Messages control is outside the tabbed panel.

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