zoukankan      html  css  js  c++  java
  • How to add mandatory property in the DialogField class

    AOT\DialogField

    THK_mandatory
    // VAR Changed on 24 Mar 2011 at 16:14:28 by 7011 ITF032 dialog field mandatory
    void THK_mandatory(boolean _mandatory)
    {
        str     name;
        ;

        // If properties exists then we are on server
        if (properties)
        {
            name = #PropertyMandatory;
            if (!properties.exists(name))
                properties.add(name, true);
            properties.value(name, _mandatory);
        }
        else
            this.fieldControl().mandatory(_mandatory);
    }

      

    unpack
    boolean unpack(
        container   packed,
        Dialog      dialog = null
        )
    {
        Struct      unpackedProperties;
        container   structCon;
        Counter     i;
        boolean     init = fieldNo == 0;

        [#currentList,structCon] = packed;

        unpackedProperties = Struct::create(structCon);

        if (init)
            this.init(dialog);

        for (i=unpackedProperties.fields();i;i--)
        {
            switch (unpackedProperties.fieldName(i))
            {
                case #PropertyHelp:
                    this.helpText(unpackedProperties.valueIndex(i));
                    break;
                case #PropertyLabel:
                    this.label(unpackedProperties.valueIndex(i));
                    break;
                case #PropertyAllowEdit:
                    this.allowEdit(unpackedProperties.valueIndex(i));
                    break;
                case #PropertyVisible:
                    this.visible(unpackedProperties.valueIndex(i));
                    break;
                case #PropertyLookupButton:
                    this.lookupButton(unpackedProperties.valueIndex(i));
                    break;
                case #PropertyAlignControl:
                    this.alignControl(unpackedProperties.valueIndex(i));
                    break;
                case #PropertyAlignment:
                    this.alignment(unpackedProperties.valueIndex(i));
                    break;
                case #PropertyBackgroundColor:
                    this.backgroundColor(unpackedProperties.valueIndex(i));
                    break;
                case #PropertyBorder:
                    this.border(unpackedProperties.valueIndex(i));
                    break;
                case #PropertyDisplayHeight:
                    this.displayHeight(unpackedProperties.valueIndex(i));
                    break;
                case #PropertyDisplayLength:
                    this.displayLength(unpackedProperties.valueIndex(i));
                    break;
                case #PropertyEnabled:
                    this.enabled(unpackedProperties.valueIndex(i));
                    break;
                case #PropertyFrameType:
                    this.frameType(unpackedProperties.valueIndex(i));
                    break;
                case #PropertyHideFirstEntry:
                    this.hideFirstEntry(unpackedProperties.valueIndex(i));
                    break;
                case #PropertyLabelWidth:
                    this.labelWidth(unpackedProperties.valueIndex(i));
                    break;
                case #PropertyLimitText:
                    this.limitText(unpackedProperties.valueIndex(i));
                    break;
                case #PropertyMultiLine:
                    this.multiLine(unpackedProperties.valueIndex(i));
                    break;
                case #PropertyShowLabel:
                    this.showLabel(unpackedProperties.valueIndex(i));
                    break;
                case #PropertySkip:
                    this.skip(unpackedProperties.valueIndex(i));
                    break;
                case #widthMode:
                    this.widthMode(unpackedProperties.valueIndex(i));
                    break;
                case #heightMode:
                    this.heightMode(unpackedProperties.valueIndex(i));
                    break;
                case #setHeightFromLines:
                    this.setHeightFromLines(unpackedProperties.valueIndex(i));
                    break;
                case #PropertyPasswordStyle:
                    this.passwordStyle(unpackedProperties.valueIndex(i));
                    break;
                case #PropertyConfigurationKey:
                    this.configurationKey(unpackedProperties.valueIndex(i));
                    break;
                // VAR Changed on 24 Mar 2011 at 16:15:20 by 7011 ITF032 dialog field mandatory - Begin
                case #PropertyMandatory:
                    this.THK_mandatory(unpackedProperties.valueIndex(i));
                    break;
                // VAR Changed on 24 Mar 2011 at 16:15:20 by 7011 ITF032 dialog field mandatory - End
                default:
                    throw error(strfmt("@SYS67326",unpackedProperties.fieldName(i),classId2Name(classidget(this))));
            }
        }

        return true;
    }
  • 相关阅读:
    MySQL 数据恢复
    由 go orm 引发的探索
    beego 优雅重启
    2020年8月20日
    Linux 递归获取目录下所有满足条件的文件
    NET Core Kestrel部署HTTPS 一个服务器绑一个证书 一个服务器绑多个证书
    Flutter环境配置-windows
    Vue获取钉钉免登陆授权码(vue中的回调函数实践)
    【C#上位机必看】你们要的Iot物联网项目来了
    Windows Server系统部署MySQL数据库
  • 原文地址:https://www.cnblogs.com/Fandyx/p/2429925.html
Copyright © 2011-2022 走看看