Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

* | |

  Show Posts
Pages: 1 [2] 3
16  Announcements and General Discussion / General Discussion / Re: 1 mediator 2 views on: May 19, 2008, 12:49:13
dispatchEvent( new Event( TERMINOU_SPLASH, true ));

originally and lastly ive always tried with bubbling... the second parameter, right?
17  Announcements and General Discussion / General Discussion / Re: 1 mediator 2 views on: May 18, 2008, 03:17:58
Thanks cliff...
but ive tried all. :(
i cannot figure out how the addEventListener on mediator never dispares the function :( (never listen the dispatchedevent)

maybe its because im using the application mediator registered with the initial mxml? i guess not... but im a bit lost :(
18  Announcements and General Discussion / General Discussion / Re: 1 mediator 2 views on: May 18, 2008, 09:40:18
Thanks, but can you give me an example, how to achieve something like this? :(
sorry disturbing...
19  Announcements and General Discussion / General Discussion / Re: 1 mediator 2 views on: May 17, 2008, 10:37:01
aaaaaa.. ive tried all i cannot dispatch :(

:
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml">

<mx:Script> <![CDATA[
//public static const TERMINOU_SPLASH:String = "terminouSplash";
import com.empresa.Teste.ApplicationFacade;
import flash.events.Event;

private function inicia():void
{
// dispatchEvent( new Event( TERMINOU_SPLASH ));
// parent.dispatchEvent( new Event( ApplicationFacade.SHOW_LOGIN, true ));
// dispatchEvent( new Event( ApplicationFacade.SHOW_LOGIN, true ));
}
]]> </mx:Script>
<mx:Image creationComplete="inicia()"/>
</mx:Canvas>

ive tried using event meta too
but i simply cannot catch the event in the applicationmediator :(
with addeventlistener

:(
on my first application screen mxml. (registered on start with applicationmediator.as)
i have a viewstack
the first item is the splashscreen
the second one, a loginform

its like a model that i have to make applications or sites
because if it not uses loginform... it can use another thing
so the splashscreen is the first one automatically registered
when thinking about the deferred instatiation management, done in the applicationmedatior.
i just dont want to use a mediator for splashscreen... :( becuase would be just to dispatch a single event... :(

thanks... its the last thing before i can start to work.. :)
20  Announcements and General Discussion / General Discussion / 1 mediator 2 views on: May 16, 2008, 01:37:01
how to register more than one view with same mediator?
21  Announcements and General Discussion / General Discussion / WHATS EVENT METATAG? on: May 14, 2008, 07:38:36
whats that event metatag, on the best practices document, in the mxml file for example?

i know i know that is about declaring event to the compiler, to use like a tag on component i dunno exactly, ive read on the manual... it can be on mxml or in the script too...
ive never used it.. and things works... im afraid that im missing something
seeing the loginform.mxml on the document, for example, i did not catch the utility of it, since its ='tryLogin' maybe if it was TRY_LOGIN hehe... im missing something

thanks
22  Announcements and General Discussion / Getting Started / Re: Doubt about views on: May 07, 2008, 01:33:21
thanks
i got it!!
var janela:TitleWindow=PopManager.openPopUp(Retry, RetryMediator);
janela.tests.text="ase";

worked but... i must changed the name, from popupmanager to popmanager, because popupmanager is already from flex, i dunno, he doesnt seems to liked even with another package...
i corrected too the name openpopupwindow to openpopup, i guess, you not perceived that ;)
and finally ive changed iflexdisplayobject, to titlewindow... on all places
obviously on my mediator, ive put a import of my retry titlewindow mxml

i also needed to cast as titlewindow
var window:TitleWindow = PopUpManager.createPopUp( Application.application as Sprite, ComponentClass, modal ) as TitleWindow;
on the popmanager code
:)
worked, now i can dynamically change the contents :)
im using it as a enhanced alertbox thing...
in this case.. dynamic, because im using a timer...
if a resultfault event... happens.. it try 3...2...1.. seconds.. :) and have a cancel button, to not try anymore :) sweet
a little offtopic.. ive also managed my proxy... to just one result and fault event :)
in the result ive used "if then" to compare what service was called :)

if(!service.operations.leusuarios==false)
{
    //setData( event.result );
    sendNotification( SERVICO_SUCESSO, event.result, "leusuarios" );
}
sweeeeeettt :)
so in the same result, i can parse which one :)
like something about your mediator handler approach :)
then on the mediator, ive just nested a switch with getType() :)
sweeet
on the fault event ive did the same...

