Agentflow
V3.1

pe.pase
Interface FormAPI


public interface FormAPI

Methods defined in this interface can be invoked through default object Form in Agentflow scripts.

ex: Form.getCurrentTask();

The definition of Form and Component can be referenced in other technical report

Since:
version 1.0.0
Version:
1.1.5,
Author:
yschen
See Also:
ClientAPI, ServerAPI

Method Summary
 void addDataInvalidMsg(java.lang.String message)
          Gather the error message of data invalid.
 void clearDataInvalidMsgs()
          Clear the error messages of data invalid.
 boolean closeForm()
          Close the current artifact form.
 void downloadFile(java.lang.String path, java.lang.String fileName)
          download file fileName in path path Note: Applet WebForm not implement this function.
 void downloadFileCustom(java.lang.String path, java.lang.String pathDisplayObject)
          download file which file name is specified in pathDisplayObject field from path Note: Applet WebForm not implement this function.
 void downloadFileCustom(java.lang.String path, java.lang.String pathDisplayObject, int row, int column)
          download file which file name is specified in row row column column of pathDisplayObject table of form from path Note: Applet WebForm not implement this function.
 void enableZeroedCheck(boolean isDoCheck)
          Enable the function that checks textfields are zeroed or not by system.
 java.applet.AppletContext getAppletContext()
          get Applet context.
 java.lang.String getArtifactID()
          Returns the current artifact id by which the form is operated.
 PASEartInstance getArtInstance()
          Returns the current artifact instance by which the form is operated.
 java.lang.String getArtInstanceID()
          Returns the current artifact instance id by which the form is operated.
 ClientAPI getClient()
          Returns the current member by which the form is operated.
 java.lang.Object getComponent(java.lang.String cmp)
          Get the component with the specified component name.
 java.util.Vector getComponentList()
          Get all components.
 java.util.Vector getComponentNames()
          Get all components' name.
 double getCurrencyValue(java.lang.String cmp)
          Get the currency value of the specified component.
 Task getCurrentTask()
          Returns the current task where the form is operated.
 java.lang.String getCurrentTaskID()
          Returns the current task id where the form is operated.
 java.util.Vector getDataInvalidMsgList()
          Get the error messages of data invalid.
 double getFloatValue(java.lang.String cmp)
          Get the double value of the specified component.
 double getFormatValue(java.lang.String cmp, java.lang.String formatStr)
          Get the double value with user specified format from a component.
 javax.swing.JPanel getFormPanel()
          Get the form panel which implements the FormAPI Note: JSP WebForm not implement this function.
 javax.swing.JPanel getFrame()
          Get the frame which contains from panel Note: JSP WebForm not implement this function.
 int getIntValue(java.lang.String cmp)
          Get the int value of the specified component.
 FormAPI getParentForm()
          Get the parent form.
 java.lang.String getScriptLibrary(java.lang.String scriptName)
          Get the script with the specified script library name.
 java.lang.Object getValue(java.lang.String cmp)
          Get the value of the specified component.
 boolean isCloseForm()
          Get if close form window.
 boolean isEnableZeroedCheck()
          see if doing zeroed check or not.
 boolean isRefreshParentForm()
          Get if refresh parent form to update data.
 void openRoleTree(boolean multi, java.lang.String retObjectText, java.lang.String retObject, java.lang.String retAttr)
          Open Role tree window for selecting specified member.
 void openRoleTreeCustom(boolean multi, java.lang.String rootNode, java.lang.String leafType, java.lang.String callBack, java.lang.String fieldList, java.lang.String retObjectText, java.lang.String retObject, java.lang.String retAttr)
          Open Role tree window for selecting specified member, role, department or company, and retrieve data which could be used in future use For example, in the organization, the root company has 3 sub companies: A, B and C.
 void openRoleTreeCustom(boolean multi, java.lang.String rootNode, java.util.Vector leafType, java.lang.String callBack, java.lang.String fieldList, java.lang.String retObjectText, java.lang.String retObject, java.lang.String retAttr)
          Open Role tree window for selecting specified member, role, department or company, and retrieve data which could be used in future use For example, in the organization, the root company has 3 sub companies: A, B and C.
 void openRoleTreeCustom(boolean multi, java.lang.String rootNode, java.util.Vector leafType, java.lang.String callBack, java.lang.String fieldList, java.lang.String retObjectText, java.lang.String retObject, java.lang.String retAttr, boolean disableOrgFilter)
          Open Role tree window for selecting specified member, role, department or company, and retrieve data which could be used in future use For example, in the organization, the root company has 3 sub companies: A, B and C.
 void openRoleTreeCustom(boolean multi, java.lang.String rootNode, java.util.Vector leafType, java.lang.String callBack, java.lang.String fieldList, java.lang.String retObjectText, java.lang.String retObject, java.lang.String retAttr, boolean disableOrgFilter, java.lang.String roleTreeMode)
          Open Role tree window for selecting specified member, role, department or company, and retrieve data which could be used in future use For example, in the organization, the root company has 3 sub companies: A, B and C.
 void openUploadFileWin(java.lang.String path, java.lang.String pathDisplayObject)
          Open upload file dialog, after uploading file, save file to specified path and fill file name to pathDisplayObject field Note: Applet WebForm not implement this function.
 void openUploadFileWin(java.lang.String path, java.lang.String pathDisplayObject, int row, int column)
          Open upload file dialog, after uploading file, save file to specified path and fill file name to row row column column in pathDisplayObject table Note: Applet WebForm not implement this function.
 void removeDataInvalidMsg(java.lang.String message)
          Remove the error message of data invalid.
 void setCloseForm(boolean b)
          Set if close form window.
 void setComplete(boolean bComplete)
          Set the form can be complete or not.
 void setCurrencyValue(java.lang.String cmp, double value)
          Set the currency value of the specified component.
 void setDataInvalidMsgList(java.util.Vector list)
          Set the error messages of data invalid.
 void setFloatValue(java.lang.String cmp, double value)
          Set the double value of the specified component.
 void setFormatValue(java.lang.String cmp, double value, java.lang.String formatStr)
          Set the double value with user specified format to a component.
 void setIntValue(java.lang.String cmp, int value)
          Set the int value of the specified component.
 void setParentForm(FormAPI parentForm)
          Set the parent form.
 void setRefreshParentForm(boolean b)
          Set if refresh parent form to update data.
 void setValidateComplete(boolean bComplete)
          Set the form's validation can be complete or not.
 void setValue(java.lang.String cmp, java.lang.Object value)
          Set the value of the specified component.
 void showMessageDialog(java.lang.String message)
          Show message dialog Examples: Form.showMessageDialog();
 

