Supporting multiple widget controllers Update: The pull request for this feature has been accepted. If you require a widget in a XML view like this: 1 <widget src="nl.fokkezb.tweetsView" foo="bar" id="myWidget"></widget> It generates code like this: 1234 $.__views.myWidget = Alloy.createWidget("nl.fokkezb.tweetsView", "widget", { id: "myWidget", foo: "bar"}); Let’s take a look at the code for createWidget in alloy.js: 123 exports.createWidget = function(id, name, args) { return new (require("alloy/widgets/" + id + "/controllers/" + (name || "widget")))(args);}; Multiple view-controllers As you can see, the second argument specifies the controller to require from […]
Child elements in Widgets Sometimes it can be refreshing to look at the implications, but also the opportunities, that come with a certain technique. By doing so I managed to convince (#ALOY-382) Tony to implement RightNavButton and similar features in Alloy in the way they are now :) Child elements in <Require> Likewise, I was looking at how we […]
Getting started with Alloy This blog accompanies the in-depth introduction to Alloy I did at the Appcelerator Titanium Amsterdam meetup on January 28th. You can find the slides and demo code here: Slides: https://speakerdeck.com/fokkezb/alloy Demo code: https://github.com/FokkeZB/AlloyDemo Widgets code: http://github.com/FokkeZB Want to get started with Alloy? Here’s what you need: Getting it Download and install Titanium Studio 3.x Create a new […]
Preparing for TCAD Update Jan 1st: Tim Poulsen (@skypanther), Training Curriculum and Certification Lead at Appcelerator, responded to this blog and my email to him saying that indeed some questions I pointed out are a bit confusing and will be updated. Also, he confirmed that the exam has not yet been updated for Titanium 3.x. Something to be […]
Model-view data binding in Alloy The model-view data binding in Titanium’s Alloy is great, but I kept thinking somehow it’s not done right. This is why: It pollutes the view with the non-markup <Collection /> element. It decides for me when to trigger updating: Alloy.Collections.myCollection.on(‘fetch change add remove’, function(e) { .. }) If I somehow need manual updates to I need […]
“TweetsView” twitter widget for Titanium Alloy Add a Twitter timeline to you app using just a single line of code. I’m working on some Alloy widgets that enable me to quickly add basic views to mostly tabbed apps. First up is a Twitter timeline using Twitters 1.0 public search API. It’s styled pretty much like the iOS Twitter app and currently […]
A case for Ti.UI.create() Lately, I’ve had an intens discussion on Twitter with @mattapperson / @appersonlabs, @tonylukasavage, @ricardoalcocer, @bencoding and @aaronksaunders on the possibilities and reasons for using Carbon in Titanium’s new MVC framework Alloy. This discussion then somewhat continued in the Alloy Google Group. To better understand the why (speed) and how (especially integration with Alloy) I’ve put together a Titanium project, which can […]
“Dynamic Scrolling” Titanium Alloy widget Where would a Pull to refresh widget be without it’s companion: Dynamic Scrolling. Where the former widget allows the user to load newer content, the dynamic scrolling mechanism allows you to scroll the table down and automatically load older content. All this can be accomplished by just 4 lines of code: 1234 var scrollCtrl = Alloy.createWidget('nl.fokkezb.dynamicScrolling', null, { table: $.myTable, loader: myLoaderCallback}); Check the code […]
Updated: “Pull to refresh” Titanium Alloy widget In preparation of releasing some more widgets; working together in another widget for adding a Twitter tab to your apps, I’ve updated my “Pull to refresh” widget with new API methods to manually show, hide, update and fully trigger the widget. You can use this for example to show the headerPullView upon first load. WANTED: […]
“Pull to refresh” widget for Titanium Alloy Who can live without it? The concept of pulling down a view (mostly a table) to refresh its contents can nowadays be found in almost any app. And now, you can add it to your apps using the new MVC framework Alloy for Appcelerator Titanium in just 4 lines of code: 1234 var ptrCtrl = Alloy.createWidget('nl.fokkezb.pullToRefresh', null, { table: $.myTable, load: myLoadCallback}); Just pull the code from Github! Updated […]