NICE :)
thanks cliff...
23  Announcements and General Discussion / Getting Started / Doubt about views on: May 07, 2008, 09:11:37
hello everyone...
im so excited starting my first app...
ive got some doubts..
my app have few "form views screens" plus few "windows"...
the windows thing, im sure that i must use popupwindow of a mxml titlewindow thing
okay, i can register it with a mediator, and popup it...
but... im in trouble with a thing: i want to have a general use one... that i can customize for example whats inside a text control, inside of a "generic" titlewindow, like for alert things with the possibility of some advanced behaviour than alertbox...
since its POPPED... i dunno how to access a control inside of it from the code where i instancied it (POPPEDUP IT) !!!! like a text control... (INSTEAD USING THE PARTICULAR TITLEWINDOW MEDIATOR... BECAUSE I WANT IT GENERIC... SO I CAN ACCESS DIRECTLY... IF AT LEAST I COULD ACCESS A FUNCTION ON THE TITLEWINDOW MEDIATOR, LIKE A GENERIC SETTER... BUT I DUNNO HOW TO ACCESS EVEN THE MEDIATOR OF THIS THING INSTANTIED, I MEAN POPPED heheh.... )

PLEASE HELP MEEEEEEEEEEEEE i must start this app soon.. because ive spent 3 months studying all this fascinating new world for me...

the second doubt, is the classical question about, views... viewstack... deferred instantiation, best practice, mediator, mediator registration, proxy for states, bla bla, whats the recommended approach on your point of view actually?

i think that many ppl can face this problem like me..
thanks everyone! :)
24  Announcements and General Discussion / General Discussion / My last confusions DATA on: April 19, 2008, 04:56:35
okay...
i will try to start integrate amfphp remoting on it...
then some questions made me lost...

1. still confused where is the place to initialize a new VO()... in a view ADD command for example? only if it dont passes value? in the SUPER inside proxy constructor? and why i see in examples the second argument of super, being an array for example, or even in the constructor header? im lost! hehe

2. i think i must build a business delegate to connect with amfphp... so business delegate its only a connector? with all that asynctoken stuff that i really did not fully understand.... or business delegate also is a place of 'common methods' i saw in a example some add, update, delete, on business delegate... strange.. i was thinking that business delegate just connect and other things is managed by the proxy... so business delegate can be a common place for common proxy tasks that can be reused? o.O

3. as i said im trying to start using amfphp... ive step debugged and i feel strange that it seems just passing through constructor before registering the proxy.. i dunno... feel strange the sequence that the application runs.. in step.. seems somelike backward o.O... i need a little help where to put the things... and sometimes i saw a xml file like service config something like that... where put some uri stuff (endpoint) to amfphp.. but i also read that its not necessary and can be done via actionscript...

someone SAVE-ME! o.O
im LOOOOOOOOOOST hehe

thanks everyone
25  Announcements and General Discussion / General Discussion / Re: Proxy VO Getters on: April 18, 2008, 01:15:57
okay.. im thinking that i can initialize the view either by vo values... and
values that i want (direct initializing)
depends each case... :)
26  Announcements and General Discussion / General Discussion / Re: Proxy VO Getters on: April 18, 2008, 12:40:18
WOW! think that now all worked!! traced in both places (command and proxy getter) :)

thanks cliff...

and i can understand by all this stuff. that the VO must be initialized just one time!, in one place.. im correct? :)

so...

on the view...

ive let the bindable this way now (without initialize)


        [Bindable]
        public var valor:Valor;


and in the mediator
im getting in the constructor...
am i right? :)
or i should put in another place?
like an event onComplete
hmm i think if i want initialize a series of controls
i can put it in a command right?
thanks.. and correct me if i need :)


        public function MainViewMediator( viewComponent:Object )
        {
            // pass the viewComponent to the superclass where
            // it will be stored in the inherited viewComponent property
            super( NAME, viewComponent );
         
         // retrieve the proxies
         testeProxy = TesteProxy (facade.retrieveProxy( TesteProxy.NAME ));
         
         mainView.addEventListener( MainView.ACRESCENTA_NUMERO, soma );

         mainView.valor=testeProxy.valor;
      }