Method Detail

addDataInvalidMsg

void addDataInvalidMsg(java.lang.String message)
Gather the error message of data invalid. These messages will be show with the error message of DataValidatoin, when the DataValidation has completed.

Examples:

        Form.addDataInvalidMsg("The telephone can't be empty!");
        

Parameters:
message - the given message
Since:
version 2.1

clearDataInvalidMsgs

void clearDataInvalidMsgs()
Clear the error messages of data invalid.

Examples:

        Form.clearDataInvalidMsgs();
        

Since:
version 2.1

closeForm

boolean closeForm()
Close the current artifact form.

Examples:

        var artExitStateID = "AST0371992486182500";
        var task = Form.getCurrentTask();
        if (Client.checkTaskComplete(task)) {
                var Result = Form.closeForm();
                returns true if it closes successfully ;false otherwise
                Client.completeTask(task,artExitStateID);
        }
        

Returns:
true if it closes successfully; false otherwise
Since:
version 1.0.3

downloadFile

void downloadFile(java.lang.String path,
                  java.lang.String fileName)
download file fileName in path path Note: Applet WebForm not implement this function.

Examples:

        Form.downloadFile("C:\\formFile\\", "foo.txt");
        

Parameters:
path - specify file path
fileName - specify file you want to download
Since:
version 2.0

downloadFileCustom

void downloadFileCustom(java.lang.String path,
                        java.lang.String pathDisplayObject)
download file which file name is specified in pathDisplayObject field from path Note: Applet WebForm not implement this function.

Examples:

        Form.downloadFileCustom("C:\\formFile\\", "FTextField0");
        

Parameters:
path - specify file path that you want to store
pathDisplayObject - specify name of form TextField component that display file name of downloaded file
Since:
version 2.0

downloadFileCustom

void downloadFileCustom(java.lang.String path,
                        java.lang.String pathDisplayObject,
                        int row,
                        int column)
download file which file name is specified in row row column column of pathDisplayObject table of form from path Note: Applet WebForm not implement this function.

Examples:

        Form.downloadFileCustom("C:\\formFile\\", "FTableScrollPane0", 0, 1);
        

Parameters:
path - specify file path that you want to store
pathDisplayObject - specify name of form component that display file name of downloaded file
row - specify row of table component
column - specify column of table component
Since:
version 2.0

enableZeroedCheck

void enableZeroedCheck(boolean isDoCheck)
Enable the function that checks textfields are zeroed or not by system. This API is implemented for JSP form.

Examples:

        Form.enableZeroedCheck(true);//turn on checking
        

