• Validation when "actionSaveAsDraft" executed...

    By artur weiner 1 decade ago

    hello

    If i use the actionSaveAsDraft property of the workflow action control it is validating the content by default and i do not have a chance to save that document until validation passes. Or is it possible to disable validation somewhere? If so can you tell me where?

    regards

    artur 

    • Workaround

      By Lena Troxler 1 decade ago

      As far as I can see the 'Save As Draft' Button gets the ID: "wkWorkflowActions2_save" 

       

      Therefore I use the following workaround

      I wrote a function to disable the Validators:

      function disableWorkflowValidators(buttonName){
       var button:com.ibm.xsp.component.xp.XspCommandButton = getComponent(buttonName);
       if(button != null){
        button.setDisableValidators(true);
        var children:java.util.List = button.getChildren();
        if(children != null){
         for(i=0; i < children.size(); i++){
          if("WorkflowHandler".equalsIgnoreCase(children.get(i).getClass().getSimpleName())){
      //extends com.ibm.xsp.component.xp.XspEventHandler
           var child:com.ibm.xsp.xflow.component.UIWorkflowActions.WorkflowHandler = children.get(i);
           child.setDisableValidators(true);
          }
         }
        }
       }
      }

      This function is called beforeRenderResponse:

      disableWorkflowValidators("wkWorkflowActions2_save");

       

      This seems to work quite well.