EGL Development User Group

EGL Development User Group

EGL Development User Group

The EGL Development User Group is dedicated to sharing news, knowledge, and insights regarding the EGL language and Business Developer product. Consisting of IBMers, HCL, and users, this community collaborates to advance the EGL ecosystem.

 View Only
  • 1.  Validator textfield

    Posted Thu August 06, 2015 06:35 AM

    Hello, 

    Is it possible to remove the  text from textfield  if it isn't correct  by using a validator function at the widget like this one:

    Tesfield DojoTextField{text = test, layoutData = new GridLayoutData{row = 4, column = 2}, constraints = new Dictionary{dataType = "digit"}, validators =[Validator
                    ], onChange ::= label_onChange}  

    ?

    It is correct if we set somewhere Tesfield.text =""   in the function label_onChange  but what if the declaration of TestField widget is inside a function and so function label_onChange cannot see  Tesfield DojoTextField?

     

    Thanks in advance!

    michaeldefox


  • 2.  Re: Validator textfield

    Posted Tue August 11, 2015 10:19 PM

    Hi Michael,

    The validator is only used to validate the input, it is not good to introduce side effect like change the text field value. It is better to do it in the onChange event handler. The widget can be got from the event argument in the event handler. Example:

      function label_onChange(event Event in)
            t DojoTextField = event.widget as DojoTextField;
            //if(t.getValidState() != "")
                t.text = "";
            //end
        end    

     

    -Jiyong

    HuangJiYong