Parameters:
boolean - of doing check or not
Since:
version 2.3.1

getAppletContext

java.applet.AppletContext getAppletContext()
get Applet context. This method only used by Applet Form. JSP Form AND Agenda Form will return null.

Returns:
the applet context
Since:
version 2.0.4

getArtifactID

java.lang.String getArtifactID()
Returns the current artifact id by which the form is operated.

Examples:

        var aID  = Form.getArtifactID();
        var Artifact = Client.getArtifact(aID);
        //returns a Artifact object
        

Here are some more examples of how Artifact can be used:

        var ArtifactName = Artifact.getName();
        //returns artifact name is like "ApplyForm"

        var ArtifactID   = Artifact.getID();
        //returns artifact id is like "ART0099992486182440"
        

Returns:
the id
Since:
version 1.0.0

getArtInstance

PASEartInstance getArtInstance()
Returns the current artifact instance by which the form is operated.

Examples:

        var PASEartInstance  = Form.getArtInstance();
        //returns PASEartInstance object
        

Here are some more examples of how PASEartInstance can be used:

        var PASEartState = PASEartInstance.getArtState();
        var ArtStateID = PASEartState.getID();
        //returns the identifier of the artifact state is like "AST0371992486182500"

        var ArtStateName = PASEartState.getName();
        //returns the name of the artifact state is like "State1"

        var ArtStateCond = PASEartState.getCondition();
        //returns the rule of condition verifying is like "TextArea1 > 400 AND RadioButton1 != true "
        

Returns:
the artifact instance
Since:
version 1.0.0
See Also:
PASEartInstance

getArtInstanceID

java.lang.String getArtInstanceID()
Returns the current artifact instance id by which the form is operated.

Examples:

        var iID  = Form.getArtInstanceID();
        var PASEartInstance = Client.getArtInstance(iID);
        //returns PASEartInstance object
        

Here are some more examples of how PASEartInstance can be used:

        var ArtifactName = PASEartInstance.getName();
        //returns artifact name is like "ApplyForm"

        var ArtifactID   = PASEartInstance.getArtifactID();
        //returns artifact id is like "ART0099992486182440"
        

Returns:
the id
Since:
version 1.0.0

getClient

ClientAPI getClient()
Returns the current member by which the form is operated.

Examples:

        var MyClient = Form.getClientAPI();
        var Member = MyClient. getCurrentMember();
        var MemID  = Member.getID();
        //returns member id is like "MEM0000992492169920"
        var MemName = Member.getName();
        //returns member name is like "JackLin"
        

Returns:
the client
Since:
version 1.0.0
See Also:
ClientAPI

getComponent

java.lang.Object getComponent(java.lang.String cmp)
Get the component with the specified component name.

Examples:

        var MyPane = Form.getComponent("Table1");
        var table  = MyPane.getViewport().getView();

        // Get first Column Header Value
        var HeaderValue = table.getColumnModel().getColumn(0).getHeaderValue();
        //returns the title of this column header is like "column1"

        // Set first Column Header Value
        table.getColumnModel().getColumn(0).setHeaderValue("NewHeaderValue");

        MyPane.repaint();
        

Parameters:
cmp - the given component name
Returns:
the component
Since:
version 1.0.0

getComponentList

java.util.Vector getComponentList()
Get all components.

Examples:

        var CmpList = Form.getComponentList();
        if(CmpList != null) {
                for(var i=0;i<CmpList.size();i++){
                        var Component = CmpList.get(i);
                        //returns an Object
                }
        }
        

Returns:
the component vector (each element in Vector is a Object)
Since:
version 1.0.3

getComponentNames

java.util.Vector getComponentNames()
Get all components' name.

Examples:

        var CmpNames = Form.getComponentNames();
        if(CmpNames != null) {
                for(var i=0;i<CmpNames.size();i++){
                        var Name = CmpNames.get(i);
                        //returns an String
                }
        }
        

Returns:
the components' name vector (each element in Vector is a String)
Since:
version 2.1

getCurrencyValue

double getCurrencyValue(java.lang.String cmp)
Get the currency value of the specified component.

Examples:

        var Result = Form.getCurrencyValue("TextField1");
        //returns the double value with currency format is like NT$1,000.00
        

Parameters:
cmp - the given component name
Returns:
an double value
Since:
version 1.0.0

getCurrentTask

Task getCurrentTask()
Returns the current task where the form is operated.

Examples:

        var task = Form.getCurrentTask();
        var PrjID = task.getProjectID();
        //returns project id is like "PRJ0023992486182440"
        var DepID = task.getDepartmentID();
        //returns department id is like "DEP935743849000"
        var rID = task.getRoleID();
        //returns role id is like "ROL936011641760"
        
