views:

1509

answers:

2

I am trying to make a web app in Dashcode that uses a range slider. I see that the code library has code for "get range slider value" and "set range slider value," but there is no range slider part. So how do I make a range slider? I'm very new to Javascript.

+1  A: 

I was able to find the "Slider" under "Buttons" in the Library after clicking on "Parts". Or from the beginning:

  1. Window/Show Library
  2. Click "Parts" in upper left.
  3. Click "Buttons" under Parts Library
  4. The "Slider" is the last item on the list (mine are sorted alphabetically).

[Note those steps were done using the new DashCode 3.0 that came with Snow Leopard.]

If you don't see the slider there, could you update your question with exactly where you're looking and what Parts you do see? Perhaps we can guide you from there.

update Check out this article from Apple: Using an Apple Slider from Dashboard Programming Topics

slothbear
Yes, that slider does exist when you look in the library while making a Dashboard widget. But it is not there when you are making a web app. If I go under library>parts>buttons while in web app mode, there is no such slider.
Evelyn
Interesting. This is the part I love because we're getting close to the answer. I just tried making a new custom Safari app, and a new custom Dashboard app. In both cases, the library contained a slider. Perhaps this is an enhancement included in Dashcode 3.0 (part of Snow Leopard)?
slothbear
kk couldn't sleep before I tried this. I deployed both the Web Application and the Dashboard Widget. In both I was able to operate the slider. I pulled out my Leopard system, running Dashcode 2.0.1. The Web Application parts library has no slider, so it looks like $29 (Snow Leopard) will buy you a slider.
slothbear
Ahh. Well that's obnoxious. Thanks. :)
Evelyn
+2  A: 

This is not an option under Dashcode 3.0. Dashcode now has dual target support for Safari and Mobile Safari, which could be cool, depending upon your perspective. In this dual mode you need to create a separate UI for each target and separate data bindings. Now, the Safari library has a slider, but the Mobile Safari library does not. You might feel smug, like I originally did, and simply copy & paste the slider from the Safari side over to the Mobile Safari side and notice that it SEEMS to work (you'll see a slider, attributes, etc). However, once deployed you'll only see a input text box instead of a slider.

After some digging, here is what is going on: The code generated looks something like this <input type=range min=0 max=100> The is an HTML5 thing and desktop Safari just knows how to render it, but Mobile Safari does not. So you are out of luck.

Alternatives: Frankly, I have not found a workable javascript/html slider that works acceptably well on the iPhone. I don't know of any good 1-to-1 alternatives. I'm planning on re-assessing my needs and implementing some other input mechanism, like, maybe, a row of buttons.

Outlook: I would imagine that it would be eventually be supported natively, so check back often.

JJ Rohrer
Hmm. Interesting, thanks for the info.
Evelyn