widget.newSearchField ?

Ok. I moved my code to do away with scrollView on this screen. Now I have a tableView which normally shows a list of records and now I insert the newSearchField on row 1. Row 2 onwards contain my records.

The following is my ORT for the tableView. I tweaked it to detect row.index == 1 which means my searchField was tapped and if row.index > 1 then a record was tapped so I go to the detail page for that record etc. 

Now the question is how can I change the ORT to pass the touch down to the newSearchField’s listener if row.index == 1. Can anyone fathom a guess? Thanks much for your help.

-- Handle touches on the row local function onRowTouch( event ) local phase = event.phase local row = event.target if event.phase == "press" then print( "Pressed row: " .. row.index ) elseif event.phase == "release" or event.phase == "tap" then print( "Tapped and/or Released row: " .. row.index ) row.reRender = true if row.index == 1 then -- this is the searchBox - pass control to its listener -- I need something to go in here to pass control to the search field's listener. else storyboard.gotoScene( "scn\_detail" ) end end end

Anyone have any ideas? I keep reading all I can find on the documents library but can’t seem to sort this one out. Appreciate any help you might be able to provide. Thank you . 

Ok. I think I made some progress… newSearchField normally has a parameter called listener in the options table but it is perhaps not working as intended yet. Putting the following line right after the point where newSearchField is defined gets me a good listener that triggers : 

newSearchField : addEventListener(“touch”, searchListener)   

my listener looks very brief and like this : 

-- The listener for our searchBox local function searchListener( event ) local phase = event.phase print( "object touched = ", event.target ) --'event.target' is the touched object print ("searchListener - ", phase) return true end 

When I run my app now I do see my tableView scrolling and behaving as I expect in rows 2 through n which are the data rows. When I tap or touch row 1 which is the searchField row I now see that my listener is getting the event as I see 

searchListener -     began     and 

searchListener -     ended

in my terminal! Wohoo!!! Making progress. Now how do I get the newSearchField to process these events internally so we move forward to the ‘editing’ phase? I don’t understand why the newSearchField widget isnt’t catching these events when its implanted in a table as it does when its simply inserted into a regular page, ie a display group. 

I know this is yet to be released and therefore unsupported code but any idea you might have will be still very much appreciated. Thank you very much!

Hmmm, I saw 

  • Mac: Fixed bug introduced in daily build #1053 where offscreen TextFields and TextBoxes cannot receive the keyboard focus and will not provide “userInput” events. casenum: 24464

in today’s daily build Notes and got excited thinking this might help with the newSearchField widgets textbox not popping up issue but sadly it does not… I am still stuck with this one. It would be so awesome if this widget was finished up alongside other fixes that I hope are still happening. 

Nice!

I will be waiting to implement the search widget into an App I’m working on. Now, I’m using the native textfield and everything is fine, but a display object will be a plus.