as3Salesfo rce.swc - Flex Toolkit no longer working?
04-27-2009 08:19 AM
I'm befuddled and puzzled. I just got the Google Maps API for Flex to embed properly in SF and now I am trying to get a data grid to fill with SF data in the same SWF. I've gotten data out of Salesforce in the past using the as3salesforce.swc library but it doesn't seem to work anymore. I've been following threads about the appropriate server_url (which I've now replaced with v15 to no avail). Anybody else noticing problems with the toolkit?
<apex:page standardController="Location__c">
<apex:form >
<apex:pageBlock title="Flex implementation">
<apex:flash id="flexSOs" src="{!$Resource.SFFlex}" height="100%" width="100%"
flashvars="session_id={!$Api.Session_ID}&server_ur
</apex:pageBlock>
</apex:form>
</apex:page>
Here's the mxml code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns:salesforce="http://www.salesforce.com/"
creationComplete="login(event)"
viewSourceURL="srcview/index.html">
<salesforce:Connection id="connection"/>
<mx:Script>
<![CDATA[
import com.salesforce.objects.SObject;
import com.salesforce.results.QueryResult;
import com.salesforce.AsyncResponder;
import com.salesforce.objects.LoginRequest;
import mx.core.IUIComponent;
import mx.managers.DragManager;
import mx.events.DragEvent;
import mx.collections.ArrayCollection;
import flash.external.ExternalInterface;
[Bindable]
public var selectedItem:Object;
[Bindable]
public var selectedSOs:ArrayCollection = new ArrayCollection();;
private function login(event:Event):void {
var lr:LoginRequest = new LoginRequest();
lr.server_url = parameters.server_url;
lr.session_id = parameters.session_id;
lr.callback = new AsyncResponder(getCandidateSOs);
connection.login(lr);
}
private function getCandidateSOs(o:Object=null):void{
connection.query("Select Id, A_Loc__c from Service_Order__c"
, new AsyncResponder(
function (qr:QueryResult):void {
candidateSOs.dataProvider = qr.records;
}));
}
]]>
</mx:Script>
<mx:Form id="frmPrintSO"
width="100%" height="75%"
borderStyle="solid" borderColor="#D4D4D4"
dropShadowEnabled="true" dropShadowColor="#B3B3B3"
shadowDirection="right" shadowDistance="10">
<mx:FormHeading label="Signature SOs" />
<mx:HBox>
<mx:VBox>
<mx:Label text="Candidate SOs"/>
<mx:DataGrid id="candidateSOs"
allowMultipleSelection="true"
dragEnabled="true"
dropEnabled="true"
dragMoveEnabled="true">
<mx:columns>
<mx:DataGridColumn dataField="Name"/>
<mx:DataGridColumn dataField="A_Loc__c"/>
</mx:columns>
</mx:DataGrid>
</mx:VBox>
</mx:HBox>
</mx:Form>
</mx:Application>
