Native.newtextfield - Eventlistener

I’m following the code from here - http://docs.coronalabs.com/api/library/native/newTextField.html and have the below:

[lua]

            local input = native.newTextField(inputbg.x + 5,inputbg.y +15, inputbg.width - 10, inputbg.height -20)

            input.userInput = textListener

            input:addEventListener( “userInput”, input )

[/lua]

This does not register any events in the textListener Function however if i change it to the below, it seems to work

[lua]

local input = native.newTextField(inputbg.x + 5,inputbg.y +15, inputbg.width - 10, inputbg.height -20, textListener)

[/lua]

Any ideas what i’m doing wrong? All this is currently being done in createScene

Just saw this - http://docs.coronalabs.com/api/event/userInput/index.html which says put the code like below, which now appears to work

[lua]

local input = native.newTextField(inputbg.x + 5,inputbg.y +15, inputbg.width - 10, inputbg.height -20)

input:addEventListener( “userInput”, textListener )

[/lua]

Any ideas what the difference is between the two in the docs?

Just saw this - http://docs.coronalabs.com/api/event/userInput/index.html which says put the code like below, which now appears to work

[lua]

local input = native.newTextField(inputbg.x + 5,inputbg.y +15, inputbg.width - 10, inputbg.height -20)

input:addEventListener( “userInput”, textListener )

[/lua]

Any ideas what the difference is between the two in the docs?