How to add your own kdtworkbutton on the easbos workflow approval page

Source: Internet
Author: User

1. In our workflow approval interface, sometimes we need to add a custom approval button. One method is recommended below.

Idea: 1. Implement an interface com. Kingdee. EAS. Framework. Client. workflow. iworkflowuisupport in our custom document editlui. Java

Public interface iworkflowuisupport
{
Public abstract iworkflowuienhancement getworkflowuienhancement ();
}

2. Compile an internal class to implement the iworkflowuienhancement interface or inherit the defaultworkflowuienhancement class. Rewrite the related set and get methods and assign values to the corresponding menu bar and toolbar.

This interface returns an object that can obtain the menu bar and toolbar of the approval interface.

Public interface iworkflowuienhancement
{

Public abstract list getapprovemenus (coreuiobject );

Public abstract list getapporvetoolbuttons (coreuiobject );

Public abstract string getqueryfieldnamebindingwf (coreuiobject );

Public Abstract Boolean enableentryprocess (bosobjecttype)
Throws exception;
}

============================== Specific implementation code ======== ==========================================

Public class vpnuniteditui extends actvpnuniteditui implements
Iworkflowuisupport {

// Implement the interface method. Return a method for obtaining the menu bar and toolbar.
Public iworkflowuienhancement getworkflowuienhancement (){

Demowfenhancement = new demowfenhancement ();
List buttonlist = new arraylist ();
Buttonlist. Add (btnaudit );
Buttonlist. Add (btnunaudit );
Try {
Demowfenhancement. setapporvetoolbuttons (buttonlist );
} Catch (exception e ){
E. printstacktrace ();
}
Return demowfenhancement;

}

/**
*
* On the workflow approval page, you can use getapprovemenus to obtain the menu bar object and getapporvetoolbuttons to obtain the toolbar object.
* You can add a menu bar or toolbar by yourself.
* @ Author Administrator
*
*/
Class demowfenhancement extends defaultworkflowuienhancement {
List menulist = NULL;
List toolbarlist = NULL;
Public list getapprovemenus (coreuiobject uiobject ){
Return menulist;
}

Public list getapporvetoolbuttons (coreuiobject uiobject ){
Return toolbarlist;
}

Public String getqueryfieldnamebindingwf (coreuiobject uiobject ){
Return "ID ";
}

Public Boolean enableentryprocess (bosobjecttype objecttype)
Throws exception {
Return false;
}

Public void settoolbar (list) throws exception {
Menulist = List;
}

Public void setapporvetoolbuttons (list) throws exception {
Toolbarlist = List;

}
}

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.