ActionEvents defined via new GUI Builder don't properly register

21 views
Skip to first unread message

Clement Levallois

unread,
Oct 26, 2016, 11:58:31 AM10/26/16
to CodenameOne Discussions
Just trying to create a button, on click we move to another screen. I click on "Action Event" in the GUI Builder, and this generates some code, including:


        public void actionPerformed(com.codename1.ui.events.ActionEvent ev) {
            com.codename1.ui.Component sourceComponent = ev.getComponent();
            if(sourceComponent.getParent().getLeadParent() != null) {
                sourceComponent = sourceComponent.getParent().getLeadParent();
            }

            if(sourceComponent == gui_Text_Field_1) {
                            }
            if(sourceComponent == gui_Button_2) {
                            }
            if(sourceComponent == gui_Button_1) {
                            }
        }



As you see, I tried to attach evens to Text_Field_1, Button_1, and Button_2, but in all cases the if block seem to miss the call to the "onText_Field_1ActionEvent" or "onButton_1ActionEvent"methods that would actually trigger the action.

I might be wrong but I think this happened since 3.5.5, it was ok in 3.5.2.

Can you check and advise a fix please?

Chen Fishbein

unread,
Oct 26, 2016, 2:02:14 PM10/26/16
to CodenameOne Discussions
Hi,
Update the plugin to the latest.
I would also recommend to check and update the plugin more frequent if you use the new gui builder.
 
Reply all
Reply to author
Forward
0 new messages