zoukankan      html  css  js  c++  java
  • Set focus on the dialog field

    1)Problem Statment:
    Hi,

    I have this requirement, i have a run base class with a dialog Field. i need
    to validate the vaue in the field and i need to set focus on the field if the
    value is not validated. The problem is dialogfield does not have setFocus
    method.
    Can any one help me out in this regards.

    Solution :
    As you right noticed really dialogfield doesn’t have setFocus. And not only

    setFocus. Dialog was developed just for simple user input.
    The better decision in this case is creating separate form where you may
    override every control’s event and in a dialog method of your runBase class
    call this form.
     
    Take a look for example at \Classes\WMSShipmentShip and
    > \Forms\SysProjectFilter.

    If you eagerly wish set focus in dialog there is nothing impossible

    // here we achieve myCtrl
    public void dialogPostRun(DialogRunbase dialog)
    {
        super(dialog);

        myCtrl =
    dialog.dialogForm().formRun().control(dialogTransDate.control().id());
    }

    in method where you validate:
    myCtrl.setFocus();

    But I’d like to say again
    the better solution is sepate form

    2) on the report's Dialog field

    public boolean  getFromDialog()
    {
    ;
        g_FromDate          = dlg_DialogField1.value();
        g_ToDate            = dlg_DialogField2.value();
        g_VendAccount1      = dlg_DialogField3.value();
        g_VendAccount2      = dlg_DialogField4.value();
        isRank              = dlgisRank.value();
        g_ItemBuyerGroupId  = dlg_DialogField7.value();
        g_RankPosition      = dlg_DialogField8.value();
        if(isRank && g_RankPosition == 0)
        {
            //DialogRunbase   dialog; //global variable
            dialog.dialogForm().formRun().control(dlg_DialogField8.control().id()).setFocus();
            //setFocus for the dlg_DialogField8
            throw Error("Please enter number of records for vendor ranking");
        }
        return true;
    }
    
    
  • 相关阅读:
    ReactJS读书笔记一:深入理解JSX
    react经验
    React显示和提交数据
    ReactJS
    PHP中使用memcache
    项目目标文档 ---河北省创新平台年报统计
    系统利益相关者描述案例
    梦断代码 --阅读笔记03
    梦断代码 ---阅读笔记02
    梦断代码---读书笔记01
  • 原文地址:https://www.cnblogs.com/Fandyx/p/1894050.html
Copyright © 2011-2022 走看看