Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Creating Mobile Apps with Appcelerator Titanium

You're reading from  Creating Mobile Apps with Appcelerator Titanium

Product type Book
Published in Oct 2013
Publisher Packt
ISBN-13 9781849519267
Pages 318 pages
Edition 1st Edition
Languages
Author (1):
Christian Brousseau Christian Brousseau
Author Profile Icon Christian Brousseau
Christian Brousseau
Toc

Table of Contents (18) Chapters Close

Creating Mobile Apps with Appcelerator Titanium
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Stopwatch (with Lap Counter) 2. Sili, the assistant that just listens 3. The To-do List 4. Interactive E-book for iPad 5. You've Got to Know When to Hold 'em 6. JRPG – Second to Last Fantasy 7. JRPG – Second to Last Fantasy Online 8. Social Networks 9. Marvels of the World around Us 10. Worldwide Marco Polo References Index

Wiring the preference service to the UI


Now that we have our preference service in place, we can now add a functionality to our portfolio window, knowing that the changes done by our user won't be lost.

Adding a new stock to the list

Probably the most important feature in our application is the ability to add new stocks. Let's start with this one. We will add a click event handler on the btnAddStock button. Inside this handler, we will create a new Stock object using the symbol (in upper case), and quantity entered by the user. Once our stock object is created, we will add it to the table view underneath using the addCustomRow function. We will create this function in just a moment, but for now, remember that it takes two parameters, the table view in which to add the new row and the stock object containing the information we will need to display. Finally, we reset the txtSymbol and txtQuantity text field values so that the user can add a new stock if desired:

btnAddStock.addEventListener(...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime