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.  hide zero value from textfield

    Posted 08/25/15 05:11 AM

    Hello, 

    I have a textfield like this one:

           text_field DojoTextField{text = 0, layoutData = new GridLayoutData{row = 1, column = 2},fontWeight = "bold",color = "darkgray"onChange ::= textonchange  };

    and I want to hide this value when it's zero. How is that possible? Thanks 

    michaeldefox


  • 2.  Re: hide zero value from textfield

    Posted 08/25/15 06:29 AM

    Hi,

    you can do this like this:

     

        text_field DojoTextField{onFocusLost ::= text_field_onFocusLost};        function text_field_onFocusLost(e event in)                if(text_field.text == "0")                        text_field.text = "";                end                     end

    If you type a "0" into the textfield and the textfield lost the focus it will be blank...

     

    Kind Regards!

     

    Marcel-D


  • 3.  Re: hide zero value from textfield

    Posted 08/25/15 07:48 AM

    Dojotextfield has a value from the beginning and then it changes from the program. If the first value is zero from the start I can't catch that and always shows 0.

    michaeldefox


  • 4.  Re: hide zero value from textfield

    Posted 08/25/15 07:59 AM

    Sorry,

    but why you don't set the start value to blank?!

     

    Marcel-D


  • 5.  Re: hide zero value from textfield

    Posted 08/26/15 02:11 AM

    I did that but probably is the event that doesn't working. My program can't enter  that function. My event is:

    private function Textchange (e Event in)
            test_field DojoTextField = e.widget;
            
            if(test_field.text == 0) 
               test_field.text = "";
            end
        end

     

    the definition of test_field widget isn't global and maybe that's why it can't access that function from the beginning and fire up the event

    michaeldefox


  • 6.  Re: hide zero value from textfield

    Posted 08/26/15 02:35 AM

    Do you want to set the beginning value to blank?

    Then you don't need an event...

     text_field DojoTextField{text = 0, layoutData = new GridLayoutData{row = 1, column = 2},fontWeight = "bold",color = "darkgray"onChange ::= textonchange  };

    replace the "0" with ""

     

    Or you could try the onWidgetLoad Function.

     

     

    Marcel-D


  • 7.  Re: hide zero value from textfield

    Posted 08/26/15 06:03 AM

    Ok I solved it by making the definition of widget global and it's ok. Thanks !

    michaeldefox