home
design & development
Lotus application development
print design
web site development
request a design quote
solutions & consulting
Notes and Domino application development
Lotus Domino administration
Securence Mail Filtering
UNITRENDS backup and recovery
Lotus Notes / Domino Apps
free Lotus Notes apps
hosting
web site hosting
Lotus application hosting
check your mail
request a hosting quote
publishing
media and publishing
sound
client services
help & support
Make Payment
Client Access - Workboard
billing & payment policies
copyright & liability policies
pricing & turnaround policies
privacy statement
contact
e-mail MW
get files
send files
Restrict SS/Server Side Validation to Only Fire when Button Clicked (and NOT Partial Refresh)
Mindwatering Incorporated
Author: Tripp W Black
Created: 12/11/2011 at 01:01 PM
Category:
Notes Developer Tips
XPages
Issue:
You have a Tabbed Panel or a partial refresh to compute some computedFields. Only problem is the fields that have validation inside that section fire their validation. How do you turn this off except for the buttons? (e.g. save/submit, and approve buttons)
Solution:
For the fields w/validation, go to the All Properties (side tab under Properties tab) --> basics --> required. It will be set to true. Change it something like the following:
return ( submittedBy( 'wp_BtnAppr' ) || submittedBy( 'wp_BtnSave' ) );
Uses function below (created by a developer named Tommy). Add the function to a Server-side JavaScript (SSJS) library. Then add the library to the XPage as a resource.
// Used to check which if a component triggered an update
function submittedBy( componentId ){
try {
var eventHandlerClientId = param.get( '$$xspsubmitid' );
var eventHandlerId = @RightBack( eventHandlerClientId, ':' );
var eventHandler = getComponent( eventHandlerId );
if( !eventHandler ){ return false; }
var parentComponent = eventHandler.getParent();
if( !parentComponent ){ return false; }
return ( parentComponent.getId() === componentId );
} catch( e ){ /*Debug.logException( e );*/ }
}
previous page