www.webOShelp.net

Get the latest on:webOS Developers' RSS FeedwebOS Facebook page webOS Twitter Feed

Events in Mojo

The HTML DOM provides a very powerful event model in which DOM elements publish events (e.g., click, load, resize, etc.) and JavaScript code subscribed to those events is triggered and executed when those events occur. Mojo provides a very similar event model for use in webOS applications.

There are three unique event types in Mojo that support different parts of the webOS UI system:

  • System UI events (e.g. drag, flick, hold)
  • Widget events (e.g. listTap, propertyChange)
  • Application UI events: (e.g. scrollStarting, stageActivate, stageDeactivate)

The full list of event object properties for Mojo.Event has not yet been released publicly, but you can find a list of the elements revealed so far over at our Mojo API reference. You can also define custom events in Mojo using Mojo.Event.make() (although Palm has not yet revealed exactly how).

Listening for events

When an event occurs, code "listening" for that event is notified. There are three ways to subscribe to events on any DOM element:

Mojo.Event.listen() was created in case there are issues with addEventListener or the observe() method (a Prototype framework method), but Palm suggests that these methods are pretty much equivalent and that "at this point", all work equally well in Mojo.

Note that Prototype and getElementByID don't work across multiple stages, so for multi-stage apps you must use this.controller.listen() or this.controller.get() to pass or retrieve an element by DOM ID.

In addition to listening for events that are triggered based on user input, you can also propagate events to event handlers programmatically using Mojo.Event.send(). For example, this would enable you to trigger a button click event without a user actually tapping a button.

Example

Click here to see an example of how to subscribe to events using Mojo.Event.listen() and this.controller.listen().

Removing Listeners for Events

To stop listening for an event, use one of three methods (whichever matches your event listener setup call):

Using Events with Widgets

Many widgets are preconfigured to dispatch events, usually to the widget's element (the div with the x-mojo-element attribute).  Palm says a complete list of the events dispatched by each widget will be provided with the SDK.  In the meantime check out this example of Event listening on a widget, as well as other examples in our UI widget list.

This article is the first of many daily programming-related webOS articles.  Grab the RSS feed to stay in the know.

Much of the information in this article was presented in Chapter 3 of Palm webOS by Mitch Allen.

 

3 Comments

webOS-powered Palm Eos handset coming to AT&T (UPDATE: and Sprint?)

Just yesterday, rumor of a new, smaller webOS handset hit the newsfeeds. Today, Engadget has plenty of new details about Palm's new ace up their sleeve, complete with technical specs and a (sharper) photo. The rumored follow-up to the Centro is dubbed the Palm Eos, a super-thin (10.6mm) and light (100g) webOS handset sporting quad-band GSM, and "definitely" coming to the AT&T network.

Also, despite the diminutive size and weight, it will sport an 1150mAh removable battery and QWERTY keypad. Precentral sized up the new device relative to the Pre and iPhone, showing just how small it will be. The unconfirmed specs and info are below; we will keep you posted when new details arrive.

UPDATE: TechCrunch adds that the internal codename for the device is "Pixie" and predicts a target price of $99 after rebate, according the sources.

UPDATE #2: For Sprint users hoping to get the Eos as well, PhoneNews notes that sources within Sprint have confirmed a CDMA version is also on the way, for a possible Q3 release.

  • 4GB storage
  • Price: $349 (pre-rebate)
  • Camera: 2 megapixel fixed focus digital camera and flash / video capture
  • Connectivity: Bluetooth 2.1 w/ A2DP and EDR, USB 2.0 via micro USB
  • Removable 1150 mAh battery (4 hours 3G talk time)
  • Messaging: SMS, MMS (picture and video only), integrated IM client
  • Contact sync with AT&T Address Book
  • MediaNet
  • Cellular Video
  • Email: POP3, IMAP4, and EAS support
  • A-GPS
  • Audio: WAV, MP3, AAC, AAC+ ringtones
  • Video Playback: MPEG4, H.264, H.263
 

0 Comments

Chapter 5 of Palm webOS - Advanced Widgets - Released!

cover of palm webos rough cutsLess than a week since Chapter 4 was released, Chapter 5, Advanced Widgets, is now available online.  It covers the following topics:

  • Indicators
  • Scroller
  • Pickers
  • Advanced Lists
  • Viewers

We've fallen a bit behind in our coverage of the new chapters (due to work, life, and all that "other" stuff) but we'll be back on track before you can say "I have a Palm Pre" (truthfully, anyway :).

If you have some spare time, why not help us out?

 

0 Comments

Rumor: Palm webOS "Mini-Pre" in the works for late 2009?

With all the buzz over the Palm Pre, which is rumored to release either on May 17th or June 7th (officially due by the end of Q2), one easily assumes that Palm is gearing up to be a one-trick pony. However new information from TechCrunch has surfaced, with one of their "better sources" indicating that a smaller, Pre-like device is "very far along" and planned for as early as the Fall. Yes, it will be smaller, and probably slimmer, running the webOS operating system. And no, it likely won't be called the "Post" as implied by one of the many April Fools jokes.