We strongly suggest you NOT to get data from Task at Client Side Script by this method after the Task was updated by running AF Script. In this case, you should get it through ClientAPI.

Examples:

        var taskId = Form.getCurrentTask().getID();
        var task = Client.getTask(taskId);
        

Returns:
the task
Since:
version 1.0.0
See Also:
Task, ClientAPI

getCurrentTaskID

java.lang.String getCurrentTaskID()
Returns the current task id where the form is operated.

Examples:

        var taskId = Form.getCurrentTaskID();
        var task = Client.getTask(taskId);
        

Returns:
the task id
Since:
version 3.5.0

getDataInvalidMsgList

java.util.Vector getDataInvalidMsgList()
Get the error messages of data invalid.

Examples:

        var list = Form.getDataInvalidMsgList();
        

Returns:
the list
Since:
version 2.1

getFloatValue

double getFloatValue(java.lang.String cmp)
Get the double value of the specified component.

Examples:

        var Result = Form.getFloatValue("TextField1");
        //returns the int value of specified component name is like 100.0
        

Parameters:
cmp - the given component name
Returns:
an double value
Since:
version 1.0.0

getFormatValue

double getFormatValue(java.lang.String cmp,
                      java.lang.String formatStr)
Get the double value with user specified format from a component. About the Format pattern, you can refer to java.text.DecimalFormat class and get more detail about it.

Here are some common characters used in the Format Pattern:

        Symbol  Description
        0       a digit but not to show zero as absent
        #       a digit always show zero as absent
        .       decimal point
        ,       grouping separator
        -       the negative sign

        

Examples:

        Form.setFloatValue("TextField1",12345.6789);
        var formatStr = "NT$#,##0.####";
        var Result = Form.getFormatValue("TextField1",formatStr);
        //returns the double value with user specified format is like NT$12,345.6789
        

Parameters:
cmp - the given component name
formatStr - the given a decimal format String
Returns:
an double value with user specified format
Since:
version 1.0.0

getFormPanel

javax.swing.JPanel getFormPanel()
Get the form panel which implements the FormAPI Note: JSP WebForm not implement this function.

Examples:

        var panel = Form.getFormPanel();
        java.lang.System.out.println(panel.getClass());
        

Returns:
the form panel which implements the FormAPI
Since:
version 1.1

getFrame

javax.swing.JPanel getFrame()
Get the frame which contains from panel Note: JSP WebForm not implement this function.

Examples:

        var frame = Form.getFrame();
        frame.setIconified(true);
        

Returns:
the frame which contains form panel
Since:
version 1.1

getIntValue

int getIntValue(java.lang.String cmp)
Get the int value of the specified component.

Examples:

        var Result = Form.getIntValue("TextField1");
        //returns the int value of specified component name is like 100
        

Parameters:
cmp - the given component name
Returns:
an int value
Since:
version 1.0.0

getParentForm

FormAPI getParentForm()
Get the parent form.

Examples:


  //In "Parent" form : Create the form panel of specified insID
  var insID = Form.getValue("TextField1");
  Client.createForm(insID,"",true);

  //In the "Created" form : Get the parent form, set the value of parent form
  var parentForm = Form.getParentForm();
  if (parentForm != null){
          var value = parentForm.getValue("input");
          java.lang.System.out.println("parent input value : " + value);
          parentForm.setValue("display",value);
  }else{
          java.lang.System.out.println("ParentForm is null");
  }

  //In the "Created" form : Close the "Created" form
  Form.closeForm();

        

Since:
version 1.2

getScriptLibrary

java.lang.String getScriptLibrary(java.lang.String scriptName)
Get the script with the specified script library name.

Examples:

        var text = Form.getScriptLibrary("Script11");
        

Parameters:
scriptName - the given script library name
Returns:
the text of specified script library
Since:
version 3.0

getValue

java.lang.Object getValue(java.lang.String cmp)
Get the value of the specified component.

Examples:

        var Result = Form.getValue("TextArea1");
        //returns the value of specified Component Name
        

Parameters:
cmp - the given component name
Returns:
the component
Since:
version 1.0.0

isCloseForm

boolean isCloseForm()
Get if close form window. Note: Applet WebForm not implement this function.

Examples:

        var result = Form.isCloseForm();
        

Returns:
true if do close form action; false otherwise
Since:
version 2.0

isEnableZeroedCheck

boolean isEnableZeroedCheck()
see if doing zeroed check or not. This API is implemented for JSP form.

