TableView automatically scrolling down on Tap

I have this issue with my tableviews. Whenever I tap  (if “tap” == phase then)  the tapped row scrolls automatically down.

Any idea on why this can happen?

Not without seeing your event listener code.

[lua]

    local function onRowTouch( event )
        local q1
        local q2
        local q3
        local q4
        local query
        local query2
        local fquery      

        local phase = event.phase

               if “tap” == phase then

                   – check if there is any game with the uid of the player1 or 2
                    – create game json containig player 1 facebook uid and player 2 facebook uids
                    – collect docID and store it in docid json file

                   audio.fadeOut( 1 , 2500)
                   print("player2 id: "…options.fbfriends.data[event.target.index].id)
                   print("player1 id: "…options.player1)

                   q1 = queryBuilder:build(“uid1”,options.player1,Operator.EQUALS)
                   q2 = queryBuilder:build(“uid2”,options.fbfriends.data[event.target.index].id,Operator.EQUALS)
                   q3 = queryBuilder:build(“uid2”,options.player1,Operator.EQUALS)
                   q4 = queryBuilder:build(“uid1”,options.fbfriends.data[event.target.index].id,Operator.EQUALS)
                   query = queryBuilder:compoundOperator(q1,Operator.AND, q2)
                   query2 = queryBuilder:compoundOperator(q3,Operator.AND, q4)
                   fquery = queryBuilder:compoundOperator(query,Operator.OR, query2)

                    game.uid1=options.player1
                    game.uid2=options.fbfriends.data[event.target.index].id
                    game.start = “yes”
                

                    storageService:findDocumentsByQuery(dbName, collectionName,fquery,App42CallBack)
                    function App42CallBack:onSuccess(object)  
                        native.showAlert( “”, “Ya existe una partida contra ese jugador”, { “OK” })
                    end

     
                    function App42CallBack:onException(exception)
                        storageService:insertJSONDocument(dbName, collectionName, game,App42CallBack2)
                        function App42CallBack2:onSuccess(object)  
                            print("dbName is "…object:getDbName())  
                            print("collectionName is "…object:getCollectionName())  
                            print("DocId is "…object:getJsonDocList():getDocId())  
                            docID = object:getJsonDocList():getDocId()
                            print("Created At is "…object:getJsonDocList():getCreatedAt())  
                            print("Updated At is "…object:getJsonDocList():getUpdatedAt())

                            local optionsforcreatinggame = {
                                params = {
                                    name = options.fbfriends.data[event.target.index].name,
                                    player2 = options.fbfriends.data[event.target.index].id,
                                    player1 = options.player1,
                                    starter = true,
                                    load = false,
                                    docId = docID
                              }
                            }
                            audio.stop(1)
                            composer.gotoScene( “bonus”, optionsforcreatinggame )
                        end
                      
                        function App42CallBack2:onException(exception)  
                            print("Message is : "…exception:getMessage())  
                            print("App Error code is : "…exception:getAppErrorCode())  
                            print("Http Error code is "…exception:getHttpErrorCode())  
                            print("Detail is : "…exception:getDetails())  
                        end  
 
    
                    end   

                end
          end
[/lua]

It is quite similar to the one I have found in several examples, I just have added the connection to app42 and the composer

This is a bug regarding compatiblity with graphics 1 but it is solved in the dailiy build : CoronaSDK 2015.2581 ,

  • Widgets - tableView positions itself incorrectly on swipe up in 1.0 compatibility mode - casenum 31640

:slight_smile:

Not without seeing your event listener code.

[lua]

    local function onRowTouch( event )
        local q1
        local q2
        local q3
        local q4
        local query
        local query2
        local fquery      

        local phase = event.phase

               if “tap” == phase then

                   – check if there is any game with the uid of the player1 or 2
                    – create game json containig player 1 facebook uid and player 2 facebook uids
                    – collect docID and store it in docid json file

                   audio.fadeOut( 1 , 2500)
                   print("player2 id: "…options.fbfriends.data[event.target.index].id)
                   print("player1 id: "…options.player1)

                   q1 = queryBuilder:build(“uid1”,options.player1,Operator.EQUALS)
                   q2 = queryBuilder:build(“uid2”,options.fbfriends.data[event.target.index].id,Operator.EQUALS)
                   q3 = queryBuilder:build(“uid2”,options.player1,Operator.EQUALS)
                   q4 = queryBuilder:build(“uid1”,options.fbfriends.data[event.target.index].id,Operator.EQUALS)
                   query = queryBuilder:compoundOperator(q1,Operator.AND, q2)
                   query2 = queryBuilder:compoundOperator(q3,Operator.AND, q4)
                   fquery = queryBuilder:compoundOperator(query,Operator.OR, query2)

                    game.uid1=options.player1
                    game.uid2=options.fbfriends.data[event.target.index].id
                    game.start = “yes”
                

                    storageService:findDocumentsByQuery(dbName, collectionName,fquery,App42CallBack)
                    function App42CallBack:onSuccess(object)  
                        native.showAlert( “”, “Ya existe una partida contra ese jugador”, { “OK” })
                    end

     
                    function App42CallBack:onException(exception)
                        storageService:insertJSONDocument(dbName, collectionName, game,App42CallBack2)
                        function App42CallBack2:onSuccess(object)  
                            print("dbName is "…object:getDbName())  
                            print("collectionName is "…object:getCollectionName())  
                            print("DocId is "…object:getJsonDocList():getDocId())  
                            docID = object:getJsonDocList():getDocId()
                            print("Created At is "…object:getJsonDocList():getCreatedAt())  
                            print("Updated At is "…object:getJsonDocList():getUpdatedAt())

                            local optionsforcreatinggame = {
                                params = {
                                    name = options.fbfriends.data[event.target.index].name,
                                    player2 = options.fbfriends.data[event.target.index].id,
                                    player1 = options.player1,
                                    starter = true,
                                    load = false,
                                    docId = docID
                              }
                            }
                            audio.stop(1)
                            composer.gotoScene( “bonus”, optionsforcreatinggame )
                        end
                      
                        function App42CallBack2:onException(exception)  
                            print("Message is : "…exception:getMessage())  
                            print("App Error code is : "…exception:getAppErrorCode())  
                            print("Http Error code is "…exception:getHttpErrorCode())  
                            print("Detail is : "…exception:getDetails())  
                        end  
 
    
                    end   

                end
          end
[/lua]

It is quite similar to the one I have found in several examples, I just have added the connection to app42 and the composer

This is a bug regarding compatiblity with graphics 1 but it is solved in the dailiy build : CoronaSDK 2015.2581 ,

  • Widgets - tableView positions itself incorrectly on swipe up in 1.0 compatibility mode - casenum 31640

:slight_smile: