Ваші коментарі

Here's the solution (thanks Marty, Ian, Adam, and John!):


<action name="oninit" oninit="yes">
<sync>
<assign property="var:params" value="where={&quot;userid&quot;:&quot;cB93EZSEzN&quot;}" encoding="url"/>
<assign property="datasource:parsecheckpets.source" value="https://api.parse.com/1/classes/pets?[var:params]" />
</sync>
</action>


The important thing here is the encoding. Parse wants the parameters URL-encoded. However, you don't want to encode the entire URL (http:// and all), because that breaks things.
Hm, still no dice. Ironically, the debug console shows the source as being assigned to the URL, but with 0 results (there should be 2), and my querycomplete action never fires.
Perfect! That worked wonders!

Also, what are the cross-platform implications here? Will the same thing bounce it out to Android's browser or Chrome or whatever comes standard on those things?
So something like this?


...
<main>
<web name="webview" alias="WEB" url="http://www.test.com/staticpage.html" style="webstyle" onnavigation="sendlinktosafari"></web>
<web name="hidden" alias="HIDDEN" url="" style="hidden"></web>
</main>
...
<actions>
<action name="sendlinkstosafari">
<sync>
<assign property="var:safarilink" value="[object:WEB.url]" />
<load url="safari-[var:safarilink]" target="HIDDEN" />
</sync>
</action>
</action>
...


When I assign a variable, how do I get the url from the link that's tapped? (In my example, I'm assuming it's just the url attribute ([object:WEB.url]).
Ok, cool. So the process would be 1) access camera roll as datasource (and display it for the user), 2) download a selected image into the app, 3) upload image to server (any tips on how to do this?), 4) profit.

This is my first time dealing with the camera roll datasource. What properties exist for it? Obviously "dataSourceIndex". From the example, I see there's "size" and "url". Any other hidden properties? A content type (photo/video), perhaps? Also, do you happen to know what the native thumbnail size is? (I copied the camera roll sample code and it's distorting the thumbnails hardcore, so I'm just wondering what their native size is.)

I'll type up a simple app and start playing with steps 1 and 2. They should be pretty easy-peasy.

Thanks!


Perfect. I had to make a couple changes (Content-Type and one change to the PHP to make my JSON easier for WIRE to read) but it works slick now. Thanks, Ian!

For those playing along at home, here's my WIRE:
<wire><datasources><datasource name="posttest" source="" query="//data" httpmethod="post" providertype="json" httpheader="php" /><httpheader name="php" Content-Type="application/x-www-form-urlencoded"/></datasources><main><panel name="bg" width="100%" height="100%" background="ff0000" onclickup="posttest"></panel></main><actions><action name="posttest"><assign property="datasource:posttest.postContent" value="value=testing123" /><assign property="datasource:posttest.source" value="http://tylr.us/testing/posttest.php" /></action><action name="return" datasource="posttest" datasourceevent="querycomplete"><alert message="[datasource:posttest.1.key]" /></action></actions></wire>

and here's my PHP:
<?php
header('Content-Type: application/json');
$data = array("key" => $_POST["value"]);
$array['data'] = $data;
echo json_encode($array);
?>
I've been dreaming about this feature for months. Can't wait for 1.5!
So this is extremely awesome and I'm making user accounts all day. Now I'm ready for the next step, logging in. (Parse docs here: https://www.parse.com/docs/rest#users... )

Could you add to the example and show how to handle something like this that requires sending data and receiving it? Can we reuse the datasource for everything we send to Parse? Do we need a new one for incoming data?

You're awesome!
As usual, I'm 90% wrong. :) That's awesome! Thanks, Ian!
Well that's not what I wanted to hear. :) I made due with an action that is triggered by onscrollto page X and that scrolls to page X. It's not perfect, but it give a little snapping effect, assuming you stop close to the dividing line between pagers. Thanks!