Re: JSON/ dygraph / Ajax help
Re: JSON/ dygraph / Ajax help
- Subject: Re: JSON/ dygraph / Ajax help
- From: Chuck Hill <email@hidden>
- Date: Fri, 19 Feb 2010 17:27:12 -0800
Look at WOString and WOResourceManager.
Chuck
On Feb 19, 2010, at 4:11 PM, James Cicenia wrote:
Ok -
<script type="text/javascript">
g = new Dygraph(
document.getElementById("demodiv"),
<webobject name = "GraphDataDA"/>,
{
rollPeriod: 14,
showRoller: true,
customBars: true,
yAxisLabelWidth: 30
}
);
</script>
I want to use a direct action here for "GraphDataDA". But
directactions are from links. How do I call the direct action to
bring in the data?
thanks
James
On Feb 19, 2010, at 3:19 PM, John Huss wrote:
I looked at the dygraph library - apparently it just needs a URL.
So you don't need a helper JS library to fetch the data. Just add
the WOString with the URL and you should be good to go.
John
On Fri, Feb 19, 2010 at 2:55 PM, John Huss <email@hidden>
wrote:
You should use something. Javascript without a helper library is
just a waste of time. I would recommend jQuery, but if you think
you're going to use anything from the Ajax framework you should use
Prototype instead (Ajax.framework uses the Prototype library).
Is temperatures.csv supposed to be a URL to retrieve the data or
the actual data itself?
Either way for the URL you'll need a WOString with the value set to
context.directActionURLForActionNamed( YOUR_ACTION_NAME, null )
John
On Fri, Feb 19, 2010 at 2:46 PM, James Cicenia <email@hidden>
wrote:
I do.
I have other projects I am working on... so this is more of a
learning thing and I am confused on how to approach this.
Should I use Ajax.framework? Or JQuery, or ??
Thanks for any guidance, hints or bit of code you could share.
Thank you
James
On Feb 19, 2010, at 2:41 PM, John Huss wrote:
Do you still need help with this? Are you using Ajax.framework
from Wonder or any other JS libraries?
John
On Thu, Feb 18, 2010 at 9:16 PM, James Cicenia <email@hidden>
wrote:
Hello -
I am starting on my first real AJAX WebObject JSON app.
I am testing it with dygraph (http://danvk.org/dygraphs/)
I have created a DirectAction to return all the data. Now
I don't know where to begin. I would like the data to load
upon the window loading. Then I want to do periodic updates.
Anyway, here is there sample:
<html>
<head>
<script type="text/javascript"
src="dygraph-combined.js"></script>
</head>
<body>
<div id="graphdiv2"
style="width:500px; height:300px;"></div>
<script type="text/javascript">
g2 = new Dygraph(
document.getElementById("graphdiv2"),
"temperatures.csv", // path to CSV file
{} // options
);
</script>
</body>
</html>
So my question is, what do I do to replace temperatures.csv with
my own direct action?
Thanks
James
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden