API参考>客户端>查询脚本API类 |
方法摘要 | |
void | callRemoteQuery(String hql, String callbackName) 执行远程查询服务 参数: hql (类型:String) HQL语句 callbackName (类型:String) 回调的表单事件名称 |
void | createEntity(Object entity, String entityName) 创建一个实体对象,该对象在执行保存动作时被提交。 参数: entity (类型:Object) 实体对象值 entityName (类型:String) 实体类型名称 |
void | deleteRecordAt(int index) 删除记录。 参数: index (类型:int) 删除记录的索引号 |
void | fireCustomerEvent(String eventName, Object args) 触发在查询中的客户自定义事件 参数: eventName (类型:String) 事件名称 args (类型:Object) 事件参数 |
void | fireRemoteEvent(String eventName, Object args, String callbackName) 触发远程事件 参数: eventName (类型:String) 远程事件名称 args (类型:Object) 远程事件参数,args中的属性名对应参数名,属性值对应参数值 callbackName (类型:String) 回调事件名称,即在远程事件执行完成后所触发的表单事件名称 |
Array | getAllEntities(String entityName) 返回当前窗口中所有的实体对象 参数: entityName (类型:String) 实体类型名称 |
Array | getAllRecords() 返回当前窗口中所有的记录对象 |
Object | getEntityAt(String entityName, int index) 返回当前窗口中指定序列号的实体对象 参数: entityName (类型:String) 实体类型名称 index (类型:int) 实体所在的序列号 |
Object | getExpressionValue(String exp) 获取表达式的值 参数: exp (类型:String) 表达式 return: 表达式计算结果 |
Object | getOpenParameter() 获取ALink的打开参数 return: 打开参数 |
Object | getQueryCondition() 获取查询条件对象 return: 查询条件对象 |
Object | getRecordAt(int index) 返回当前窗口中指定序列号的记录 参数: index (类型:int) 记录所在的序列号 return: 记录对象 |
Object | getScriptHost(String host) 获取脚本对象 参数: host (类型:String) 脚本对象的引用表达式 return: 脚本对象 |
Array | getSelectedEntities(String entityName) 返回当前窗口中选中的实体对象 参数: entityName (类型:String) 实体类型名称 return: 实体数组 |
Array | getSelectedRecords() 返回当前窗口中选中的记录 return: 选中的记录数组 |
void | clearSelection() 清除选中的数据记录 |
Object | getVariable(String name) 获取变量值 参数: name (类型:String) 变量名称 return: 变量值 |
void | hideColumn(String entityName, String fieldName) 隐藏指定列 参数: entityName (类型:String) 隐藏列所属的实体名称 fieldName (类型:String) 隐藏列对应的字段名称 |
void | insertRecord(Object record, int index) 插入一条数据记录 参数: record (类型:Object) 记录数据 index (类型:int) 插入位置,未指定的情况下插入到最后一行 |
Object | invokeExp(String compName, String funcName, Array args) 调用页面中指定组件的表达式函数 参数: compName (类型:String) 页面组件名称 funcName (类型:String) 表达式函数名称 args (类型:Array) 函数调用参数,必须与函数定义中的参数顺序一致 |
void | openALink(String alinkUrl) 打开ALink链接 参数: alinkUrl (类型:String) ALink字符串 |
void | refresh(Boolean refreshAll) 刷新查询结果 参数: refreshAll (类型:Boolean) 当refreshAll=true时刷新所有页,并自动跳转到第一页,否则仅刷新当前页。 |
void | refreshCurrentPage() 刷新当前页中的显示数据 |
void | save() 保存当前数据,仅在即时编辑状态时有效。 |
void | setColumnProperty(String columnName, String propertyName, Object propertyValue) 设置数据显示列属性。 参数: columnName (类型:String) 数据列名称,必须是主实体的字段名称 propertyName (类型:String) 属性名称,目前支持enabled,required两个属性 propertyValue (类型:Object) 属性值 |
void | setConditionFormProperty(String fieldName, String propName, Object propValue) 设置查询条件输入面板中指定控件的属性值。 参数: fieldName (类型:String) 条件面板中的控件名称 propName (类型:String) 控件的属性名称 propValue (类型:Object) 控件的属性值 |
void | setEditPosition(int rowIndex, String column) 设置当前编辑焦点的位置。 参数: rowIndex (类型:int) 行索引 column (类型:String) 列索引或数据列名称(格式为 实体.字段) |
void | setEntityAt(Object entity, String entityName, int index) 设置当前窗口中指定序列号的实体对象。 参数: entity (类型:Object) 实体对象 entityName (类型:String) 实体类型 index (类型:int) 记录所在的序列号 |
void | setProperty(String propertyName, Object propertyValue) 置控件属性 参数: propertyName (类型:String) 属性名称, 目前支持excelPasteEnabled:是否允许从Excel中拷贝数据, autoClearSelection:是否自动清除多选记录 propertyValue (类型:Object) 属性值 |
void | setQueryCondition(Object cond) 设置查询条件对象 参数: cond (类型:Object) 查询条件对象 |
void | setRecordAt(Object record, int index) 设置当前窗口中指定序列号的记录 参数: record (类型:Object) 记录数据 index (类型:int) 记录所在的索引号 |
void | setSelectedIndex(int index) 设置当前选中的记录 参数: index (类型:int) 记录索引号 |
void | setToolButtonProperty(String btnName, String propertyName, Object propertyValue) 设置工具条按钮属性 参数: btnName (类型:String) 按钮索引值或按钮名称 propertyName (类型:String) 属性名称,目前支持enabled属性 propertyValue (类型:Object) 属性值 |
void | setVariable(String name, Object value) 设置变量值 参数: name (类型:String) 变量名称 value (类型:Object) 变量值 |
void | showColumn(String entityName, String fieldName, String columnLabel) 显示指定列 参数: entityName (类型:String) 显示列所属的实体名称 fieldName (类型:String) 显示列对应的字段名称 columnLabel (类型:String) 列头显示名称(可选) |
void | updateEntity(Object entity, String entityName) 更新一个实体对象,该实体对象通过id属性进行标识,并在执行保存动作时被提交 参数: entity (类型:Object) 实体对象 entityName (类型:String) 实体类型 |
void | showMessageBox(String message, String title, String flags, String callback) 显示消息框。 参数: message (类型:String) 消息内容 title (类型:String) 标题 flags (类型:String) 消息框的按钮风格,如YesNo callback (类型:String) 消息回调事件名称,在该事件中参数detail表示用户点击的按钮,如YES,NO,OK等 |