Flex Cairngorm

Can I get Cairngorm questions answered here?
I try...
When My application start up I need to instanciate a VO.
This I do in the entry constructor of the ModelLocator
public function KostModelLocator() {
if ( modelLocator != null )
throw new Error( "Only one KostModelLocator instance should
be instantiated" );
var currentDate : Date = new Date();
selectedDay = new Day(currentDate);
The Day(Date) is defined in the Model\Day.as
I call the Day constructor with the current date.
public class Day
// Constructor
public function Day ( date : Date ) {
setDate(date);
//Public functions
public function setDate ( date : Date ) : void {
day.date = date;
day.dayString = extractDayString(date);
day.dayId = 37;
But now the problem is when I will update the day.dayId. This
should not be a static value (37). But instead I should get some
day id from the database.
How is this done?
I was thinking about initiating a event calling the command
that gets the date id from the database and automatically updates
the id.
But then I don’t think that a model should initiate an
event..
How do I do this?

Yeah i registered, but i couldn't find zip file. Could you please tell me where is that example
Thanks,
ApacheFlex.

Similar Messages

  • FLEX+CAIRNGORM+BLAZEDS+JAVA+DATABASE

    A very simple example for FLEX+CAIRNGORM+BLAZEDS+JAVA+DATABASE.
    http://vijaaay.limewebs.com/forum/viewthread.php?tid=26&extra=page%3D1
    or
    visit  www . flexindia . tk >> Flex Examples
    The attachment zip contains the source  files[ FLEX and JAVA ] and Readme.txt which helps you to setup this  example.
    Regards,
    Vijay

    Yeah i registered, but i couldn't find zip file. Could you please tell me where is that example
    Thanks,
    ApacheFlex.

  • Flex + cairngorm problem with 2 webservice

    hi i want to retrive data from 2 webservices using cairngorm.  flex can get data from the firsone and from the second is telling that doesn't see method, for me it is cos service it trying to find method from second webservice in this firstone. so when shoudl i call second service? or how can i clear service, i am sure that i call proper method.
    public function runApp():void
        services.serviceURL = "http://localhost:84/Service1.asmx?wsdl";
        new GetService1Event().dispatch();
        services.logout();
        services.serviceURL = "http://localhost:85/service2.asmx?wsdl"
        new GetService2Event().dispatch();   

    Hi,
    check the type of sandbox when you run it localy and from server.
    Security.sandboxType

  • New Flex WebSite in Cairngorm Framework

    Hello All,
    I am a newbie to flex. Somehow i learnt flex technology, Cairngorm Framework and ActionSript 3.0. Now i am planning to start flex website.
    My architecture,
    FLEX[CairnGorm] --> .NET WEB-SERVICES --> MY-SQL 5.0
    Now, i had the project set up. My only doubt is, what to use for the flex pages, Module or States or Componets ?????
    I know the advantages and disadvantages of each.But i appreciate if any expert guides me ....
    Also hwo to change the states of pages in Cairngorm framework..is this done in commad where we vhave the actual business process and get the results
    from the web service ?
    Please guide me...
    Regards,
    Ravie

    WebOrb allows you to use AMF with .NET. You don't have to stick to web services / XML:
    http://www.themidnightcoders.com/products/weborb-for-net/developer-den/technical-articles/ introduction-to-flex-and-net-integration.html
    Concerning Modules, States and Components, you must be confused. They are not of the same nature.
    - Modules are to break down an application into smaller chunks you can download as needed.
    - Components are reusable (usually visual) classes that you can instantiate in MXML or ActionScript and that can themselves be written in MXML or ActionScript
    - States represent the states of a given component
    You can use all of these in a single project.
    In addition, use the history manager and URL fragments for deep linking so users can bookmark you can link directly to a given section of your Flex website.
    >>> Also, how do you change the state of pages with the Cairngorm framework ? Is it done in commands where we have the actual business process and get the results from the web service ?
    You can use the presentation model pattern. The view state and view logic of each view are located in a corresponding presentation model. When a command calls a service and gets a result, it modifies the application model the presentation model binds to, thereby triggering a change of state in the UI trough data binding.
    The view binds to the PM. The PM binds to the application object model. The command updates the latter. Via data binding, both the PM and the view are updated. For example, the view state that is maintained in a PM can correspond to an actual state in the view defined in the <mx:states> tag:
    http://blogs.adobe.com/tomsugden/parsley/

  • Refactoring HttpService to RemoteObject

    We are working on our first Flex/Cairngorm/J2EE proof of
    concept for the eventual rewrite of a large application (We are
    still very new to Flex). We have not yet committed to a
    communication mechanism (HttpService or RemoteObject). So our
    current goal is to use HttpService and then switch over to
    RemoteObject after a while. Although Cairngorm's ServiceLocator
    pattern attempts to abstract away this decision, the sample code
    seems to be still coupled to the communication protocol.
    Here is sample code for calling a RemoteObject service in the
    Cairngorm documentation:
    var service = ServiceLocator.getInstance().getService(
    "productService" );
    service.getProducts();
    However, we are under the impression that if the service
    changes to an HttpService, the second line will have to be changed
    to:
    service.send();
    For an application that makes a lot of service calls, this
    would be a painful refactoring. Has anyone come up with a
    methodology to switch between communication protocols without
    having to refactor large amounts of code?

    Is there anything that I can add to clear up the
    question?

  • Potential bug when using Parsley 2.4.1 and Cairngorm's module 0.17 in Flex 4.5.1

    Hi
    I have an issue when using cairngorm's ModuleViewLoader along with ParsleyModuleDescriptor to load a simple module consistig mainly of HBoxes, VBoxes and Datagrids.
    The module consists of one child (let's call it ViewA) and that child consists of several children as its components.
    When I use cairngorm's ModuleViewLoader along with the ParsleyModuleDescriptor and Parlsey to inject the modulemanager in my main app, the module loads, as well as ViewA but some nearly all of ViewA's children are not loaded (in fact they're initialized but creationComplete is not invoked).
    When I use Flex's mx:ModuleLoader all ViewA's chikldren are initialized and creation complete is also invoked.
    I will attach the source as a zip file  later on....
    but for now...this is all I can give http://dpaste.com/713503/
    Thanks
    Andreas

    Did you ever find an answer to this?  I am running into the same issue with needing to upgrade parsley to 2.4.x, but with parts of application heavily relying on cairngorm module, upgrading it from module-0.11 to 0.17 seems to break compile! 

  • How to use cairngorm framework in flex 4?

    Hi Everyone!
    Right now i am working with Flex 3.5 sdk using cairgorm architecture. Now i want to move to Flex 4 sdk with cairgorm architecture. I tried to use the cairngorm architecture in flex 4 sdk. But i did not get the output.
         Please anyone let me know how to use the cairngorm artchitecture in flex 4 sdk.
    Thanks in advance.!

    Read about Presentation Model. Refactor towards that and you should fine.
    C

  • Flex 4.5 - Cairngorm Module Support error with creationComplete

    Hi
    As a starting point I've already posted a thread (see link below)
    http://forums.adobe.com/thread/970855?start=0&tstart=0
    but I've had no luck in solving this.
    I have an mx:Application which loads a module defined in ShellContext(see below) using a ParsleyModuleDescriptor and is loaded using Cairngorn's ModuleViewLoader with BasicLoadPolicy.
    The module loads fine, however the module's children/components are not initialized correctly.
    The module is called DashboardModule. Its creationComplete handler is invoked last.
    The DashboardModule contains DashboardView and DashboardView's creationComplete also gets invoked second to last,
    however DashboardView's children's creationComplete never get invoked.
    So in particular, in DashboardView, the mx:ApplicationControlBar, the mx:Button, and the presentation:DashboardSearchView, presentation:DashboardMyApproval etc etc, are all initialized ( i can see the traces that are added there) but their creationComplete handlers never get invoked.
    I have tried adding creationPolicy="all", at application level, at module level and at component level with no luck.
    I have spent 2 whole days on this and I still haven't been able to figure out the problem.
    We've used cairngorm modules before with Parsley and Flex 4.5.1 and we've never had such a problem.
    To be more precise, I have the following configuration:
    ---ShellContext
    <fx:Object>
            <commonPresentation:NavigationHandlerPM id="navigationPM"/>
            <module:ParsleyModuleDescriptor objectId="dashboard"
                url="DashboardModule-1.0-SNAPSHOT.swf"
                applicationDomain="{ ClassInfo.currentDomain }"/>
    </fx:Object>
    --DashboardModule.mxml
    <mx:Module
        width="100%" height="100%"
        backgroundColor="white"
        horizontalAlign="left"
        verticalAlign="top"
        layout="vertical" verticalScrollPolicy="off" horizontalScrollPolicy="off"
              creationComplete="creationComplete();"
        xmlns:mx="library://ns.adobe.com/flex/mx"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:spicefactory="http://www.spicefactory.org/parsley"
        xmlns:cairngorm="com.adobe.cairngorm.*"
        xmlns:presentation="com.test.presentation.*">
        <fx:Declarations>
            <spicefactory:ContextBuilder id="spiceFactoryContextBuilder">
                                  <cairngorm:CairngormModuleSupport/>
                                  <cairngorm:CairngormIntegrationSupport/>
                                  <cairngorm:CairngormNavigationSupport/>
                                  <spicefactory:FlexConfig type="{DashboardContext}"/>
                                  <spicefactory:ViewSettings autowireComponents="true"/>
            </spicefactory:ContextBuilder>
            <spicefactory:FastInject  property="model" type="{DashboardPM}"/>
            <spicefactory:Configure/>
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
                [Bindable]
                [Inject(id="dashboardPM")]
                public var model:DashboardPM;
                private function creationComplete():void
                    trace('i should be called last god damn it');
                    model.startLoading();
            ]]>
        </fx:Script>
        <mx:VBox
            width="100%" height="100%"
            verticalScrollPolicy="off" horizontalScrollPolicy="off">
            <presentation:DashboardView
                width="{this.width}" height="{this.height}"
                verticalScrollPolicy="on" horizontalScrollPolicy="on"
                userProfile="{shell.userProfile}"/>
        </mx:VBox>
    </mx:Module>
    ----DashboardView.mxml
    <mx:VBox
        width="100%" height="100%"
        creationComplete="createComplete()"
              xmlns:mx="library://ns.adobe.com/flex/mx"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:spicefactory="http://www.spicefactory.org/parsley"
        xmlns:presentation="com.db.paragon.common.module.dashboard.presentation.*">
        <fx:Declarations>
            <spicefactory:Configure/>
        </fx:Declarations>
       <fx:Script>
            <![CDATA[
            import mx.core.FlexGlobals;
            import mx.utils.StringUtil;
            [Bindable]
            [Inject]
            public var searchModel:DashboardSearchPM;
            [Bindable]
            private var _userprofile:UserProfile;
            public function get userProfile():UserProfile {
                return this._userprofile;
            public function set userProfile(userPr:UserProfile):void {
                this._userprofile = userPr;
                setUserWelcomeString();
            public function createComplete():void {
                  trace('i should be called second to last');
            ]]>
        </fx:Script>
        <mx:ApplicationControlBar
                initialize="trace('initialise control bar');" creationComplete="trace('controlbar complete');"
            width="100%"
            horizontalAlign="right"
            verticalAlign="middle">
            <mx:Text
                width="97%"
                left="10"
                fontSize="14"
                fontThickness="12"
                fontWeight="bold"
                textAlign="left"
                selectable="false" text="{userWelcomeString}"/>
            <mx:LinkButton id="help"
                width="60"
                color="gray"
                textAlign="right"
                label="Help"
                click='navigateToURL(new URLRequest(urlToHelp));'/>
        </mx:ApplicationControlBar>
        <mx:Button initialize="trace('initialise button')" creationComplete="trace('button complete');"/>
        <presentation:DashboardSearchView initialize="trace('initializesearchview');" creationComplete="trace('searchviewcomplete');" creationPolicy="all"/>
        <presentation:DashboardMyApproval initialize="trace('initializeapproval');" creationComplete="trace('approvalcomplete');" creationPolicy="all"/>
        <presentation:DashboardPendingApproval initialize="trace('pendingapproval');" creationComplete="trace('pendingapprovalcomplete');" creationPolicy="all"/>
        <presentation:DashboardReviewsDue initialize="trace('reviewsdue');" creationComplete="trace('reviewsdue');" creationPolicy="all"/>
        <presentation:DashboardHistCreditApplications initialize="trace('histcreditapps');" creationComplete="trace('histcredcomplete');" creationPolicy="all"/>
        <presentation:DashboardRatingWriteups initialize="trace('ratingwriteups');" creationComplete="trace('ratingwriteupslcomplete');" creationPolicy="all"/>
        <presentation:DashboardNotifications initialize="trace('notifications');" creationComplete="trace('notificationscomplete');" creationPolicy="all"/>
    </mx:VBox>
    Any help is greatly appreciated.

    Yes, there are all kinds of problems when you remove something from the screen that had focus (for instance, at that point you can't capture keyboard events either).
    My code is sprinkled with so many things to make sure something is in focus, I tend to forget that I've done it.
    In your code that changes the currentState, add
    this.setFocus()
    HTH;
    Amy

  • How to achieve modularize in flex using cairngorm framework?

    Hi,
    I have seen many articles on flex and cairngorm but haven't found enough information on how to achieve modularization in flex using cairngorm framework.
    Please let me know any information regarding this.
    Thanks in advance.
    Vishnu

    Hi Sumit,
    I am also working similar kind of requirement. In my case I tried to add new tab subtab using personalization , how ever the add new item button is not enable.
    So I created new stacklayout and tried to add this to new tab in the existing subtablayout by using co process form request code:
    public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    super.processRequest(oapagecontext, oawebbean);
    OracleCallableStatement oraclecallablestatement = null;
    OracleConnection oracleconnection = (OracleConnection)oapagecontext.getApplicationModule(oawebbean).getOADBTransaction().getJdbcConnection();
    try{
    oracleconnection.setAutoCommit(true);
    oraclecallablestatement = (OracleCallableStatement)oracleconnection.prepareCall("begin GLO_TMPVIJ_PRCV(:1); end;");
    oraclecallablestatement.setString(1,"In the custom co process request");
    oraclecallablestatement.execute();
    }catch(SQLException sqlexception)
    throw OAException.wrapperException(sqlexception);
    OASubTabLayoutBean subTabLayout =
    (OASubTabLayoutBean)oawebbean.findChildRecursive("ApplicationDetsTabLayout");
    OASubTabBarBean subtabbar = (OASubTabBarBean)oawebbean.findIndexedChildRecursive("subTabBar");
    OALinkBean link = (OALinkBean)oapagecontext.getWebBeanFactory().createWebBean(oapagecontext,
    OAWebBeanConstants.LINK_BEAN, null,
    "link");
    OAStackLayoutBean commentsRN =
    (OAStackLayoutBean)oapagecontext.getWebBeanFactory().createWebBean(oapagecontext,
    "/xxhr/oracle/apps/irc/candidateManagement/webui/CommentsRn",
    "CommentsRn", // always specify name
    true); // region created in Oracle9i JDeveloper OA Extension
    subTabLayout.addIndexedChild(commentsRN);
    subTabLayout.addIndexedChild(link);
    in this I am not ale to add the new tab.
    Regards,
    Vijay Reddy.

  • Does Cairngorm MVC support Flex 4.5?

    The latest Cairngorm MVC is version 3. Does it support Flex 4.5? Can it work with Spark components?

    From what I have learned, Cairngorm 3 isn't an MVC, it's a collection of utility libraries, and I believe it does work with current versions of Flex.
    Cairngorm 2 on the other hand is an MVC, and does not seem to be supported in Flex 4.*  If anyone can offer additional info or insight into this, please do.

  • Cairngorm and flex licensing

    Hi
    We are planning to use Cairngorm and Flex in our project.From the sites we understood that these are open source frameworks.Do we get any issues regarding license or any charges if we use these for deployment in production environment.
    Can uou please provide us licensing information or charges about cairngorm,flex, and Blaze DS.

    >apologize for that...but i didn't get any reply
    I replied !!
    Aandi Inston

  • Cairngorm Modules Library and Flex 3

    Are there any plans for the Cairngorm Modules Library to support Flex3 Projects. There's no Flex 3 SWC for the latest version (0.9) available.
    Patrick

    We use conditional compilation and Maven in order to generate the a Flex 3 and Flex 4 version of all libraries. The module library was trickier to setup but I think we're almost there. But you can build it yourself from trunk with using the Flex3 conditional compilation flag and with removing the classes that don't compile (that's i.e. what we want Maven to do for us).

  • Removal of Cairngorm 2 from a Flex SDK 3.4 project?

    Hello,
    I am looking into how practical it is to remove the Cairngorm 2 MVC from my project.  It is currently using Flex SDK 3.4, but I wish to move it to Flex 4, and it seems like Cairngorm 2 is incompatiable.  Cairngorm 3 is a totally different beast, so it's not as easy as just upgrading to that (I wish it was).
    My main difficulties lie in replacing some of the core functionalities Cairngorm has provided for this project including:
    com.adobe.cairngorm.control.CairngormEvent;
    com.adobe.cairngorm.vo.IValueObject;
    com.adobe.cairngorm.model.IModelLocator;
    Does anyone have experience with "removing" or "substituting" those Cairngorm elements with something native to Flex, or other MVCs such as Parsley?  I have not used Parsley so I'm unsure if it would help in this case or not.
    I realize this is a complicated question to ask here, but I just wanted to know if anyone had experience or a recommendation as to how to go about getting Cairngorm 2 removed from my application, short of re-writing the entire architecture of the application.  Thanks.

    OK, in case anyone else happens to stumble upon this, here is some of the progress I've been making on this as I have time.  I've found an easy fix for 2 of the 3 issues:
    com.adobe.cairngorm.vo.IValueObject;
    com.adobe.cairngorm.model.IModelLocator;
    Both of these classes are quite frankly empty classes, almost nothing in them at all.  I was therefore able to create my own versions of these clases, based on what I saw here:
    http://www.google.com/codesearch#l8D5yY3i8ho/trunk/code/src/com/adobe/cairngorm/vo/IValueO bject.as
    So, I just added a trimmed down version of those empty classes into a util folder in my classes, and changed the reference to that and bam, it works with no reference to cairngorm!!  I was floored by how simple that was for the IValueObject and the IModelLocator.  They all still work as expected and they're used all over the place.
    The other issue however, the CairngormEvent is proving to be more troublesome, especially since I have a multitude of Events and Services tied into a cairngorm FrontController, and so I have a business folder chuck full of a lot of dependent delegates, other related folders with commands, and events.  There are also CallBack events, etc.  It's a big mess, and so I'm still working on that, will probably have to create an alternate dispatch system for the web service events and write in custom stuff for it.  I did find this of great use when researching different ways to make web service calls through Flex without using MXML:  http://blogs.4point.com/brad.white/2008/12/4-ways-to-invoke-a-webservice-in-flex-with-mxml -and-actionscript.html
    So, hopefully that new info helps someone else stuck in this situation.

  • Help with Flex, Blaze and Cairngorm

    I using Blaze, Flex3 and Cairngorm, I have a simple
    application at the moment, in which I dispatch a Cairngorm event,
    it gets picked up the Command is executed and the Delegate can send
    data to the RemoteObject. I can see in the output that Blaze is
    doing what it is supposed to do and returning what it is supposed
    to return, but the data returned never makes it to the IResponder
    result function. What am I doing wrong? Can post code if
    needed.

    BlazeDS Console is where I am seeing the output. I don't see
    anywhere to attach code so I will put some here, is there any
    particular code you would like to see.
    <cairngorm:ServiceLocator
    xmlns:mx="
    http://www.adobe.com/2006/mxml"
    xmlns:cairngorm="
    http://www.adobe.com/2006/cairngorm">
    <mx:RemoteObject
    id="dataService"
    destination="dataService"
    makeObjectsBindable="true"
    source="com.example.apps.reports.service.DataService"
    showBusyCursor="true">
    </mx:RemoteObject>
    </cairngorm:ServiceLocator>
    GetUserCommand.as
    public class GetUserCommand implements ICommand, IResponder{
    public function execute( event : CairngormEvent ): void{
    var delegate:GetUserDelegate = new GetUserDelegate(this);
    delegate.getUsers();
    public function result( data : Object ) : void{
    Alert.show("We got to a result");
    GetUserDelegate.as
    public class GetUserDelegate{
    public function getUsers():void{
    var call:AsyncToken;
    call = service.getUsers();
    Alert.show("Get users was called");
    }

  • The MessagePerformanceUtils:totalTime issue in Flex 4 (rpc.swc) using LCDS 3.1 running under JDK1.6

    We are facing an issue while using LCDS 3.1 running under JDK1.6 in Sun Solaris v5.10 OS & Adobe Flex 4.
    Scenario :-
    ===================================
    As part of our Flex-based client-server application (with Java backend) we have a performance report generation module. Following flex framework class is used to calculate the performance of various layer of a typical server-based request-response cycle.
    ; (available in rpc.swc library file)
    (for example : server time, cairngorm time, UI screen rendering time, UI event generation time etc).
    The totalTime was working properly before upgrading the rpc.swc to Flex 4 ; However it broke after migrating to Flex SDK 4; The totalTime is now coming as negative junk value.
    As we understand that the above Flex framework class method works in conjunction with LCDS running at server side on JDK.
    We suspect that the new rpc.swc taken from Flex SDK 4 is causing the issue !
    System information :
    Web Server : Weblogic 11G
    Operating System : Sun Solaris v5.10 OS running on Sparc hardware.
    Flex : Adobe Flex sdk 4.0
    Flash player : Adobe Flash Player 10
    Browser : Internet Explorer 8
    LCDS : 3.1
    JDK : JDK 1.6.0_14
    ===================================
    Has anyone faced similar problem before ? Any help or direction would be highly appreciated.
    Thanks in advance,
    Rabi
     mx.messaging.messages.MessagePerformanceUtils :totalTime

    Nothing has changed in the Flex SDK sources for this class since sometime around 2008. Are you running against the same LCDS server as you were before you updated to Flex 4?  This certainly seems strange (and bad).  Do you see the same behavior with Flex 4.5?  What was the version of Flex you were using before switching to Flex 4.0?
    If you can provide the additional information, we will look in to this.  A reproducable case that was a simple mxml application along with a simple destination config would help us narrow the problem.
    Sorry for the problems!
    Tom

Maybe you are looking for