public interface FormAPI
Form
in Agentflow scripts.
ex: Form.getCurrentTask();
The definition of Form
and Component
can be referenced in other technical report
Modifier and Type | Field and Description |
---|---|
static int |
NORMAL_MODE
Deprecated.
|
static int |
POSTACTION_MODE
Deprecated.
|
static int |
PREACTION_MODE
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addDataInvalidMsg(java.lang.String message)
Gather the error message of data invalid.
|
void |
addDataVerificationCheckExclude(java.lang.String fieldName)
Setting field name into dataVerificationCheckExcludeList.
|
void |
addOpLog(org.json.simple.JSONObject collectLogJSON)
Insert custom log to Short-term DBˇAColumn name is contents.
|
void |
clearDataInvalidMsgs()
Clear the error messages of data invalid.
|
void |
clearDataVerificationCheckExcludeList()
Clearing the dataVerificationCheckExcludeList
|
boolean |
closeForm()
Close the current artifact form.
|
javax.swing.JPanel |
createFormPanel(java.util.Vector artFormItemList,
java.util.HashMap initValue,
Task t)
Deprecated.
|
java.util.Map |
createHeadOfExportExcel(int rowFrom,
int rowTo,
int colFrom,
int colTo,
java.lang.String headStr)
Create the column title object for API {
exportDataToExcel(String, Map) . |
boolean |
doPreAction()
Deprecated.
|
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.
|
void |
exportDataToExcel(java.lang.String fileName,
java.util.Map data)
Export the given data to excel.
|
int |
getActionMode()
Deprecated.
|
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.
|
java.util.Vector |
getDataVerificationCheckExcludeList()
Getting the dataVerificationCheckExcludeList
|
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.
|
java.util.Locale |
getLocale()
Returns the current locale.
|
FormAPI |
getParentForm()
Get the parent form.
|
java.lang.String |
getRequestURL()
Returns the base URL of the current request, including the protocol (http/https),
host (IP address or domain), port (if not default), and application context path.
|
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.
|
void |
hideAllSignrecord(boolean isHide)
Show or hide the all sign record button.
|
void |
hideAttachedFileButton(java.lang.Boolean isHide)
Show or hide the AttachedFile button.
|
void |
hideMemoButton(java.lang.Boolean isHide)
Show or hide the Memo button.
|
void |
hideMonitorButton(java.lang.Boolean isHide)
Show or hide the Monitor button.
|
void |
hidePrintformatButton(java.lang.Boolean isHide)
Show or hide the Printformat button.
|
void |
hidePrintformButton(java.lang.Boolean isHide)
Show or hide the Printform button.
|
void |
hidePrintmodeButton(java.lang.Boolean isHide)
Show or hide the Printmode button.
|
void |
hidePrintSignrecordButton(boolean isHide)
Show or hide the print all sign record button.
|
void |
hidePrintSignrecordWithFormButton(boolean isHide)
Show or hide the print all sign record with form button.
|
void |
hidePriorityButton(java.lang.Boolean isHide)
Show or hide the Priority button.
|
void |
hidePrivatememoButton(java.lang.Boolean isHide)
Show or hide the Privatememo button.
|
void |
hideSendEFormButton(java.lang.Boolean isHide)
Show or hide the SendEForm button.
|
void |
hideSynopsisButton(java.lang.Boolean isHide)
Show or hide the Synopsis button.
|
void |
hideTrackingButton(java.lang.Boolean isHide)
Show or hide the Tracking button.
|
boolean |
isAttachInsertToDB()
Is attachFile insert into table AttachFile FileContent
|
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.
|
boolean |
isRequestLale()
Determines whether the current form request originates from the LALE system.
|
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 |
openRoleTreeCustom(boolean multi,
java.util.Vector 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 |
openRoleTreeCustom(boolean multi,
java.util.Vector 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,
boolean asGeneralUser)
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 |
openWin(java.lang.String url,
java.lang.String title,
java.lang.String attribute)
opens a new browser window.
|
void |
removeDataInvalidMsg(java.lang.String message)
Remove the error message of data invalid.
|
void |
removeDataVerificationCheckExclude(java.lang.String fieldName)
Removing the field name from dataVerificationCheckExcludeListˇC
|
void |
saveAppData()
save datas in the current form,and update artifact instance the same time.
|
void |
saveAppData(boolean bUpdate)
save datas in the current form,and update artifact instance or not.
|
void |
setActionMode(int mode)
Deprecated.
|
void |
setArtReadOnly(boolean b)
Set to read-only artifact.
|
void |
setAttachInsertToDB(boolean b)
Set attachFile insert into table AttachFile Column FileContent
|
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 |
setDataVerificationCheckExcludeList(java.util.Vector list)
Setting multiple field name into dataVerificationCheckExcludeList to ignore data change verificationˇC
|
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
(Label component doesn't save to database by default setting, if you need to use this API to change text of label, please make sure to enable 'save to Database' of Label property in PDE, else label would recover to default value after clear PASE cache). |
void |
showMessageDialog(java.lang.String message)
Show message dialog
Examples:
Form.showMessageDialog();
|
void |
updateFormPanelData(java.util.HashMap initValue)
Deprecated.
|
static final int PREACTION_MODE
static final int POSTACTION_MODE
static final int NORMAL_MODE
Task getCurrentTask()
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);
java.lang.String getCurrentTaskID()
Examples:
var taskId = Form.getCurrentTaskID(); var task = Client.getTask(taskId);
ClientAPI getClient()
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"
ClientAPI
java.lang.String getArtInstanceID()
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"
java.lang.String getArtifactID()
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"
PASEartInstance getArtInstance()
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 "
PASEartInstance
boolean doPreAction()
Examples: Note: JSP WebForm not implement this function.
Form.doPreAction();
java.lang.Object getComponent(java.lang.String cmp)
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();
cmp
- the given component namejava.util.Vector getComponentList()
Examples:
var CmpList = Form.getComponentList();
if(CmpList != null) {
for(var i=0;i<CmpList.size();i++){
var Component = CmpList.get(i);
//returns an Object
}
}
Vector
is a Object
)java.util.Vector getComponentNames()
Examples:
var CmpNames = Form.getComponentNames();
if(CmpNames != null) {
for(var i=0;i<CmpNames.size();i++){
var Name = CmpNames.get(i);
//returns an String
}
}
Vector
is a String
)java.lang.Object getValue(java.lang.String cmp)
Examples:
var Result = Form.getValue("TextArea1");
//returns the value of specified Component
Name
cmp
- the given component namevoid setValue(java.lang.String cmp, java.lang.Object value)
Examples:
// Get the SerialNo of PASEArtInstance var Task = Form.getCurrentTask(); var alnstance = Task.getArtInstance(); var SerialNo=alnstance.getMyID(); Form.setValue("SerialNoOfArtInstance",SerialNo);
cmp
- the given component namevalue
- the given component valueint getIntValue(java.lang.String cmp)
Examples:
var Result = Form.getIntValue("TextField1"); //returns the int value of specified component name is like 100
cmp
- the given component namevoid setIntValue(java.lang.String cmp, int value)
Examples:
var NewValue = 123; Form.setIntValue("TextField1",NewValue);
cmp
- the given component namevalue
- the given an int type of component valuedouble getFloatValue(java.lang.String cmp)
Examples:
var Result = Form.getFloatValue("TextField1"); //returns the int value of specified component name is like 100.0
cmp
- the given component namevoid setFloatValue(java.lang.String cmp, double value)
Examples:
var NewValue = 123.6; Form.setFloatValue("TextField1",NewValue);
cmp
- the given component namevalue
- the given a double type of component valuedouble getCurrencyValue(java.lang.String cmp)
Examples:
var Result = Form.getCurrencyValue("TextField1"); //returns the double value with currency format is like NT$1,000.00
cmp
- the given component namevoid setCurrencyValue(java.lang.String cmp, double value)
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
cmp
- the given component namevalue
- the given a double type of component valuedouble getFormatValue(java.lang.String cmp, java.lang.String formatStr)
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 signExamples:
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
cmp
- the given component nameformatStr
- the given a decimal format Stringvoid setFormatValue(java.lang.String cmp, double value, java.lang.String formatStr)
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 signExamples:
var value = 12345.6789; var formatStr = "NT$#,##0.####"; Form.setFormatValue("TextField1",value,formatStr);
cmp
- the given component namevalue
- the given a double type of component valueformatStr
- the given a decimal format Stringint getActionMode()
void setActionMode(int mode)
mode
- the action mode. PREACTION_MODE, POSTACTION_MODE, or NORMAL_MODE.void setComplete(boolean bComplete)
okAction
.
Default value is true.bComplete
- true the form can be complete; false otherwise.void setValidateComplete(boolean bComplete)
bComplete
- true the form's validation can be complete; false otherwise.javax.swing.JPanel createFormPanel(java.util.Vector artFormItemList, java.util.HashMap initValue, Task t)
Examples:
var artID = Form.getArtifactID(); var artFormItemList = Client.getArtifactForm(artID); var initValue = new Packages.java.util.HashMap(); for(var i=0;i<artFormItemList.size();i++) { var artFormItem = artFormItemList.get(i); initValue.put(artFormItem.getName(), artFormItem.getDefaultValue()); } var newForm = Form.createFormPanel(artFormItemList,initValue,Form.getCurrentTask()); //returns the new form panel
artFormItemList
- the given artifact form item listinitValue
- the given initial value of componentst
- the given Task
JPanel
object which is the new form panel.void updateFormPanelData(java.util.HashMap initValue)
Examples:
var value = new Packages.java.util.HashMap(); value.put("TextField1","update value!"); Form.updateFormPanelData(value); //update the value of component which it's name is "TextField1".
initValue
- the given value to update the components' valueboolean closeForm()
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); }
javax.swing.JPanel getFormPanel()
Examples:
var panel = Form.getFormPanel(); java.lang.System.out.println(panel.getClass());
javax.swing.JPanel getFrame()
Examples:
var frame = Form.getFrame(); frame.setIconified(true);
void showMessageDialog(java.lang.String message)
Examples:
Form.showMessageDialog();
void setParentForm(FormAPI parentForm)
Examples:
Form.setParentForm(parentForm);
FormAPI getParentForm()
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();
void setCloseForm(boolean b)
Examples:
Form.setCloseForm(true);
b
- true close the form ; false otherwise.boolean isCloseForm()
Examples:
var result = Form.isCloseForm();
void setRefreshParentForm(boolean b)
Examples:
Form.setRefreshParentForm(true);
b
- true refresh the parent form ; false otherwise.boolean isRefreshParentForm()
Examples:
var result = Form.isRefreshParentForm();
void openRoleTree(boolean multi, java.lang.String retObjectText, java.lang.String retObject, java.lang.String retAttr)
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, "DynamicForm.deputyName", "DynamicForm.deputyMemberID", "1");
multi
- true if allow selecting multiple members in role
tree ; false otherwiseretObjectText
- 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, "29" for
member id,role idvoid 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)
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", "DynamicForm.deputyName", "DynamicForm.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); } }
multi
- true if allow selecting multiple members in role tree ; false otherwiserootNode
- 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 Constants.ROOT_COMPANY_ID.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 variableretObjectText
- 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
- openRoleTree(boolean, String, String, String)
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)
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", "DynamicForm.deputyName", "DynamicForm.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); } }
multi
- true if allow selecting multiple members in role tree ; false otherwiserootNode
- 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 Constants.ROOT_COMPANY_ID.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 variableretObjectText
- 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
- openRoleTree(boolean, String, String, String)
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)
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", "DynamicForm.deputyName", "DynamicForm.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); } }
multi
- true if allow selecting multiple members in role tree ; false otherwiserootNode
- 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 Constants.ROOT_COMPANY_ID.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 variableretObjectText
- 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
- openRoleTree(boolean, String, String, String)
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 otherwisevoid 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)
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", "DynamicForm.deputyName", "DynamicForm.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); } }
multi
- true if allow selecting multiple members in role tree ; false otherwiserootNode
- 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 Constants.ROOT_COMPANY_ID.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 variableretObjectText
- 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
- openRoleTree(boolean, String, String, String)
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 otherwiseroleTreeMode
- "1" org tree, "2" search, "3" search only.void openRoleTreeCustom(boolean multi, java.util.Vector 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)
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 vecRootNode = new java.util.Vector(); vecRootNode.add("company"); vecRootNode.add("COM00001271123370011"); vecRootNode.add("DEP00001091073095699"); vecRootNode.add("ROL00111091075218321"); vecRootNode.add("MEM00001091511489187"); var vecLeafType = new java.util.Vector(); vecLeafType.add("member"); vecLeafType.add("role"); Form.openRoleTreeCustom(true, vecRootNode, vecLeafType, "callBack()", "fields", "DynamicForm.deputyName", "DynamicForm.deputyMemberID", "1", false, "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); } }
multi
- true if allow selecting multiple members in role tree ; false otherwiserootNode
- specify role tree root, it could be any member id, role id, department id or empty means company.
Since V3.7, If you use this API can open a multi-root node role tree, it will open the role tree according to your role(s),
but if the value of "disableOrgFilter" is "false", it will be filter some root node.leafType
- specify leaf type, it is a Vector which could contain "member", "role", "department" or Constants.ROOT_COMPANY_ID.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 variableretObjectText
- 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
- openRoleTree(boolean, String, String, String)
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 otherwiseroleTreeMode
- "1" org tree, "2" search, "3" search only.void openRoleTreeCustom(boolean multi, java.util.Vector 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, boolean asGeneralUser)
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 vecRootNode = new java.util.Vector(); vecRootNode.add("company"); vecRootNode.add("COM00001271123370011"); vecRootNode.add("DEP00001091073095699"); vecRootNode.add("ROL00111091075218321"); vecRootNode.add("MEM00001091511489187"); var vecLeafType = new java.util.Vector(); vecLeafType.add("member"); vecLeafType.add("role"); Form.openRoleTreeCustom(true, vecRootNode, vecLeafType, "callBack()", "fields", "DynamicForm.deputyName", "DynamicForm.deputyMemberID", "1", false, "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); } }
multi
- true if allow selecting multiple members in role tree ; false otherwiserootNode
- specify role tree root, it could be any member id, role id, department id or empty means company.
Since V3.7, If you use this API can open a multi-root node role tree, it will open the role tree according to your role(s),
but if the value of "disableOrgFilter" is "false", it will be filter some root node.leafType
- specify leaf type, it is a Vector which could contain "member", "role", "department" or Constants.ROOT_COMPANY_ID.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 variableretObjectText
- 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
- openRoleTree(boolean, String, String, String)
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 otherwiseroleTreeMode
- "1" org tree, "2" search, "3" search only.While
- the current user is a Superuser, the sub-company node will be displayed. If want to hide the sub-company, set to true to open the role tree as a general user.void openUploadFileWin(java.lang.String path, java.lang.String pathDisplayObject)
Examples:
Form.openUploadFileWin("C:\\formFile\\", "FTextField0");
path
- specify file path that you want to storepathDisplayObject
- specify name of form TextField component that display file name of uploaded filevoid openUploadFileWin(java.lang.String path, java.lang.String pathDisplayObject, int row, int column)
Examples:
Form.openUploadFileWin("C:\\formFile\\", "FTableScrollPane0", 0, 1);
path
- specify file path that you want to storepathDisplayObject
- specify name of form table component that display file name of uploaded filerow
- specify row of table componentcolumn
- specify column of table componentvoid downloadFileCustom(java.lang.String path, java.lang.String pathDisplayObject)
Examples:
Form.downloadFileCustom("C:\\formFile\\", "FTextField0");
path
- specify file path that you want to storepathDisplayObject
- specify name of form TextField component that display file name of downloaded filevoid downloadFileCustom(java.lang.String path, java.lang.String pathDisplayObject, int row, int column)
Examples:
Form.downloadFileCustom("C:\\formFile\\", "FTableScrollPane0", 0, 1);
path
- specify file path that you want to storepathDisplayObject
- specify name of form component that display file name of downloaded filerow
- specify row of table componentcolumn
- specify column of table componentvoid downloadFile(java.lang.String path, java.lang.String fileName)
Examples:
Form.downloadFile("C:\\formFile\\", "foo.txt");
path
- specify file pathfileName
- specify file you want to downloadvoid addDataInvalidMsg(java.lang.String message)
Examples:
Form.addDataInvalidMsg("The telephone can't be empty!");
message
- the given messagevoid removeDataInvalidMsg(java.lang.String message)
Examples:
Form.removeDataInvalidMsg("The telephone can't be empty!");
message
- the given messagevoid setDataInvalidMsgList(java.util.Vector list)
Examples:
var list = new Packages.java.util.Vector(); list.add("The telephone can't be empty!"); Form.setDataInvalidMsgList(list);
list
- the given message listjava.util.Vector getDataInvalidMsgList()
Examples:
var list = Form.getDataInvalidMsgList();
void clearDataInvalidMsgs()
Examples:
Form.clearDataInvalidMsgs();
java.applet.AppletContext getAppletContext()
java.lang.String getScriptLibrary(java.lang.String scriptName)
Examples:
var text = Form.getScriptLibrary("Script11");
scriptName
- the given script library namevoid enableZeroedCheck(boolean isDoCheck)
Examples:
Form.enableZeroedCheck(true);//turn on checking
boolean
- of doing check or notboolean isEnableZeroedCheck()
Examples:
if(Form.isEnableZeroedCheck()){ Form.showMessageDialog("Enable Checking!"); }
void saveAppData()
void saveAppData(boolean bUpdate)
boolean
- of doing update or notjava.util.Locale getLocale()
Examples:
var locale = Form.getLocale(); var language = locale.toString(); //returns language is like "en"
void exportDataToExcel(java.lang.String fileName, java.util.Map data)
Note: Applet WebForm not implement this function.
Ref. {createHeadOfExportExcel(int, int, int, int, String)
//1. Prepare the header (two row & 5 columns. index starts form 0) var vColumnTitle = new java.util.Vector(); var column0 = Form.createHeadOfExportExcel(0, 1, 0, 0, "column0"); var column1 = Form.createHeadOfExportExcel(0, 1, 1, 1, "column1"); var column2_3_4 = Form.createHeadOfExportExcel(0, 0, 2, 4, "column2_3_4"); var column2 = Form.createHeadOfExportExcel(1, 1, 2, 2, "column2"); var column3 = Form.createHeadOfExportExcel(1, 1, 3, 3, "column3"); var column4 = Form.createHeadOfExportExcel(1, 1, 4, 4, "column4");
column0 | column1 | column2_3_4 | ||
column2 | column3 | column4 |
// add the column title in order. vColumnTitle.add(column0); vColumnTitle.add(column1); vColumnTitle.add(column2_3_4); vColumnTitle.add(column2); vColumnTitle.add(column3); vColumnTitle.add(column4); //Key for header adding in order var vkeyForHeader = new java.util.Vector(); vkeyForHeader.add("column0"); vkeyForHeader.add("column1"); vkeyForHeader.add("column2"); vkeyForHeader.add("column3"); vkeyForHeader.add("column4"); var vRowData = new java.util.Vector(); var rowData = null; // data: the data source. // ... for (var i = 0; i < data.size(); i++) { rowData = new java.util.HashMap(); var row = data.get(i); var column0 = row.get("column0"); var column1 = row.get("column1"); var column2 = row.get("column2"); var column3 = row.get("column3"); var column4 = row.get("column4"); rowData.put("column0", column0); rowData.put("column1", column1); rowData.put("column2", column2); rowData.put("column3", column3); rowData.put("column4", column4); vRowData.add(rowData); } var exportDataMap = new java.util.HashMap(); exportDataMap.put("ShowHeader", vColumnTitle); exportDataMap.put("Header", vkeyForHeader); exportDataMap.put("Data", vRowData); Form.exportDataToExcel("theexportedfile.xls", exportDataMap);
fileName
- the file name to export todata
- to exportjava.util.Map createHeadOfExportExcel(int rowFrom, int rowTo, int colFrom, int colTo, java.lang.String headStr)
exportDataToExcel(String, Map)
.
If you will often wish to display column information in groups, you can use this API to do colspan and rowspans in the header.
This will do rowspan from rowFrom
to rowTo
and colspan from colFrom
to colTo
Note: Applet WebForm not implement this function.
rowFrom
- rowTo
- colFrom
- colTo
- headStr
- the column titlevoid setArtReadOnly(boolean b)
b
- true the artifact can be read-only; false otherwise.void openWin(java.lang.String url, java.lang.String title, java.lang.String attribute)
Examples:
Form.openWin("http://www.flowring.com", "Agentflow", "width=800, height=600, status=yes, resizable=yes");
url
- Specifies the URL of the page to open.title
- Specifies the title of the window.attribute
- refer to the sample.void hideSendEFormButton(java.lang.Boolean isHide)
Examples:
Form.hideSendEFormButton(true);
void hideAttachedFileButton(java.lang.Boolean isHide)
Examples:
Form.hideAttachedFileButton(true);
void hideMemoButton(java.lang.Boolean isHide)
Examples:
Form.hideMemoButton(true);
void hidePrivatememoButton(java.lang.Boolean isHide)
Examples:
Form.hidePrivatememoButton(true);
void hidePrintformButton(java.lang.Boolean isHide)
Examples:
Form.hidePrintformButton(true);
void hidePrintformatButton(java.lang.Boolean isHide)
Examples:
Form.hidePrintformatButton(true);
void hidePrintmodeButton(java.lang.Boolean isHide)
Examples:
Form.hidePrintmodeButton(true);
void hideMonitorButton(java.lang.Boolean isHide)
Examples:
Form.hideMonitorButton(true);
void hideTrackingButton(java.lang.Boolean isHide)
Examples:
Form.hideTrackingButton(true);
void hidePriorityButton(java.lang.Boolean isHide)
Examples:
Form.hidePriorityButton(true);
void hideSynopsisButton(java.lang.Boolean isHide)
Examples:
Form.hideSynopsisButton(true);
void hideAllSignrecord(boolean isHide)
Examples:
Form.hideAllSignrecord(true);
void hidePrintSignrecordButton(boolean isHide)
Examples:
Form.hidePrintSignrecordButton(true);
void hidePrintSignrecordWithFormButton(boolean isHide)
Examples:
Form.hidePrintSignrecordWithFormButton(true);
void addDataVerificationCheckExclude(java.lang.String fieldName)
fielName
- the given field name.Examples:
Form.addDataVerificationCheckExclude("txtField1");
void removeDataVerificationCheckExclude(java.lang.String fieldName)
fielName
- the given field name.Examples:
Form.removeDataVerificationCheckExclude("txtField1");
void setDataVerificationCheckExcludeList(java.util.Vector list)
list
- the given field name of Vector.Examples:
var list = new Packages.java.util.Vector(); list.add("txtField1"); list.add("txtField2"); Form.setDataVerificationCheckExcludeList(list);
java.util.Vector getDataVerificationCheckExcludeList()
Examples:
var list = Form.getDataVerificationCheckExcludeList();
void clearDataVerificationCheckExcludeList()
Examples:
Form.clearDataVerificationCheckExcludeList();
void addOpLog(org.json.simple.JSONObject collectLogJSON)
Examples:
importPackage(Packages.org.json.simple); var obj = new JSONObject(); obj.put("key1","value1"); obj.put("key2","value2"); Form.addOpLog(obj);
boolean isAttachInsertToDB()
Examples:
Form.isAttachInsertToDB();
void setAttachInsertToDB(boolean b)
Examples:
Form.setAttachInsertToDB(boolean b);
boolean isRequestLale()
true
if the form request was initiated from LALE; false
otherwiseExamples:
Form.isRequestLale();
java.lang.String getRequestURL()
String
representing the base request URL.Examples:
Form.getRequestURL();
Copyright ? 2022. All Rights Reserved.