Examples:

        if(Form.isEnableZeroedCheck()){
                Form.showMessageDialog("Enable Checking!");
        }
        

Returns:
true if user ask to do check;false otherwise.
Since:
version 2.3.1

isRefreshParentForm

boolean isRefreshParentForm()
Get if refresh parent form to update data. Note: Applet WebForm not implement this function.

Examples:

        var result = Form.isRefreshParentForm();
        

Returns:
true if do refresh parent form action; false otherwise
Since:
version 2.0

openRoleTree

void openRoleTree(boolean multi,
                  java.lang.String retObjectText,
                  java.lang.String retObject,
                  java.lang.String retAttr)
Open Role tree window for selecting specified member. Since V3.1, we have multi organizations. If you use this API to open role tree, it will open the role tree according to your role(s).

For example, in the organization, the root company has 3 sub companies: A, B and C. If you are assigned a role in sub company A only, you will see only the root company item and the tree of sub company A while you click a button with this API. You can't see the tree of sub company B and C. If you are assigned a role in sub company A and another role in sub company B, you will see the root company item and the tree of sub company A and sub company B. Yon can't see the tree of sub company C.

Note: Applet WebForm not implement this function.

Examples:

        Form.openRoleTree(true, "forms[0].deputyName", "forms[0].deputyMemberID", "1");
        

Parameters:
multi - true if allow selecting multiple members in role tree ; false otherwise
retObjectText - specify HTML component name which displays member name of selected node(s).
retObject - specify HTML component name which stores member information of selected node(s).
retAttr - specify which information of selected node(s) will pass to retObject. There are eight information option that you can choose. retAttr="1" stands for that retObject will take member id, "2" for login id, "3" for member name, "4" for email address, "5" for member synopsis, "6" for deputy of this member, "7" for employee id, "8" for main role name
Since:
version 2.0

openRoleTreeCustom

void openRoleTreeCustom(boolean multi,
                        java.lang.String rootNode,
                        java.lang.String leafType,
                        java.lang.String callBack,
                        java.lang.String fieldList,
                        java.lang.String retObjectText,
                        java.lang.String retObject,
                        java.lang.String retAttr)
Open Role tree window for selecting specified member, role, department or company, and retrieve data which could be used in future use

For example, in the organization, the root company has 3 sub companies: A, B and C. If you are assigned a role in sub company A only, you will see only the root company item and the tree of sub company A while you click a button with this API. You can't see the tree of sub company B and C. If you are assigned a role in sub company A and another role in sub company B, you will see the root company item and the tree of sub company A and sub company B. Yon can't see the tree of sub company C.

But, if you select any sub company, department or role as rootNode, the behavior is the same as before.

Note: Applet WebForm not implement this function.

Examples:

        You can write the following script:
        Form.openRoleTreeCustom(true, "ROL00001067310081293", "department", "callBack()", "fields", "forms[0].deputyName", "forms[0].deputyMemberID", "1");

        and write the following javascript in JSP.
        Note: You must declare result variable by yourself if parameter fieldList is specified
        var result;
        var fields = new Array();
        fields[0]="getID";
        fields[1]="getName";
        fields[2]="getSynopsis";
        function callBack()
        {
                alert("this is a call back function");
                for(j=0;j<result.length;j++) {
                        var values = result[j];
                        var aRecord='';
                        for(k=0;k<values.length;k++) {
                                aRecord = aRecord + ';' + values[k];
                        }
                        alert(aRecord);
                }
        }
        

Parameters:
multi - true if allow selecting multiple members in role tree ; false otherwise
rootNode - specify role tree root, it could be any member id, role id, department id or empty string means company. Since V3.5, we have multi organizations. If you use this API and select the root company as roodNode to open role tree, it will open the role tree according to your role(s).
leafType - specify leaf type, it could be "member", "role", "department" or "company".
callBack - specify java script function which will invoke after selection.
fieldList - java script variable which specify which node information(s) you want to retrieve to java script result variable
retObjectText - specify HTML component name which displays member name of selected node(s).
retObject - specify HTML component name which stores member information of selected node(s).
retAttr - specify which information of selected node(s) will pass to retObject. There are eight information option that you can choose. retAttr="1" stands for that retObject will take member id, "2" for login id, "3" for member name, "4" for email address, "5" for member synopsis, "6" for deputy of this member, "7" for employee id, "8" for main role id
Since:
version 2.0

openRoleTreeCustom

void openRoleTreeCustom(boolean multi,
                        java.lang.String rootNode,
                        java.util.Vector leafType,
                        java.lang.String callBack,
                        java.lang.String fieldList,
                        java.lang.String retObjectText,
                        java.lang.String retObject,
                        java.lang.String retAttr)
