Skip to first unread message

Alisha kansha

unread,
Oct 4, 2017, 3:27:49 AM10/4/17
to MIT App Inventor Forum
Hi all...

I just started to learn app inventor and it's very interesting.
Currently i'm i have a problem with delete or clear listview. I have a listview where the data is populated from mysql database using json format, this one works perfectly. Now my problem is every time come back to my listview page, the content become double. I mean the existing data is still and then another same data is inserted, so every time it's always add the same data. I try to use set listview element to empty list each time leave the page, but it is not working. 

Anyone can help how can i solved this?

Thank you

Alisha kansha

unread,
Oct 4, 2017, 4:04:04 AM10/4/17
to MIT App Inventor Forum

Here my block...every time prospectbtn is execute, it will fill the listview. Set to empty list looks like only hide from the list but all the content is still there


SteveJG

unread,
Oct 4, 2017, 8:35:47 AM10/4/17
to MIT App Inventor Forum
How about clearing the List you use to populate the ListView ( finalProspec )  or    set ListView.Elements to create empty list  .  The first  finalProspec  create empty list merely clears the List; you need to do that.  But, you also need to clear the ListView.

Is that what you wanted to do?

Regards,
Steve

Alisha kansha

unread,
Oct 4, 2017, 10:12:42 AM10/4/17
to MIT App Inventor Forum

Hi Steve,


Thanks for your help, its work perfectly. I have to clear both the global variable and the listview.
Now can you help how can i split the text below and get only number 31? i try to use split text but still can get it working.

Thanks



Taifun

unread,
Oct 4, 2017, 10:36:00 AM10/4/17
to mitappinv...@googlegroups.com
i try to use split text but still can get it working.
split by \n (new line) and then select the first item using the select list item block

for new questions please start a new thread next time, thank you.
also It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.


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.

Taifun

Trying to push the limits of App Inventor! Snippets and Tutorials from Pura Vida Apps by  Taifun.         



Abraham Getzler

unread,
Oct 4, 2017, 11:30:43 AM10/4/17
to MIT App Inventor Forum
I see in your blocks that you are doing two things that will cause you trouble with JSON and lists ...

You never use the lookup in pairs block, which works very well with JSONtextDecode output list structures.
You could have zoomed directly to attributes by name, instead of counting positions.

You are turning list structures into text roadkill when you apply text blocks to them,
resulting in unwanted '(' wrappers.

Here are some JSON projects to read ...



ABG

Alisha kansha

unread,
Oct 4, 2017, 11:57:19 AM10/4/17
to MIT App Inventor Forum
Thanks Taifun...
Noted, one question one thread

Alisha kansha

unread,
Oct 4, 2017, 11:57:45 AM10/4/17
to MIT App Inventor Forum
Will try to learn that..thanks
Reply all
Reply to author
Forward
0 new messages