27  Announcements and General Discussion / General Discussion / Re: Proxy VO Getters on: April 18, 2008, 11:38:12
ive changed the member 'valor' to 'valor1' inside 'valor' object
but... anyway...

i still confused...
im initializing the object in the view... and in the proxy...

...(new Value(0))...

if i trace the getter in a command
or even inside the getter
ive got "object object"
but when i trace the .valor
or return of the getter in command
or even of the 'data' in getter
i get 0

it seems that the vo isnt updating

sorry all inconvenience but its the only thing
that im get chained to start to work in puremvc
actually...
:)
thanks cliff


28  Announcements and General Discussion / General Discussion / Re: Proxy VO Getters on: April 18, 2008, 08:30:43
okay, im posting my VO too...

   [RemoteClass(alias="com.drm.Login.model.vo.Valor")]
   
   
   [Bindable]
   public class Valor
   {

      public var valor : uint;
      
      public function Valor( valor : uint )
      {
         this.valor = valor;
      }
   }


note, that it receives the initial argument
my intention is that its initialized with value 0
new Valor(0)
so this way the label.text (bindable) start with 0...

im doing wrong approach?

thanks rhysyng and hall
29  Announcements and General Discussion / General Discussion / Re: Proxy VO Getters on: April 18, 2008, 08:26:28
Hmm.. so how i let my view now?... actually its this way:

   <mx:Script>
   
      <![CDATA[
      
         import com.drm.Login.ApplicationFacade;
         import com.drm.Login.model.vo.Valor;
         
         public static const ACRESCENTA_NUMERO: String = "acrescentaNumero";
         public static const ACRESCENTOU_NUMERO: String = "acrescentouNumero";
                  
         [Bindable]
         public var valor:Valor=new Valor(0);
                              
         public function botaoSomar():void{
            dispatchEvent (new Event(ACRESCENTA_NUMERO));            
         }   
         
      ]]>
   </mx:Script>
   
   
   <mx:HBox>
   <mx:Button id="somarBtn" label="Soma" click="botaoSomar()"/>
   <mx:Label id="numLabel" text="{valor.valor}"/>
   </mx:HBox>   

MANY THANKS AND SORRY FOR DISTURBING...
30  Announcements and General Discussion / General Discussion / Re: Proxy VO Getters on: April 18, 2008, 07:47:58
im not using the getter on the view! :)

im trying to trace a getter in the command.. just to know how to retrieve some value from the value object, through the proxy...

i feel that im still little confused about VO and PROXY relationship...
something between the getter... and how to access the imported VO in proxy to retrieve the data.. since its initializaed on the view as you saw in the bindable...(new Valor(0))...

take a look my proxy

package com.drm.Login.model
{
   import com.drm.Login.ApplicationFacade;
   import com.drm.Login.model.vo.Valor;
   
   import org.puremvc.as3.interfaces.*;
   import org.puremvc.as3.patterns.proxy.Proxy;
         
   /*
   testando um proxy
    */
   public class TesteProxy extends Proxy implements IProxy
   {
      
      public static const NAME:String ="TesteProxy";
         
      public function TesteProxy()
      {
         //the vo is initialized on the view with the 0 value...
         //is bindable... so it automatically update de label.text
         //its work fine
         super (NAME);

      }

      public function acrescentaNumero(valor:Valor):void{
         //the command pass to here.. the valor object..
         //then adds a number to it... hmm i really updating the VO?
         //i guess that yes its..
         //it just works.
      valor.valor++;
      sendNotification(ApplicationFacade.ACRESCENTOU_NUMERO,valor);
      
      }
      public function get valor( ) : Valor {
         //i cant figure out how to do this...
         trace (data);  //but whats data?? hehehe
                     //i know that must be on the proxy constructor
                     //but... im not initializing in the proxy!
                     //how can i access it?
                     //im little confused.
                     //can help me please? :)
         return data as Valor;

      }
         
   }

}
Pages: 1 [2] 3