Open Role tree window for selecting specified member, role, department or company, and retrieve data which could be used in future use

For example, in the organization, the root company has 3 sub companies: A, B and C. If you are assigned a role in sub company A only, you will see only the root company item and the tree of sub company A while you click a button with this API. You can't see the tree of sub company B and C. If you are assigned a role in sub company A and another role in sub company B, you will see the root company item and the tree of sub company A and sub company B. Yon can't see the tree of sub company C.

Note: Applet WebForm not implement this function.

But, if you select any sub company, department or role as rootNode, the behavior is the same as before.

Examples:

        You can write the following script:
      var vecLeafType = new java.util.Vector();
      vecLeafType.add("member");
      vecLeafType.add("role");
        Form.openRoleTreeCustom(true, "ROL00001067310081293", vecLeafType, "callBack()", "fields", "forms[0].deputyName", "forms[0].deputyMemberID", "1");

        and write the following javascript in JSP.
        Note: You must declare result variable by yourself if parameter fieldList is specified
        var result;
        var fields = new Array();
        fields[0]="getID";
        fields[1]="getName";
        fields[2]="getSynopsis";
        function callBack()
        {
                alert("this is a call back function");
                for(j=0;j<result.length; j++) {
                        var values = result[j];
                        var aRecord='';
                        for(k=0;k<values.length;k++) {
                                aRecord = aRecord + ';' + values[k];
                        }
                        alert(aRecord);
                }
        }
        

Parameters:
multi - true if allow selecting multiple members in role tree ; false otherwise
rootNode - specify role tree root, it could be any member id, role id, department id or empty string means company. Since V3.5, we have multi organizations. If you use this API and select the root company as roodNode to open role tree, it will open the role tree according to your role(s).
leafType - specify leaf type, it is a Vector which could contain "member", "role", "department" or "company".
callBack - specify java script function which will invoke after selection.
fieldList - java script variable which specify which node information(s) you want to retrieve to java script result variable
retObjectText - specify HTML component name which displays member name of selected node(s).
retObject - specify HTML component name which stores member information of selected node(s).
retAttr - specify which information of selected node(s) will pass to retObject. There are eight information option that you can choose. retAttr="1" stands for that retObject will take member id, "2" for login id, "3" for member name, "4" for email address, "5" for member synopsis, "6" for deputy of this member, "7" for employee id, "8" for main role id
Since:
version 2.0

openRoleTreeCustom

void openRoleTreeCustom(boolean multi,
                        java.lang.String rootNode,
                        java.util.Vector leafType,
                        java.lang.String callBack,
                        java.lang.String fieldList,
                        java.lang.String retObjectText,
                        java.lang.String retObject,
                        java.lang.String retAttr,
                        boolean disableOrgFilter)
Open Role tree window for selecting specified member, role, department or company, and retrieve data which could be used in future use

For example, in the organization, the root company has 3 sub companies: A, B and C. If you are assigned a role in sub company A only, you will see only the root company item and the tree of sub company A while you click a button with this API. You can't see the tree of sub company B and C. If you are assigned a role in sub company A and another role in sub company B, you will see the root company item and the tree of sub company A and sub company B. Yon can't see the tree of sub company C.

Note: Applet WebForm not implement this function.

But, if you select any sub company, department or role as rootNode, the behavior is the same as before.

Examples:

        You can write the following script:
      var vecLeafType = new java.util.Vector();
      vecLeafType.add("member");
      vecLeafType.add("role");
        Form.openRoleTreeCustom(true, "ROL00001067310081293", vecLeafType, "callBack()", "fields", "forms[0].deputyName", "forms[0].deputyMemberID", "1", false);

        and write the following javascript in JSP.
        Note: You must declare result variable by yourself if parameter fieldList is specified
        var result;
        var fields = new Array();
        fields[0]="getID";
        fields[1]="getName";
        fields[2]="getSynopsis";
        function callBack()
        {
                alert("this is a call back function");
                for(j=0;j<result.length; j++) {
                        var values = result[j];
                        var aRecord='';
                        for(k=0;k<values.length;k++) {
                                aRecord = aRecord + ';' + values[k];
                        }
                        alert(aRecord);
                }
        }
        

