With Dieter on a plane, Derek and Keith talk webOS 2.0 and some other stuff.
Thanks to everybody for writing in!
With Dieter on a plane, Derek and Keith talk webOS 2.0 and some other stuff.
Thanks to everybody for writing in!
It’s a new month, a new day, and we’ve got new apps. Newness all around!
There’s more, as usual, after the break.
It’s a new month, a new day, and we’ve got new apps. Newness all around!
There’s more, as usual, after the break.
Have you ever needed to set up a Mojo widget sometime after a scene’s setup method has been called? Perhaps you aren’t ready or don’t want the overhead of setting your widget up when the scene first loads. Or maybe you’re waiting until some condition has been met, such as the activate method being called after a scene above is popped. Or maybe you want to do something fancy like create an engine that programmatically populates a scene & its widgets at any point in a scene’s lifecycle.
Well, the instantiateChildWidgets function does just what you need here and it’s a method that sometimes gets overlooked. The basic idea is that you’ll setup your widgets as usual, just not in the scene’s setup method, then use the scene’s controller to call the instantiateChildWidgets function on the container div of the widgets you’re setting up.
Here’s a more detailed & totally contrived example (my specialty) where we’ll instantiate a list of list selectors, but not until after the setup method of our scene is called. All the code is included in the attached sample app here.
Step 1 – Generate an application. Mine is titled DynamicWidgets.
Step 2 – Generate a scene. I named mine ‘main’.
Step 3 – Add the following HTML to your new scene:
The choiceList element is just a standard Mojo list. However notice it’s contained in a div named “container”. We’ll use this later when we call instantiateChildWidgets which instantiates any widgets in the container div passed to it.
Step 4 – Add a new HTML file in your scene’s view directory. Mine is named list-item.html. In that file add the following HMTL:
<div class="row no-highlight"> <div class="title"> <div x-mojo-element="ListSelector" name="choiceSelector" class="palm-list-selector"></div> </div> </div>This is standard HTML for a list item, and you can see that each item contains a ListSelector widget. Still nothing new here.
Step 5 – In your scene assistant, add the following code (change the assistant name to match what you’ve called yours):
function MainAssistant(){}; MainAssistant.prototype = { selectorChoices: [ {label:'Choice 1', value:"choice1"}, {label:'Choice 2', value:"choice2"}, {label:'Choice 3', value:"choice3"}, {label:'Choice 4', value:"choice4"}, {label:'Choice 5', value:"choice5"} ], choiceListModel: { items: [ {choice:'choice1'}, {choice:'choice2'}, {choice:'choice3'}, {choice:'choice4'} ]}, setup: function() { setTimeout(this.loadList.bind(this), 5000); }, loadList: function() { this.controller.setupWidget('choiceList', { itemTemplate:'main/list-item' }, this.choiceListModel ); this.controller.setupWidget('choiceSelector', { label: 'Choice', modelProperty: 'choice', choices: this.selectorChoices } ); this.controller.instantiateChildWidgets($('container')); } };Here we set up our list selector options and model as members of the scene assistant, but you can do this however you’d like as long as they’re defined prior to setting up the related widgets. The more interesting piece is that in our assistant’s setup function, rather than setting up our widgets we specify another function to be called after 5 seconds. In that function, loadList, we set up our list and selector widgets. Finally we call the star of this post, the instantiateChildWidgets function, which will instantiate our widgets contained in the div we pass to it.
Step 6 – Before we can run this example, don’t forget to add the following to stage-assistant.js:
this.controller.pushScene('main');Now after packaging, installing, running, and waiting 5 seconds (for the timeout we added) here’s what you should see:
It’s not incredibly exciting I suppose, but in the attached sample as an extra special bonus I’ve included a dynamically instantiated button in each list item plus a tap handler!
I hope this sheds a bit of light on an API that is relatively obscure. In the right situation, though, it may be just what you need, and not at all difficult to take advantage of. Also note that there is an example in our mojomatters sample app (included in our SDK) which demonstrates a lazy list with dynamically instantiated drawer widgets added dynamically to the scene with a string of HTML and a call to instantiateChildWidgets. You’ll find it in the lazylistlazywidgets-assistant.js code.
Have you ever needed to set up a Mojo widget sometime after a scene’s setup method has been called? Perhaps you aren’t ready or don’t want the overhead of setting your widget up when the scene first loads. Or maybe you’re waiting until some condition has been met, such as the activate method being called after a scene above is popped. Or maybe you want to do something fancy like create an engine that programmatically populates a scene & its widgets at any point in a scene’s lifecycle.
Well, the instantiateChildWidgets function does just what you need here and it’s a method that sometimes gets overlooked. The basic idea is that you’ll setup your widgets as usual, just not in the scene’s setup method, then use the scene’s controller to call the instantiateChildWidgets function on the container div of the widgets you’re setting up.
Here’s a more detailed & totally contrived example (my specialty) where we’ll instantiate a list of list selectors, but not until after the setup method of our scene is called. All the code is included in the attached sample app here.
Step 1 – Generate an application. Mine is titled DynamicWidgets.
Step 2 – Generate a scene. I named mine ‘main’.
Step 3 – Add the following HTML to your new scene:
The choiceList element is just a standard Mojo list. However notice it’s contained in a div named “container”. We’ll use this later when we call instantiateChildWidgets which instantiates any widgets in the container div passed to it.
Step 4 – Add a new HTML file in your scene’s view directory. Mine is named list-item.html. In that file add the following HMTL:
<div class="row no-highlight"> <div class="title"> <div x-mojo-element="ListSelector" name="choiceSelector" class="palm-list-selector"></div> </div> </div>This is standard HTML for a list item, and you can see that each item contains a ListSelector widget. Still nothing new here.
Step 5 – In your scene assistant, add the following code (change the assistant name to match what you’ve called yours):
function MainAssistant(){}; MainAssistant.prototype = { selectorChoices: [ {label:'Choice 1', value:"choice1"}, {label:'Choice 2', value:"choice2"}, {label:'Choice 3', value:"choice3"}, {label:'Choice 4', value:"choice4"}, {label:'Choice 5', value:"choice5"} ], choiceListModel: { items: [ {choice:'choice1'}, {choice:'choice2'}, {choice:'choice3'}, {choice:'choice4'} ]}, setup: function() { setTimeout(this.loadList.bind(this), 5000); }, loadList: function() { this.controller.setupWidget('choiceList', { itemTemplate:'main/list-item' }, this.choiceListModel ); this.controller.setupWidget('choiceSelector', { label: 'Choice', modelProperty: 'choice', choices: this.selectorChoices } ); this.controller.instantiateChildWidgets($('container')); } };Here we set up our list selector options and model as members of the scene assistant, but you can do this however you’d like as long as they’re defined prior to setting up the related widgets. The more interesting piece is that in our assistant’s setup function, rather than setting up our widgets we specify another function to be called after 5 seconds. In that function, loadList, we set up our list and selector widgets. Finally we call the star of this post, the instantiateChildWidgets function, which will instantiate our widgets contained in the div we pass to it.
Step 6 – Before we can run this example, don’t forget to add the following to stage-assistant.js:
this.controller.pushScene('main');Now after packaging, installing, running, and waiting 5 seconds (for the timeout we added) here’s what you should see:
It’s not incredibly exciting I suppose, but in the attached sample as an extra special bonus I’ve included a dynamically instantiated button in each list item plus a tap handler!
I hope this sheds a bit of light on an API that is relatively obscure. In the right situation, though, it may be just what you need, and not at all difficult to take advantage of. Also note that there is an example in our mojomatters sample app (included in our SDK) which demonstrates a lazy list with dynamically instantiated drawer widgets added dynamically to the scene with a string of HTML and a call to instantiateChildWidgets. You’ll find it in the lazylistlazywidgets-assistant.js code.
If you happen to live in the Bay area (or are looking for an excuse to go there) and are interested in node.js Javascript development, then Palm is hoping to get you involved with webOS. You see, with webOS 2.0 Palm is switching to node.js-powered JavaScript background services instead of the Java services currently in use. This means faster, better, and more webbier development for webOS, and it means that developers will now be able to roll their own services to make more advanced things happen.
To that end, Palm is inviting developers to their corporate campus in Sunnyvale, California on September 14th for a collection of node.js talks, drinks, and food. There’s sure to be plenty of developer elbow rubbing for the few hours of the meet-up, plus it’s always good to get free sustenance combined with free knowledge.
Interested? Of course you are. Head over to the Facebook event page and get yourself so more info and maybe even check off that “Attending” box.
Source: Facebook; Via: Ben Combee on Twitter
If you happen to live in the Bay area (or are looking for an excuse to go there) and are interested in node.js Javascript development, then Palm is hoping to get you involved with webOS. You see, with webOS 2.0 Palm is switching to node.js-powered JavaScript background services instead of the Java services currently in use. This means faster, better, and more webbier development for webOS, and it means that developers will now be able to roll their own services to make more advanced things happen.
To that end, Palm is inviting developers to their corporate campus in Sunnyvale, California on September 14th for a collection of node.js talks, drinks, and food. There’s sure to be plenty of developer elbow rubbing for the few hours of the meet-up, plus it’s always good to get free sustenance combined with free knowledge.
Interested? Of course you are. Head over to the Facebook event page and get yourself so more info and maybe even check off that “Attending” box.
Source: Facebook; Via: Ben Combee on Twitter
Since Sprint is currently the largest portion (if not the majority) of the webOS user base, we tend to pay attention when fancy new phones launch on Sprint. We lost a lot of Pre owners to the HTC Evo 4G, but there are many out there who simply must have a keyboard. Enter the Samsung Epic 4G, part of their cross-carrier Galaxy S platform (unlike the others in the series this one carries along WiMax and a keyboard).
Is another large-screened Android phone something that webOS users should be worried about? That’s hard to say, as the Evo with its HTC Sense overlay and the Epic’s Samsung TouchWiz UI are completely different beasts. We have to admit, though, at this point much of those that have remained with Palm to this point are the contract frugal and the webOS loyal. Whether that’s going to be enough to tide them/us over until Palm releases its first device under the auspices of HP remains to be seen.
Regardless, Phil over at Android Central has had his hands on the Epic 4G long enough to develop some 3,276 words worth of impressions, and in short the device really might qualify as Epic. Head on over to Android Central to check out the Samsung Epic 4G review (and then come back here to where you know you really belong).
Since Sprint is currently the largest portion (if not the majority) of the webOS user base, we tend to pay attention when fancy new phones launch on Sprint. We lost a lot of Pre owners to the HTC Evo 4G, but there are many out there who simply must have a keyboard. Enter the Samsung Epic 4G, part of their cross-carrier Galaxy S platform (unlike the others in the series this one carries along WiMax and a keyboard).
Is another large-screened Android phone something that webOS users should be worried about? That’s hard to say, as the Evo with its HTC Sense overlay and the Epic’s Samsung TouchWiz UI are completely different beasts. We have to admit, though, at this point much of those that have remained with Palm to this point are the contract frugal and the webOS loyal. Whether that’s going to be enough to tide them/us over until Palm releases its first device under the auspices of HP remains to be seen.
Regardless, Phil over at Android Central has had his hands on the Epic 4G long enough to develop some 3,276 words worth of impressions, and in short the device really might qualify as Epic. Head on over to Android Central to check out the Samsung Epic 4G review (and then come back here to where you know you really belong).
While we in the States may not get the jokes, we still notice when a Palm device pops up on the BBC. This time it was British sitcom The Old Guys (not viewable in the US of A, or outside of the UK for that matter), a show about two, as BBC describes the, elderly delinquents. Apparently in the latest episode, one asked for a smartphone and received a... drum roll please... Palm Pre. It’s one of the few unboxings we’ve see on TV of any phone, let alone for a sitcom.
Have you recently spotted the Pre, Pixi, or another Palm device on your favorite show? Drop us a note at pretips@precentral.net with the show and a few relevant details like air date, time in the episode, and an online video link if you've got one!
Thanks to mike1976 and Damian for the tips!
While we in the States may not get the jokes, we still notice when a Palm device pops up on the BBC. This time it was British sitcom The Old Guys (not viewable in the US of A, or outside of the UK for that matter), a show about two, as BBC describes the, elderly delinquents. Apparently in the latest episode, one asked for a smartphone and received a... drum roll please... Palm Pre. It’s one of the few unboxings we’ve see on TV of any phone, let alone for a sitcom.
Have you recently spotted the Pre, Pixi, or another Palm device on your favorite show? Drop us a note at pretips@precentral.net with the show and a few relevant details like air date, time in the episode, and an online video link if you've got one!
Thanks to mike1976 and Damian for the tips!
Palm has gone to great lengths to make developing for webOS as easy as possible, what with Mojo apps based on web technologies and the PDK making it easy as pie to bring C/C+ apps to webOS. The Palm Developer Relations team has also made great strides in improving the documentation for webOS development, but sometimes there are tips and tricks that only a seasoned developer can provide.
That’s where the webOS 101 wiki comes into play. Palm launched pointed the way to the webOS 101 yesterday. WebOS 101 is a community effort launched by Roy Sutton, laying the foundation for the webOS developer community to build a set of developer documents that makes sense for them. The focus of the wiki is broad: they wants to see documents built for programming tools and languages, concepts, and best practices for both Mojo SDK and PDK development. To get the ball rolling there's a list of 147 pages they’d like to see written by the community, though we’re sure there are plenty of other articles developers have their eyes on composing.
As the Just Type and Synergy plug-ins Palm unveiled for webOS 2.0 put the onus on developers to make the chat and search they want to see happen, webOS 101 is encouraging developers to build the better documentation that they keep asking for. Who’s in?
CORRECTION: Palm has chimed in to let us know that webOS 101 actually is not a Palm creation. But it's still something that they thought highly enough to give prominent position on the Palm Developer Center community page, alongside Palm's own developer forums. So really, we guess it's even cooler that it's a community effort - we like that kind of stuff here!
Source: webOS 101; Via: webOSdev on Twitter
Palm has gone to great lengths to make developing for webOS as easy as possible, what with Mojo apps based on web technologies and the PDK making it easy as pie to bring C/C+ apps to webOS. The Palm Developer Relations team has also made great strides in improving the documentation for webOS development, but sometimes there are tips and tricks that only a seasoned developer can provide.
That’s where the webOS 101 wiki comes into play. Palm launched pointed the way to the webOS 101 yesterday. WebOS 101 is a community effort launched by Roy Sutton, laying the foundation for the webOS developer community to build a set of developer documents that makes sense for them. The focus of the wiki is broad: they wants to see documents built for programming tools and languages, concepts, and best practices for both Mojo SDK and PDK development. To get the ball rolling there's a list of 147 pages they’d like to see written by the community, though we’re sure there are plenty of other articles developers have their eyes on composing.
As the Just Type and Synergy plug-ins Palm unveiled for webOS 2.0 put the onus on developers to make the chat and search they want to see happen, webOS 101 is encouraging developers to build the better documentation that they keep asking for. Who’s in?
CORRECTION: Palm has chimed in to let us know that webOS 101 actually is not a Palm creation. But it's still something that they thought highly enough to give prominent position on the Palm Developer Center community page, alongside Palm's own developer forums. So really, we guess it's even cooler that it's a community effort - we like that kind of stuff here!
Source: webOS 101; Via: webOSdev on Twitter
As we continue our review of the Facebook Beta App, we are going to quickly walk-thru each of the 7 main sections of the app and give a brief overview of what is included there (if you still do not have the Beta app, review our initial Facebook tip on how to install it). But before we get into the overview, let's quickly talk about the three ways to navigate this app. In addition to the top bar header, you can swipe down from the top-left of the screen to bring up the Facebook application drop-down menu and then tapping "Navigate To..." to bring up the list of sections. You will also notice that each section here includes a Meta-tap to use a Gesture Area + keyboard shortcut to move between the app. So now that you know how to move around the app, let's discuss each section (after the break!)