Custom components - Binding events (github docs)

Just a note
I was checking the docs on github

And I’ve noticed that if the “e” parameters isn’t typed, the properties (or at least te text for TextField) can’t be retrieved.

In this case return null (as for example)

@:bind(settingsName, UIEvent.CHANGE)
function onNameChange(e) {
    this.control.text =;

typing the parameters
solve the issue.
Maybe it could be worth to update the doc adding a textfield sample ?

I have a related issue in a kha based project.

	<button id="b1" text="b1" />
	<button id="b2" text="b2" />
class View extends HBox {
	public function new() {

	@:bind(b1, UIEvent.CHANGE)
	function onB1( event: UIEvent ) {

	@:bind(b2, MouseEvent.CLICK)
	function onB2( event: MouseEvent ) {

And i just get some warnings when the project starts.

haxe/ui/macros/Macros.hx:274: WARNING: could not find component to regsiter event (b2)
haxe/ui/macros/Macros.hx:274: WARNING: could not find component to regsiter event (b1)

What happen if you try to @:build from a separate xml ?

Hm cool, that actually works.

Sounds like a bug in @:xml then… ill check it out

Meanwhile I’ve found another strange issue trying to bind an event in a class that create and shows another component (in fact i’m opening a settings view from a component and I need to run something on the component after the settings view is closed )

In the main component class (myTool) I have this

var settingsView = new MySettings(this);
[see code blocks below]

this works

    settingsView.registerEvent(MyEvent.SETTINGS_CLOSED, function(e) {

this doesn’t

        @:bind(settingsView, MyEvent.SETTINGS_CLOSED)
        function onSettingClosed(e) {

I’ve also tried moving the addComponent before binding

Just pop up to my mind that this last one could be due to mine parent/child class structure

@:xml should be working again properly now, was a tiny change (code for binding was being added before ui was built)

Looking at other issues today