Parameters:
multi - true if allow selecting multiple members in role tree ; false otherwise
rootNode - specify role tree root, it could be any member id, role id, department id or empty string means company. Since V3.5, we have multi organizations. If you use this API and select the root company as roodNode to open role tree, it will open the role tree according to your role(s).
leafType - specify leaf type, it is a Vector which could contain "member", "role", "department" or "company".
callBack - specify java script function which will invoke after selection.
fieldList - java script variable which specify which node information(s) you want to retrieve to java script result variable
retObjectText - specify HTML component name which displays member name of selected node(s).
retObject - specify HTML component name which stores member information of selected node(s).
retAttr - specify which information of selected node(s) will pass to retObject. There are eight information option that you can choose. retAttr="1" stands for that retObject will take member id, "2" for login id, "3" for member name, "4" for email address, "5" for member synopsis, "6" for deputy of this member, "7" for employee id, "8" for main role id
disableOrgFilter - specify the filter of organization tree is disabled or not. true the filter will be disabled and user can see all the organization of the input rootNode ; false otherwise
Since:
version 3.5

openRoleTreeCustom

void openRoleTreeCustom(boolean multi,
                        java.lang.String rootNode,
                        java.util.Vector leafType,
                        java.lang.String callBack,
                        java.lang.String fieldList,
                        java.lang.String retObjectText,
                        java.lang.String retObject,
                        java.lang.String retAttr,
                        boolean disableOrgFilter,
                        java.lang.String roleTreeMode)
Open Role tree window for selecting specified member, role, department or company, and retrieve data which could be used in future use

For example, in the organization, the root company has 3 sub companies: A, B and C. If you are assigned a role in sub company A only, you will see only the root company item and the tree of sub company A while you click a button with this API. You can't see the tree of sub company B and C. If you are assigned a role in sub company A and another role in sub company B, you will see the root company item and the tree of sub company A and sub company B. Yon can't see the tree of sub company C.

Note: Applet WebForm not implement this function.

But, if you select any sub company, department or role as rootNode, the behavior is the same as before.

Examples:

        You can write the following script:
      var vecLeafType = new java.util.Vector();
      vecLeafType.add("member");
      vecLeafType.add("role");
        Form.openRoleTreeCustom(true, "ROL00001067310081293", vecLeafType, "callBack()", "fields", "forms[0].deputyName", "forms[0].deputyMemberID", "1", false, "2");

        and write the following javascript in JSP.
        Note: You must declare result variable by yourself if parameter fieldList is specified
        var result;
        var fields = new Array();
        fields[0]="getID";
        fields[1]="getName";
        fields[2]="getSynopsis";
        function callBack()
        {
                alert("this is a call back function");
                for(j=0;j<result.length; j++) {
                        var values = result[j];
                        var aRecord='';
                        for(k=0;k<values.length;k++) {
                                aRecord = aRecord + ';' + values[k];
                        }
                        alert(aRecord);
                }
        }
        

Parameters:
multi - true if allow selecting multiple members in role tree ; false otherwise
rootNode - specify role tree root, it could be any member id, role id, department id or empty string means company. Since V3.5, we have multi organizations. If you use this API and select the root company as roodNode to open role tree, it will open the role tree according to your role(s).
leafType - specify leaf type, it is a Vector which could contain "member", "role", "department" or "company".
callBack - specify java script function which will invoke after selection.
fieldList - java script variable which specify which node information(s) you want to retrieve to java script result variable
retObjectText - specify HTML component name which displays member name of selected node(s).
retObject - specify HTML component name which stores member information of selected node(s).
retAttr - specify which information of selected node(s) will pass to retObject. There are eight information option that you can choose. retAttr="1" stands for that retObject will take member id, "2" for login id, "3" for member name, "4" for email address, "5" for member synopsis, "6" for deputy of this member, "7" for employee id, "8" for main role id
disableOrgFilter - specify the filter of organization tree is disabled or not. true the filter will be disabled and user can see all the organization of the input rootNode ; false otherwise
roleTreeMode - "1" org tree, "2" search, "3" search only.
Since:
version 3.5

openUploadFileWin

void openUploadFileWin(java.lang.String path,
                       java.lang.String pathDisplayObject)
Open upload file dialog, after uploading file, save file to specified path and fill file name to pathDisplayObject field Note: Applet WebForm not implement this function.

Examples:

        Form.openUploadFileWin("C:\\formFile\\", "FTextField0");
        

Parameters:
path - specify file path that you want to store
pathDisplayObject - specify name of form TextField component that display file name of uploaded file
Since:
version 2.0

openUploadFileWin

void openUploadFileWin(java.lang.String path,
                       java.lang.String pathDisplayObject,
                       int row,
                       int column)
Open upload file dialog, after uploading file, save file to specified path and fill file name to row row column column in pathDisplayObject table Note: Applet WebForm not implement this function.

Examples:

        Form.openUploadFileWin("C:\\formFile\\", "FTableScrollPane0", 0, 1);
        

