壹佰网|ERP100 - 企业信息化知识门户

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 2102|回复: 4

[扩展开发|报表开发] 请教mxes的lookup如何和后台联系定义的

[复制链接]
发表于 2007/10/17 13:35:13 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622  。

您需要 登录 才可以下载或查看,没有帐号?注册

x
在mxes中,如何定义一个字段的menutype 和lookup ,并且他是如何和后台的相关内容联系起来的?


例如在分类中定义了 父级分类                   <textbox id=\"main_grid2_5\" dataattribute=\"ARENTCLASSIFICATIONID\" menutype=\"parentclass\" lookup=\"classstructure\" />

他是如何控制右边小箭头的弹出菜单内容,以及点击选择之后,到了
  <dialog id=\"selectParentClassification\" label=\"选择父类\" >
    <tree mb id=\"selectParentClassification_tree\" beanclass=\"psdi.webclient.beans.assetcat.SelectParentClassificationBean\" width=\"600\" height=\"250\" >
      <treenode id=\"selectParentClassification_tree_node1\" objectname=\"CLASSSTRUCTURE\" keyattribute=\"classstructureuid\" displayobjectname=\"false\" displaykeyattribute=\"false\" >
        <treeattribute id=\"selectParentClassification_tree_node1_attr1\" dataattribute=\"classificationid\" display=\"true\" />
        <treeattribute id=\"selectParentClassification_tree_node1_attr2\" dataattribute=\"classification.description\" display=\"true\" />
      </treenode>
    </tree>

    <buttongroup id=\"selectParentClassification_2\" >
      <pushbutton id=\"selectParentClassification_2_2\" label=\"取消\" default=\"true\" mxevent=\"dialogcancel\" />
    </buttongroup>
  </dialog>

定义的对话框,谁知道后台的运作过程吗??
发表于 2007/10/17 19:16:47 | 显示全部楼层

回复 1# 的帖子

建议您深入看看MAXIMO的几个系统XML文件,

menu存放在menus.xml文件中
lookup存放在lookup.xml文件中
dialog存放在Library.xml文件中

至于如何运作,这个偶还没研究过
 楼主| 发表于 2007/10/18 09:02:11 | 显示全部楼层
谢谢!!!!!!!!!
发表于 2007/10/23 12:34:07 | 显示全部楼层

我的一点浅见

<dialog id="selectParentClassification" label="选择父类" >
    <tree mb id="selectParentClassification_tree" beanclass="psdi.webclient.beans.assetcat.SelectParentClassificationBean" width="600" height="250" >
........
注意 dialog id的值 和 下面的beanclass 指定的类 他们对你的问题的解决非常重要 从你开始点击
“灰色箭头” 然后 系统会根据拟的 menutype 的类型 到 MaxPresentation 表中查找 app='MENUS'的记录项 然后找到 你在配置当中指定的菜单类型 ,然后你就会看到 在在界面上弹出来的一个选择菜单
其中有 “选择父类”

然后 鼠标点击 该项 系统会在 webclient 段这样处理
   
     系统会记录dialog 的id 即selectParentClassification
在 maximo.js 文件中 有一个
sendevent(“selectParentClassification”,数据源)方法 ,然后maximo到LOOKUPS或LIBRARY(都在MaxPresentation 表中)去查找同名的 dialog 也就是你上面给出的这段xml代码

  接下来 出现一个树形的结构 选中一个节点  系统就去此时指定的beanclass 中利用反射的方法 去调用 selectrecord 方法

源代码如下

public class SelectParentClassificationBean extends TreeControlBean
{

    public SelectParentClassificationBean()
    {
    }

    / ************************************/
    / *这个方法就是选中树节点后调用的方法*/
    / ************************************/
    public int selectrecord()
        throws MXException
    {
        WebClientEvent webclientevent = sessionContext.getCurrentEvent();
        try
        {
             //调用父类的方法
            super.selectrecord();
            updateMainRecord();
        }
        catch(MXException mxexception)
        {
            Utility.sendEvent(new WebClientEvent("dialogclose", app.getCurrentPageId(), null, sessionContext));
            Utility.showMessageBox(webclientevent, mxexception);
        }
        catch(RemoteException remoteexception)
        {
            Utility.sendEvent(new WebClientEvent("dialogclose", app.getCurrentPageId(), null, sessionContext));
            Utility.showMessageBox(webclientevent, remoteexception);
        }
        return 1;
    }

TreeControlBean 中的代码分析:
public int selectrecord()
        throws MXException, RemoteException
    {
        super.selectrecord();
        //关键调用方法
        selectnode();
        return 1;
    }

    public int selectnode()
        throws MXException, RemoteException
    {
        WebClientEvent webclientevent = sessionContext.getCurrentEvent();
        String s = sessionContext.getRequest().getParameter("property");
        //s为表名或对象名,s1 为选中记录的id
        String s1 = webclientevent.getValueString();
        if(!Utility.isNull(s))
            objectname = s;
        uniqueidvalue = s1;
        try
        {
            //将选中记录的id 转化为数值类型
            long l = NumberFormat.getInstance().parse(uniqueidvalue).longValue();
            根据此id去查询它的整个mbo对象的内容
            MboRemote mboremote=getMboForUniqueId(l);
            System.out.println(this.getClass().getName());
            
            
         
        }
        catch(ParseException parseexception) { }
        return 1;
    }

至此 选择中部分就结束了,但是只选中了不行,还没有设置到主页面的mbo上面的字段里去了,这里就不给你分析了
因为maximo在实现不同的属性都有针对性的用了不同的方式,没有通用的。
发表于 2007/11/28 10:35:23 | 显示全部楼层
[s:2] [s:2] [s:2] 5.2的版本好像没有menu.xml libary.xml 和lookup.xml 三个文件哦
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|小黑屋|手机版|壹佰网 ERP100 ( 京ICP备19053597号-2 )

Copyright © 2005-2012 北京海之大网络技术有限责任公司 服务器托管由互联互通
手机:13911575376
网站技术点击发送消息给对方83569622   广告&合作 点击发送消息给对方27675401   点击发送消息给对方634043306   咨询及人才点击发送消息给对方138011526

GMT+8, 2025/11/29 05:30 , Processed in 0.016592 second(s), 16 queries , File On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表