[flexcoders] Problem with Cairngorm and RemoteObject

2006-08-20 Thread Dong Lee





Hi,

Not using ColdFusion I'm trying to retrieve login 
related data from the serverthrough RemoteObject, andgetting this 
fault error message 
faultCode:InvokeFailed 
faultString:'[MessagingError 
message='Unknown destination 'mylogin'.']' 
faultDetail:'Couldn't establish a 
connection to 'mylogin''

However the destinationof 'mylogin' is 
defined inremoting-config.xml.I did a little testing without using 
Cairngorm and it works fine with following tag

mx:RemoteObject id="loginService" 
result="resultHandler(event)"destination="mylogin"fault="faultHandler(event)"mx:method name="LoginService" 
results="resultHandler(event)"
 
mx:arguments
 
p_login{loginVO}/p_login
 
/mx:arguments
 /mx:method
/mx:RemoteObject

Am I missing something?My 
programfollows the typical Cairngorm flow as below:

1. Services.mxlm
mx:RemoteObject id="loginService" 
destination="mylogin"result="event.token.resultHandler(event)"fault="event.token.faultHandler(event)"showBusyCursor="true" 
/mx:RemoteObject


2. LoginDelegate.as
public class 
LoginDelegate{ private var responder : 
Responder;private var service : 
AbstractService;
 public function LoginDelegate( 
p_responder : Responder ) { 
this.service = ServiceLocator.getInstance().getService( "loginService" 
); this.responder = p_responder; 
}public function login( p_loginVO : LoginVO ): 
void{ var call:AsyncToken = service.LoginService(p_loginVO);
call.resultHandler = 
responder.onResult;call.faultHandler = 
responder.onFault;}
}


3. LoginEvent.as
public class LoginEvent extends 
CairngormEvent {public static const 
EVENT_LOGIN : String = "login";public var loginVO : 
LoginVO;

public function LoginEvent( p_loginVO : LoginVO ) 
{super( EVENT_LOGIN, false, true 
);this.loginVO = 
p_loginVO;}}

4. LoginCommand.as

 public function execute( p_event 
: CairngormEvent ) : void 
{ var delegate : 
LoginDelegate = new LoginDelegate( this ); 
 var loginEvent : LoginEvent = 
LoginEvent( p_event );  
 delegate.login( loginEvent.loginVO 
); } public function 
onResult( event : * = null ) : void 
 {  

 }

 public function onFault( event : 
* = null ) : void  { 
 
 }



__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Software development tool
  
  
Software development
  
  
Software development services
  
  


Home design software
  
  
Software development company
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  






__,_._,___



[flexcoders] Reusable Component / Object Oriented Program

2006-07-03 Thread Dong Lee






I'd like tofind outif it can be done 
with Flex,the component's skeletonis 
like below code snippet:


To make this component reusable for different 
search cases likeCustomerSearch,OrderSearch, 
followingcontrols, functionshave to be worked out at runtime using 
an actionscript class that can evaluate the case and assign appropriate form, 
datagrid.

1. Form : formSearch
2. Datagrid : dgSearchResult
3. addRow(), modRow(), delRow()


I want to have only one generic search component 
inthe application rather than creating multiple of them with specific 
casesusing viewstack. I

How do I instantiate the formSearch 
withspecific forms defined inmxlm filese.g.. 
formCustomerSearch.mxlm, formOrderSearch.mxlm?
What about dgSearchResult?



Code Snippet
===

?xml version="1.0" 
encoding="utf-8"?

mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" 
xmlns="*" layout="vertical"height="662" width="664"

mx:Script![CDATA[function 
addRow():void{}function 
modRow():void{}function 
delRow():void{}

 
]]/mx:Script

 mx:VDividedBox width="100%" 
height="100%"mx:HBox width="100%" 
height="100%"  mx:Form 
id="formSearch" width="90%" height="100%" / 
 mx:VBox width="10%" 
height="100%" borderStyle="solid" 
verticalGap="15" 
paddingTop="10" paddingBottom="10" paddingLeft="10" 
paddingRight="10"  
mx:Button id="btnSearch" 
label="Search"/  
mx:Button id="btnReset" 
label="Reset"/  
mx:CheckBox id="cbAddResults" label="Add Results?" 
/  
mx:Button id="btnClose" label="Close" 
/ 
/mx:VBox 
/mx:HBox 
 mx:DataGrid 
id="dgSearchResult" dataProvider="{dgResults}" width="100%" height="100%" 
/ /mx:VDividedBox 
 mx:ControlBar width="100%" 
height="10%" !-- Use 
Spacer to push Button control to the right. 
-- mx:Spacer 
width="100%"/ 
 mx:Button label="Add" 
click="addRow();"/ 
mx:Button label="Mod" 
click="modRow();"/ 
mx:Button label="Del" click="delRow();"/ 
/mx:ControlBar

/mx:TitleWindow
__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  






__,_._,___



[flexcoders] Is it possible to replace UI controls in mxml at runtime?

2006-06-20 Thread Dong Lee





Hi,

I'mcreating a generic Search 
componentthat contains few buttons, a form, say 'formSearch'to 
capture the search parameters. 
Using the component I need to serach on persons, 
accounts, transactions etc. and have separate PersonSearch, AccountSearch, 
TransactionSerach

1. Is it possible to 
replace the 'formSearch' with another form at runtime?How would you do it 
and at whatevent?
2. Are there any preference 
betweenMXMLandAS for this purpose?


Dong
__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  






__,_._,___