Details are still scarce, but with rumors of an iPhone Nano debunked, it is possible that Palm is making the first move to appeal to a market segment that craves miniaturization (and possibly losing the physical keyboard in the process). A good question is that if the size and functionality were to drop, would the price be smaller as well?

A comment on TechCrunch also points to an early rumor on Palm Infocenter of a webOS-powered (mini?) Centro 2, but one would assume Palm would want to innovate, rather than recycle an old design. After all, if they wanted to bring back an old form-factor, a webOS netbook would be a more logical choice. What do you make of this latest rumor, and if it pans out would you hold out for a smaller webOS handset?

via Gizmodo

UPDATE: BGR has since posted a blurry image of the alleged handset, which definitely has Centro-like styling, including a physical keyboard and possibly a taller screen.

 

 

0 Comments

Latest rumors: Palm Pre to launch June 7 and cost $150?

The latest in a string of rumors regarding price and release date are that Palm's webOS handset could launch on June 7th and cost as little as $150. The last word of a release date pegged it at May 17th, pieced together from leaked internal memos and a May 16th delivery date. The new release date rumor comes from a post at SprintGurus via Precentral, who posted an internal document (below) listing various Sprint handsets. In regards to the Pre, he states:

"Here is a listing of the handsets Sprint is currently testing in alpha/beta stages...For those asking about the Pre, there are 2 release windows, one is around 6/7/09 - the other I cannot say much on."

Moreover, EverythingPre reports that the first shipment of Palm Pre phones is rumored to have just left Hong Kong via UPS and en-route to Louisville, where it will be transferred to another location in preparation for reshipping. An early June release would probably give them enough time to properly distribute the phone among stores.

In terms of pricing, the previous speculation of a $299 price tag had some some editors crying foul, considering the lower-priced iPhone and G1 handsets with similarly-priced service plans. However, a lower price point could be quite possible according to The Street, who predict that the subsidized price may be as low as $150 to undercut the entry-level $199 iPhone model.

Read more...
 

0 Comments

Leaked screenshots from Palm webOS developer SDK emulator

An "anonymous developer" apparently taking part in the Mojo SDK early access program has posted several screenshots taken from the Palm Emulator, which is included with the Mojo SDK allowing developers to test applications in lieu of a Pre handset.

Nothing truly groundbreaking, you can see the call screen, status screen, Google Maps, some setup and preferences screens that you might not have seen before, and more of the slick Pre interface. No screenshots from the YouTube App that was spotted earlier, though. Check out the screens below.

Source: PreThinking via MyPre

 

0 Comments

Palm Pre rides the Caltrain

Besides appearing at the annual "Bring Your Own Big Wheel" race, the Pre has been out and about in the San Fransico area, this time twitter user jblebrun snapped a shot of the webOS handset on the Caltrain. Could she be also enjoying the YouTube App that another twitter user was showing off a few days ago? It's impossible to tell, but be ready for more sightings as the launch nears.

While she has a Pre and you don't, the good news is more sightings (possibly beta testers wanting to give the Pre some real-world testing?) means that the phone is nearing a stable build, and will be ready to hit store shelves sooner than later.

Source: MyPre

 

0 Comments

Verizon could get "iPhone lite" and shut out Palm; European Pre release nearing

Until now, AT&T has been exclusive to the iPhone in the US, however Precentral notes that an article in Business Week reports that Verizon is "warming to the idea" of an Apple partnership. Part of the appeal could be a smaller, less expensive model, "described by a person who has seen it as an iPhone lite". If Verizon ends up getting an iPhone, it could close the door for the webOS Palm Pre to join the biggest CDMA network in the US, once Sprint exclusivity ends.

The network previously balked at distributing the iPhone, but "has no animosity towards Apple". Also notable is that some of Palm's latest offerings, including the Treo 800w and Treo Pro have been declined by Verizon, which may not bode well for the Pre.

Read more...
 

0 Comments

Palm's latest Pre marketing news: The Molls Show

Palm's latest marketing reported via the official Palm Blog is clearly aimed away from the suit-and-tie and towards the hipster crowd, and looks like their efforts may pay off. Writer and comedian Molly McAleer gave an enthusiastic (and humerous) endorsement of the Pre today on her blip.tv series, The Molls Show. Other marketing endeavors in the entertainment industry include Howard Stern, who ended up giving the nod to the Blackberry Storm, the Jimmy Fallon show and plugged by Angelina Jolie on the set of her new film.

"Palm Pre is sponsoring this episode...They came and showed it to me, the Palm people, and I fell in love with it," she begins (we should add that although we can't confirm Palm brought her a Pre or sponsored her, they still benefit from the endorsement regardless).

Read more...
 

0 Comments



Page 24 of 37