[Arp] Another ModelLocator Question

COLIN LIGHT colin.light at btopenworld.com
Wed Dec 20 08:32:16 PST 2006


Hi Nyls,
   
  I've just been looking at Grants arpx classes. Can you tell me do you use his CommandControl class? from what I can make out brings in commands from the 'command-config.xml'
   
  Col.
  
COLIN LIGHT <colin.light at btopenworld.com> wrote:
    Hi Nyls,
   
  Thanks again for getting back to me.
   
  Yeah this does make sense. I've been getting a little muddled up cos I downloaded Grants arpx (which doesn't seem to contain a ModelLocator) and christophes version which seems slightly different with a modelLocator with binding etc.
   
  Col.
  

nyls <info at nyls.nl> wrote:
        v\:* {behavior:url(#default#VML);}  o\:* {behavior:url(#default#VML);}  w\:* {behavior:url(#default#VML);}  .shape {behavior:url(#default#VML);}                Hey,
   
  The modellocator (ML) is a singleton so there is only one instance of it in your app. This is your single entry point to your data/ models from everywhere in your app. 
   
  I tend to use the ARPX –systemcontroller from Grant , So I let views listen to the systemcontroller for ‘update’ events.
   
  So when a command get’s it’s result it fills a model through the ML and dispatches an systemEvent
   
  ModelLocator.getInstance().setModel(ModelNames.NAVIGATION_MODEL,OCLiteVO(response.ocliteVO));
  SystemController.getInstance().dispatchEvent({type:EventNames.NAVIGATION_MODEL_CHANGE})
   
  And in the appropriate views I listen for thos system events and grab the model from the modellocator
   
  SystemController.getInstance().addEventListener(EventNames.NAVIGATION_MODEL_CHANGE, Proxy.create(this, navigationModelChanged));
  var navModel = ModelLocator.getInstance().getModel(ModelNames.NAVIGATION_MODEL).getValue();
   
  That’s how I do it,
   
  Is this of help ??
   
  nyls
   
   
      
---------------------------------
  
  Van: arp-bounces at ariaware.com [mailto:arp-bounces at ariaware.com] Namens COLIN LIGHT
Verzonden: Wednesday, December 20, 2006 2:37 PM
Aan: arp at ariaware.com
Onderwerp: [Arp] Another ModelLocator Question

   
  Hi List, 
     

    I'm (as ever) hoping someone can help me out with an ARP issue. I've been using arp for a few months now and just when I think I'm get it something else comes along and I question my own understanding :(

     

    I've been looking at the ModelLocator pattern, I have read previous post's about this and found some sample files although it does seem a little confusing. I downloaded the arpx classes http://www.herrodius.com/upload/arp_extensions.zip which contain quite a comprehensive version with databinding etc, I've also seen and much simpler single class version which I have been trying to use.

     

    I have a number of ArpForms which compose my views. Within these forms are other Arpforms which effectively are like components.

     

    What I'm struggling with is how to populate mx components in my component forms, is it good practice to import my modelLocator class and then have an update method which gets called from the main application class when the model gets populate or create a listener on each form for update events from the modelLocator? 

     

    Col.


_______________________________________________
Arp mailing list
Arp at ariaware.com
http://ariaware.com/mailman/listinfo/arp_ariaware.com

_______________________________________________
Arp mailing list
Arp at ariaware.com
http://ariaware.com/mailman/listinfo/arp_ariaware.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/arp_ariaware.com/attachments/20061220/4c4e3679/attachment.html 


More information about the Arp mailing list