Android Question B4XView events

microfan

Member
Hello all,

I am starting to develop a cross-platform app, so I chose B4XPages. I am using B4J for speed. But I have a stupid and basic question, which can not solve.

In the visual designer I've put a few views, but I am not able to use their events. For example, I've put a Button1 (type Button).
Then I used the menu to generate the event, and it created Private Sub Button1_Click() in the B4XMainPage module (correct, I think).

But that subroutine is never invoked (of course I run the program and click the button).

I also declared then button in the Sub Class_Globals: "Private Button1 As B4XView", but this does not help (I supposed that).

So, what are the requisite to put a view in the visual designer, and write event handlers for it?

Meanwhile - I should also use "composite" buttons, i.e. buttons which contain graphics and text. I used a Pane, then put two labels inside it. The graphical aspect is ok, but then can I click the Pane like it was a button with elements inside?

Thank you in advance, have a happy Christmas everyone.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
I also declared then button in the Sub Class_Globals: "Private Button1 As B4XView", but this does not help (I supposed that).
Not needed.

So, what are the requisite to put a view in the visual designer, and write event handlers for it?
Just the sub with the correct event name.

The problem is somewhere else. Upload your project.
 
Upvote 0
Top