Topic
  • 1 reply
  • Latest Post - ‏2014-05-10T20:05:45Z by Ortwin
timzeg
timzeg
5 Posts

Pinned topic Issue with changing button text need to click twice

‏2014-05-01T13:23:13Z |

Hi i have a question concerning changing the text on a DojoButton. the problem is that after changing the text i need to press the button twice. What's happening and how do i deal with this??

 

btnTonenVervallen.text = labels.tonen_vervallen;

 

thanks.

  • Ortwin
    Ortwin
    208 Posts

    Re: Issue with changing button text need to click twice

    ‏2014-05-10T20:05:45Z  

    Hi Tim,

     

    Can you elaborate on your example?

    I created the example below and at every click the text on the DojoButton changes.

    handler TestDojoButton type RUIhandler {initialUI = [ ui ],onConstructionFunction = start, cssFile="css/Test.css", title="TestDojoButton"}
        
        ui GridLayout{ columns = 3, rows = 4, cellPadding = 4, children = [ btnTonenVervallen ] };
        btnTonenVervallen DojoButton{ layoutData = new GridLayoutData{ row = 1, column = 1 }, text = "Button", onClick ::= btnTonenVervallen_onClick };
        
        function start()
            btnTonenVervallen.text = labels.tonen_alle;
        end
        
        function btnTonenVervallen_onClick(event Event in)
            if(btnTonenVervallen.text == labels.tonen_vervallen)
                btnTonenVervallen.text = labels.tonen_alle;
            else
                btnTonenVervallen.text = labels.tonen_vervallen;
            end
        end    
    end

     

    (Sorry for the poor code layout but EGL Cafe did an even worse job when inserting a real code snippet in the editor)

    Ortwin

    Updated on 2014-05-10T20:13:51Z at 2014-05-10T20:13:51Z by Ortwin