Hey guys,
  I have followed the RealEstate example to create my onClick handler for a 
flash form.  (I need onClick because each action does something differen't and 
I can't have the look and feel of the page with out cfform, and can't have 
nested form's either.) So I have setup the actionScript in <cfformitem 
type="script"> tag, and setup cfc's as well.  But now as soon as I click on the 
button I get the following error.

"The 2 parameter of the Left function, which is now 0 must be a positive 
integer."  

I have no clue what this error is about.  I don't know which left function its 
talking about either. Does the stat object returned in responseHandler onStatus 
have any thing other than stat.description so I can look at as to what is going 
on?

Please Help.

Attached bellow is my code.

<cfformitem type="script">
    function formOnLoad(){
       myform.myGlobalObjects = {};
       setUpRemoting();
       setStyles();
    }
                            
    function setStyles():Void {
       _global.styles.ComboBox.setStyle("color", 0x00253D);
       _global.styles.Label.setStyle("color", 0x222222);
       _global.styles.CheckBox.setStyle("color", 0x00253D);
       _global.styles.RadioButton.setStyle("color", 0x00253D);
       _global.styles.Form.setStyle("color", 0x222222);
       _global.styles.Button.setStyle("color", 0x222222);
       _global.styles.Button.setStyle("borderThickness", 1);
       _global.styles.Panel.setStyle("backgroundColor", 0xE5F0F9);
       _global.styles.Panel.setStyle("color", 0xffffff);
       _global.styles.Panel.setStyle("headerColors", [0x277DC6,0x50ABF7]);
    }

    function setUpRemoting(){
                                
       var connection:mx.remoting.Connection = 
mx.remoting.NetServices.createGatewayConnection("http://localhost/flashservices/gateway/";);
                                
       var componentPath = "#application.rootComponent#.listingServices";
    
       var responseHandler:Object  = {};
                              
       responseHandler.getInit_Result = function( results: Object ):Void {
          alert("DONE");
          mx.managers.CursorManager.removeBusyCursor();
       }
                                
       responseHandler.updateSeqInfo_Result = function( results: Object ):Void {
          alert("DONE");
          mx.managers.CursorManager.removeBusyCursor();
       }
                                
       responseHandler.onStatus  = function( stat: Object ):Void {
          alert("Error: " + stat.description);
          mx.managers.CursorManager.removeBusyCursor();
       }
                                
       myform.myGlobalObjects.Services = connection.getService(componentPath, 
responseHandler);
       alert(myform.myGlobalObjects.Services.getInit());
    }
                            
    function updateSeqInfo():Void{
        var seqInfoArgs = {};
                                    
        seqInfoArgs.comment = seqComment.text;
        seqInfoArgs.id = #sequenceId#;
                                
        mx.managers.CursorManager.setBusyCursor();
                                
myform.myGlobalObjects.Services.setSeqWrapper(seqInfoArgs);
                                
    }
                           
</cfformitem>   

<cftextarea name="seqComment" value="#s.comments#" id="comments" rows="5" 
cols="50"/>
<cfinput type="button" value="Update" name="update" onClick="updateSeqInfo()"/>

Here is my cfc code for listingServices.cfc.

<cfcomponent access="remote" hint="Remote Facade for listing">

        <cffunction name="setSeqWrapper" access="remote" returnType="string" 
output="false" hint="Update Sequence Info table.">
        
                <cfargument name="id" type="numeric" default="0" required="yes">
        <cfargument name="comment" type="string" default="">
        
        <cfset var gatekeeper = 
createObject("component",application.rootComponent&".listingGateway")/> 
        <!---<cfreturn gatekeeper.updateSeqInfo(id=id, comment=comment) />--->
        
        <cfreturn 
createObject("component",application.rootComponent&".listingGateway").setSeqInfo(argumentCollection=arguments)>
    
    </cffunction>

        <cffunction name="getInit" access="remote" returntype="string">
        <cfreturn "test">
    </cffunction>
        
</cfcomponent>




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:290286
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to