[flexcoders] Re: CAIRNGORM 0.99 QUESTION
Hi, Thanks for the reply. You must be a very experienced programmer because you just looked at the suggestion and found the problem it will create two steps down. I have experienced the same problem that you mentioned below if I use recommended mx:Application tag instead of cairngorm:CairngormApplication tag, but I had to spend considerable time to nail down the cause, which I believe, and like you said, is that the ServiceLocator.getInstance() is failing because it hasn't been initialized yet. 1. How can I ensure that my services are created before my front controller in the Index? 2. Does this approach of creating delegates in Command Constructor has any advantage/disadvantage? Thanks Regards, Rohit Chhabra. --- In flexcoders@yahoogroups.com, Daniel Harfleet [EMAIL PROTECTED] wrote: Hi, you would need to be carefull, because the command instances are created once only at creation of the FrontController. By creating a delegate instance, you are using the ServiceLocator to look up the remote object, however, if your service locator hasn't been initialized yet, you may get a no service found error. So make sure your services are created before you front controller if you are going to take this approach. --- In flexcoders@yahoogroups.com, flexcoding [EMAIL PROTECTED] wrote: Is it OK to have a constructor in the Command classes and have delegate initialized there rather than doing it in every time execute method is called? So Could the code of LoginCommand of sample code that came with CAIRNGORM 0.99 be changed to: class org.nevis.cairngorm.samples.login.commands.LoginCommand implements Command, Responder { private var delegate: CustomerDelegate; public function LoginCommand () { delegate = new CustomerDelegate( this ); } public function execute( event:Event ) : Void { var loginVO : LoginVO = LoginVO( event.data ); delegate.login( loginVO ); } //--- -- public function onResult( event : Object ) : Void { ModelLocator.workflowState = ModelLocator.VIEWING_LOGGED_IN_SCREEN; var loginDate : Date = Date( event.result ); ModelLocator.loginDate = loginDate; } //--- -- public function onFault( event : Object ) : Void { ModelLocator.statusMessage = Your username or password was wrong, please try again.; } } from /* Copyright 2005 iteration::two Ltd Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. @ignore */ import org.nevis.cairngorm.business.Responder; import org.nevis.cairngorm.commands.Command; import org.nevis.cairngorm.control.Event; import org.nevis.cairngorm.samples.login.business.CustomerDelegate; import org.nevis.cairngorm.samples.login.vo.LoginVO; import org.nevis.cairngorm.samples.login.model.ModelLocator; /** * @version $Revision: 1.4 $ */ class org.nevis.cairngorm.samples.login.commands.LoginCommand implements Command, Responder { public function execute( event:Event ) : Void { var delegate: CustomerDelegate = new CustomerDelegate( this ); var loginVO : LoginVO = LoginVO( event.data ); delegate.login( loginVO ); } //--- -- public function onResult( event : Object ) : Void { ModelLocator.workflowState = ModelLocator.VIEWING_LOGGED_IN_SCREEN; var loginDate : Date = Date( event.result ); ModelLocator.loginDate = loginDate; } //--- -- public function onFault( event : Object ) : Void { ModelLocator.statusMessage = Your username or password was wrong, please try again.; } } Yahoo! Groups Sponsor ~-- Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM ~- -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders
[flexcoders] CAIRNGORM 0.99 QUESTION
Is it OK to have a constructor in the Command classes and have delegate initialized there rather than doing it in every time execute method is called? So Could the code of LoginCommand of sample code that came with CAIRNGORM 0.99 be changed to: class org.nevis.cairngorm.samples.login.commands.LoginCommand implements Command, Responder { private var delegate: CustomerDelegate; public function LoginCommand () { delegate = new CustomerDelegate( this ); } public function execute( event:Event ) : Void { var loginVO : LoginVO = LoginVO( event.data ); delegate.login( loginVO ); } //--- -- public function onResult( event : Object ) : Void { ModelLocator.workflowState = ModelLocator.VIEWING_LOGGED_IN_SCREEN; var loginDate : Date = Date( event.result ); ModelLocator.loginDate = loginDate; } //--- -- public function onFault( event : Object ) : Void { ModelLocator.statusMessage = Your username or password was wrong, please try again.; } } from /* Copyright 2005 iteration::two Ltd Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. @ignore */ import org.nevis.cairngorm.business.Responder; import org.nevis.cairngorm.commands.Command; import org.nevis.cairngorm.control.Event; import org.nevis.cairngorm.samples.login.business.CustomerDelegate; import org.nevis.cairngorm.samples.login.vo.LoginVO; import org.nevis.cairngorm.samples.login.model.ModelLocator; /** * @version $Revision: 1.4 $ */ class org.nevis.cairngorm.samples.login.commands.LoginCommand implements Command, Responder { public function execute( event:Event ) : Void { var delegate: CustomerDelegate = new CustomerDelegate( this ); var loginVO : LoginVO = LoginVO( event.data ); delegate.login( loginVO ); } //--- -- public function onResult( event : Object ) : Void { ModelLocator.workflowState = ModelLocator.VIEWING_LOGGED_IN_SCREEN; var loginDate : Date = Date( event.result ); ModelLocator.loginDate = loginDate; } //--- -- public function onFault( event : Object ) : Void { ModelLocator.statusMessage = Your username or password was wrong, please try again.; } } Yahoo! Groups Sponsor ~-- Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM ~- -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Re: datagrid height
Hi Matt, If the datagrid is in Accordian and still hidden, the rowcount property is not working somehow. If the results change when the datagrid is visible, it works. Any clue? Regards... --- In flexcoders@yahoogroups.com, Matt Chotin [EMAIL PROTECTED] wrote: http://livedocs.macromedia.com/flex/15/asdocs_en/mx/controls/listclas ses/Scr ollSelectList.html#rowCount http://livedocs.macromedia.com/flex/15/asdocs_en/mx/controls/listcla sses/Sc rollSelectList.html#rowCount :-) _ From: Robert Brueckmann [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 01, 2005 9:44 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] datagrid height Hey guys...I am trying something and getting a strange behavior. I get an array of objects from the database that becomes the data provider for my datagrid. I know the length of my data provider thanks to the myDataGrid.dataProvider.length method and I figure I could multiply that number by some arbitrary number of pixels to ensure that however many items are in my data provider, that's how many rows are visible in my datagrid on the screen...so the datagrid is never scrollable. I'm using a method that sets the dataprovider of the datagrid, myDataGrid.dataProvider = data; and then I'm calling myDataGrid.setSize(Stage.width - 35, myDataGrid.dataProvider.length * 25); The Stage.width - 35 compensates for some other things on the screen to look proportionate and the myDataGrid.dataProvider.length * 25 is just guesstimating that each row in the datagrid component is about 25 pixels high. Well the first time I tried this, 25 was too large of a number so I adjusted it to 22, which seemed to work but still left me with a little extra bit of a final row visible. Well that was livable. Then I get a result set back that only had 2 items in it, instead of the 5 I had been testing this whole thing with and now only one row was visble and you have to scroll down to see the second row, so I increased the 22 to 30 and that fixed it for that but now if I call the original result set with the 5 items, I can see a row and a half extra blank rows. Is there a better way to dynamically show the number of rows based on the number of items in the data provider? I wish there was a size attribute like there is with the HTML select list component where if it's a list you can say I want x-number of rows visible. I just don't ever want the user to have to scroll within the datagrid...is there an easier way to do this? Thanks! _ This message contains information from Merlin Securities, LLC, or from one of its affiliates, that may be confidential and privileged. If you are not an intended recipient, please refrain from any disclosure, copying, distribution or use of this information and note that such actions are prohibited. If you have received this transmission in error, please notify the sender immediately by telephone or by replying to this transmission. Merlin Securities, LLC is a registered broker-dealer. Services offered through Merlin Securities, LLC are not insured by the FDIC or any other Federal Government Agency, are not deposits of or guaranteed by Merlin Securities, LLC and may lose value. Nothing in this communication shall constitute a solicitation or recommendation to buy or sell a particular security. Yahoo! Groups Sponsor ADVERTISEMENT http://us.ard.yahoo.com/SIG=129qdkk5d/M=298184.6018725.7038619.30011 76/D=gr oups/S=1705007207:HM/EXP=1109774669/A=2593423/R=0/SIG=11el9gslf/*http :/www.n etflix.com/Default?mqso=60190075 click here http://us.adserver.yahoo.com/l? M=298184.6018725.7038619.3001176/D=groups/S= :HM/A=2593423/rand=756983836 _ Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] subject=Unsubscribe * Your use of Yahoo! Groups is subject to the Yahoo! http://docs.yahoo.com/info/terms/ Terms of Service. Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Re: Flex Cairngorm question
Hi Agha, Thanks for your response... With your help I found that event.call.methodName gives the method name that was invoked in the execute method of command. I see the command to be closer to the UI. So I am thinking of doing everything in response to a user action from within a single command, otherwise I will have to invoke these different commands from the UI. I have designed my delgate methods at a more granular level for the sake of modularity and reuse from different commands. What do you think? Regards, Rohit Chhabra. --- In flexcoders@yahoogroups.com, Mehdi, Agha [EMAIL PROTECTED] wrote: Rohit, Q1: I haven't tried it because I never had to but I think that when the results come back from delegate in the event object, the object also has a property called method or operation. You can loop over the event object to see what properties it has. If there's a property holding the method name, you're good to go. If not then you'd need to execute the methods synchronously and have a flag inside the command that is set to whatever method you're going to call. In your onResult, you can than check for that flag and execute the next method. I'd rather create separate commands to execute each delegate's method as opposed to using one command do all. That will help with chaining commands easily until we have Cairngorm 0.99. Please let me know if you have any questions. Thanks Agha -Original Message- From: flexcoding [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 13, 2005 8:41 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Flex Cairngorm question Hi Gurus, Any response to the following questions about Cairngorm? Posting it again in the forum because the original is burried deep inside. Thanks for the help in advance... Hello Guys, I just started Flex development two months back and we are trying to develop an enterprise level application. So we decided to use open source Cairngorm Framework v 0.9 by Iteration Two. Though it lacks ample documentation, we straightway found its benefits as it neatly separates and organizes the mxml/action script code. Kudos to the developers of this great framework. We found this to be very benefitial for a big size application. I have two questions releted to the Cairngorm framework for rich internet apps: Question 1. If we need to execute multiple delegate methods in response to one user action, should we write a command action script for each of the methods? Or can we just have one command corresponding to each user action and invoke more than one delegate method in the execute method of this single command? If we can do the latter, is there a way to know in the onResult method that the respons is coming from which delegate method's execution and take appropriate action? Question 2. In the Java business classes, we return POJOs. Do they need to be converted to MXML Value Objects? We tried to directly pass these pojos to the view helpers do display them in the application and it seems to work perfectly. Are we doing something wrong or can there be any design problems in doing that which I am not realizing at the moment? Thanks Regards, Rohit Chhabra. Yahoo! Groups Links This email may contain confidential and privileged material for the sole use of the intended recipient(s). Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply email and delete all copies of this message. To reply to our email administrator directly, send an email to [EMAIL PROTECTED] Littler Mendelson, P.C. http://www.littler.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Re: Flex Cairngorm question
Hi Gurus, Any response to the following questions about Cairngorm? Posting it again in the forum because the original is burried deep inside. Thanks for the help in advance... Hello Guys, I just started Flex development two months back and we are trying to develop an enterprise level application. So we decided to use open source Cairngorm Framework v 0.9 by Iteration Two. Though it lacks ample documentation, we straightway found its benefits as it neatly separates and organizes the mxml/action script code. Kudos to the developers of this great framework. We found this to be very benefitial for a big size application. I have two questions releted to the Cairngorm framework for rich internet apps: Question 1. If we need to execute multiple delegate methods in response to one user action, should we write a command action script for each of the methods? Or can we just have one command corresponding to each user action and invoke more than one delegate method in the execute method of this single command? If we can do the latter, is there a way to know in the onResult method that the respons is coming from which delegate method's execution and take appropriate action? Question 2. In the Java business classes, we return POJOs. Do they need to be converted to MXML Value Objects? We tried to directly pass these pojos to the view helpers do display them in the application and it seems to work perfectly. Are we doing something wrong or can there be any design problems in doing that which I am not realizing at the moment? Thanks Regards, Rohit Chhabra. Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Flex Cairngrom question
Hello Guys, I just started Flex development two months back and we are trying to develop an enterprise level application. So we decided to use open source Cairngorm Framework v 0.9 by Iteration Two. Though it lacks ample documentation, we straightway found its benefits as it neatly separates and organizes the mxml/action script code. Kudos to the developers of this great framework. We found this to be very benefitial for a big size application. I have two questions releted to the Cairngorm framework for rich internet apps: Question 1. If we need to execute multiple delegate methods in response to one user action, should we write a command action script for each of the methods? Or can we just have one command corresponding to each user action and invoke more than one delegate method in the execute method of this single command? If we can do the latter, is there a way to know in the onResult method that the respons is coming from which delegate method's execution and take appropriate action? Question 2. In the Java business classes, we return POJOs. Do they need to be converted to MXML Value Objects? We tried to directly pass these pojos to the view helpers do display them in the application and it seems to work perfectly. Are we doing something wrong or can there be any design problems in doing that which I am not realizing at the moment? Thanks Regards, Rohit Chhabra. Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/