Parameters:
path - specify file path that you want to store
pathDisplayObject - specify name of form table component that display file name of uploaded file
row - specify row of table component
column - specify column of table component
Since:
version 2.0

removeDataInvalidMsg

void removeDataInvalidMsg(java.lang.String message)
Remove the error message of data invalid.

Examples:

        Form.removeDataInvalidMsg("The telephone can't be empty!");
        

Parameters:
message - the given message
Since:
version 2.1

setCloseForm

void setCloseForm(boolean b)
Set if close form window. Note: Applet WebForm not implement this function.

Examples:

        Form.setCloseForm(true);
        

Parameters:
b - true close the form ; false otherwise.
Since:
version 2.0

setComplete

void setComplete(boolean bComplete)
Set the form can be complete or not. Default value is true.

Parameters:
bComplete - true the form can be complete; false otherwise.
Since:
version 1.0.0

setCurrencyValue

void setCurrencyValue(java.lang.String cmp,
                      double value)
Set the currency value of the specified component.

Examples:

        var TextField_of_Varchar_type = 12345.6789;
        Form.setCurrencyValue("TextField1",TextField_of_Varchar_type);
        var Result = Form.getCurrencyValue("TextField1");
        //returns the double value with currency format is like NT$12,345.68
        

Parameters:
cmp - the given component name
value - the given a double type of component value
Since:
version 1.0.0

setDataInvalidMsgList

void setDataInvalidMsgList(java.util.Vector list)
Set the error messages of data invalid.

Examples:

        var list = new Packages.java.util.Vector();
        list.add("The telephone can't be empty!");
        Form.setDataInvalidMsgList(list);
        

Parameters:
list - the given message list
Since:
version 2.1

setFloatValue

void setFloatValue(java.lang.String cmp,
                   double value)
Set the double value of the specified component.

Examples:

        var NewValue = 123.6;
        Form.setFloatValue("TextField1",NewValue);
        

Parameters:
cmp - the given component name
value - the given a double type of component value
Since:
version 1.0.0

setFormatValue

void setFormatValue(java.lang.String cmp,
                    double value,
                    java.lang.String formatStr)
Set the double value with user specified format to a component. About the Format pattern, you can refer to java.text.DecimalFormat class and get more detail about it.

Here are some common characters used in the Format Pattern:

        Symbol  Description
        0       a digit but not to show zero as absent
        #       a digit always show zero as absent
        .       decimal point
        ,       grouping separator
        -       the negative sign

        

Examples:

        var value = 12345.6789;
        var formatStr = "NT$#,##0.####";
        Form.setFormatValue("TextField1",value,formatStr);
        

Parameters:
cmp - the given component name
value - the given a double type of component value
formatStr - the given a decimal format String
Since:
version 1.0.0

setIntValue

void setIntValue(java.lang.String cmp,
                 int value)
Set the int value of the specified component.

Examples:

        var NewValue = 123;
        Form.setIntValue("TextField1",NewValue);
        

Parameters:
cmp - the given component name
value - the given an int type of component value
Since:
version 1.0.0

setParentForm

void setParentForm(FormAPI parentForm)
Set the parent form.

Examples:

        Form.setParentForm(parentForm);
        

Since:
version 1.2

setRefreshParentForm

void setRefreshParentForm(boolean b)
Set if refresh parent form to update data. Note: Applet WebForm not implement this function.

Examples:

        Form.setRefreshParentForm(true);
        

Parameters:
b - true refresh the parent form ; false otherwise.
Since:
version 2.0

setValidateComplete

void setValidateComplete(boolean bComplete)
Set the form's validation can be complete or not. Default value is true.

Parameters:
bComplete - true the form's validation can be complete; false otherwise.
Since:
version 2.1.2

setValue

void setValue(java.lang.String cmp,
              java.lang.Object value)
Set the value of the specified component.

Examples:

        // Get the SerialNo of PASEArtInstance
        var Task = Form.getCurrentTask();
        var alnstance = Task.getArtInstance();
        var SerialNo=alnstance.getMyID();
        Form.setValue("SerialNoOfArtInstance",SerialNo);
        

Parameters:
cmp - the given component name
value - the given component value
Since:
version 1.0.1

showMessageDialog

void showMessageDialog(java.lang.String message)
Show message dialog

Examples:

        Form.showMessageDialog();
        

Since:
version 1.2

Agentflow
V3.1

Submit a bug or feature
Copyright 1999-2010 Flowring , Inc. 12F., No.120, Sec2, Gongdao 5th Rd.,
Hsinchu City 300, Taiwan (R.O.C.) All Rights Reserved.