How do I know which button has pressed on a tab bar ?

I thought this would be easy but I must be doing something wrong.

I have -

[lua]

            onPress = handleTabBarEvent

[/lua]

In my tabButtons options and then a function -

[lua]

local function handleTabBarEvent(event)

    print(event.target.id)

    return true

end

[/lua]

But all I get printed is null, I even tried setting my own id above the onPress but same.

Any ideas what am doing wrong ?

Dave

It’s event.target._id.

Cheers Rob. Has it always been that ? Am sure I have used .id on other stuff. Dave

It might have been id in Widgets V1.

Rob

But _id means its an internal and might change with no warning right? I wish, for consistency sake .id was still there and that things would not just disappear like that without any warning… 

It’s event.target._id.

Cheers Rob. Has it always been that ? Am sure I have used .id on other stuff. Dave

It might have been id in Widgets V1.

Rob

But _id means its an internal and might change with no warning right? I wish, for consistency sake .id was still there and that things would not just disappear like that without any warning…