2016년 12월 27일 화요일

Pizza Party with Fusion Tables for App Inventor 2 UPDATE BUTTON


Hello mr Taifun or other expert, can you help me with my project? I want to edit the pizza party with the fusion table to have UPDATE button where when if i click the button, the specific row id in fushion table will updated with new data. 

--
For UPDATE statements the first step to be done is to get the ROWID of the row to be updated with a SELECT statement. The second step is to do the UPDATE.

This example https://puravidaapps.com/fusionDB.php uses the web component and OAuth instead of the built-in fusiontable controls. But you could adjust it to your needs

-- 
Thank you so much because reply my msg. Actually i have look the example you give before (https://puravidaapps.com/fusionDB.php) but i cannot understand anything because i am totally newbie with the programming thing. i do not have any basic. I just download the source (aia pizza party) and try to change it a bit. can you help me to make block template so i can edit it. i want to change the submit button to UPDATE button so it can update specific row of my fusion table if certain category on item picker is choosen without add new row. please help me.




--
the Screen1.Initialize block you can find in the Screen1 drawer 

 i cannot understand anything because i am totally newbie with the programming thing. i do not have any basic. 



A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook   http://www.appinventor.org/book2 ... the links are at the bottom of the Web page.  The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here http://www.appinventor.org/content/CourseInABox/Intro  and the aia files for the projects in the book are here: http://www.appinventor.org/bookFiles  
How to do a lot of basic things with App Inventor are described here: http://www.appinventor.org/content/howDoYou/eventHandling  .

Also do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of App Inventor, then try something and follow the
Top 5 Tips: How to learn App Inventor

You will not find a tutorial, which does exactly what you are looking for. But doing the tutorials (not only reading a little bit) help you to understand, how things are working. This is important and this is the first step to do.

-- 
From your drawings, I think you have not done any tutorial(s) yet, or watched any of the very nice YouTube videos showing people building apps.
See the Books and Tutorials section of this FAQ ...

-- 
I have try pizza party tutorial and it was a success. now I try to edit it a little bit to have SELECT command using list-picker. I faced an error now.

can you help me figure out what is my problem? here the screenshot of my block and my fusion table:

  

-- 
Your SELECT statement asks for only one column but you try to extract more than one column from what came back from the SELECT.

-- 

there are 3 errors in your blocks
1. space is missing
2. another space is missing
3. this is not a rowid, you should use the rowid you received previously using the SELECT statement


-- 
thank you taifun. i have edit it now i faced new error like this. 



-- 
it seems to be, there are two single quotes after pembaris?

It would really help if you provided a screenshot of your relevant blocks including Do it result of your SQL statement, so we can see what you are trying to do, and where the problem may be.
see also 

Frequently Made Errors with Fusiontables and how to fix them

-- 



Thank you again taifun. i have fix it and every thing is okay now. I able to select from listpicker, then i also abe to update the fusion table. but when i click update button i face this erroe. when i check in fusion table the data have been updated. i check all my blocks especially the select and the list everything should be okay. i cannot shows my doit result because emulator or companion cannot being used on this pc. so i have attach my .aia file here. please anybody help me because the due date is very soon to submit this project. this also my relevant blocks and my error screenshot:

-- 

but when i click update button i face this erroe
remember: the fusiontable control got result event will be executed after sending the select statement AND after sending the update statement
and after sending the update statement you do not like to call your list procedure anymore...
use a global variable action and set it before executing one of the statements, thein in the fusiontabel control got result event check that variable like this

if action = SELECT
then call list procedure
else do something after the update

-- 
Than you taifun. I not understad much but i just add fusiontable control 2 to the update statement. My project is okay noow. Thanks you so much again.

-- 

댓글 1개:

  1. This is a complete guide on setting up the Fusion Table and Connecting to App Inventor:
    https://www.youtube.com/watch?v=fDTCUK8yAKw&list=PLqhmukaG7I-KucjN-GZThTQ-TjJK7Y2hr

    답글삭제