Hi,
I am sure sombody has to go through this. PopUp In PureMVC.... But Not performing any events.... I know why..
Mediator for pop component is initializing befor you have the component.. Check the solution below...
//reportPopup is of type customComponent(PdfReportFrame).
reportPopup = PopUpManager.createPopUp(this.payrollModule,PdfReportFrame,true) as PdfReportFrame;
registerMediator(new PdfReportFrameMediator(reportPopup, source));
PopUpManager.centerPopUp(reportPopup);
Ranjit
Showing posts with label PureMVC. Show all posts
Showing posts with label PureMVC. Show all posts
Thursday, May 20, 2010
Friday, May 14, 2010
Multiton/singleton AS3 for Modules Flex / PureMvc / Fabrication
Hi Friends,
Was wondering how to reference a singleton instance for particular Module in flex..
after reading few blog and googling ..
found a solution/rather built upon it .. thought this might be helpful to somebody…
Most things in AS are built on Java so Looked at Java Mulitone >> and there is the solution…
import flash.utils.Dictionary;
public class InternalModelLocator
{
private static var instances:Dictionary= new Dictionary();//Dictionary is treated as Java Hash Map
public function InternalModelLocator()
{
/* Only One Instance created with GetInstanceMethod*/
}
/* module_uuid can be a String --------
In case of PureMVC "multitonKey" (this.multitonKey) can be used as unique key for multiple modules
*/
public static function getInstance(module_uuid:String):InternalModelLocator
{
var instance:InternalModelLocator = instances[module_uuid];
if(instance == null)
{
instance = new InternalModelLocator();
instances[module_uuid] = instance;
}
return instance;
}
}
Let me know if I miss some thing or needs more elboration….
Was wondering how to reference a singleton instance for particular Module in flex..
after reading few blog and googling ..
found a solution/rather built upon it .. thought this might be helpful to somebody…
Most things in AS are built on Java so Looked at Java Mulitone >> and there is the solution…
import flash.utils.Dictionary;
public class InternalModelLocator
{
private static var instances:Dictionary= new Dictionary();//Dictionary is treated as Java Hash Map
public function InternalModelLocator()
{
/* Only One Instance created with GetInstanceMethod*/
}
/* module_uuid can be a String --------
In case of PureMVC "multitonKey" (this.multitonKey) can be used as unique key for multiple modules
*/
public static function getInstance(module_uuid:String):InternalModelLocator
{
var instance:InternalModelLocator = instances[module_uuid];
if(instance == null)
{
instance = new InternalModelLocator();
instances[module_uuid] = instance;
}
return instance;
}
}
Let me know if I miss some thing or needs more elboration….
Wednesday, May 12, 2010
Create/Register Mediator for Runtime created UIComponent Like adding into Pop up - PureMVC
Hi Friends,
Here I am again Puting accross point where I thought for second.
The solution for registering mediator for component in popup created at run time is below.
reportPopup = PopUpManager.createPopUp(this.payrollModule,PdfReportFrame,true) as PdfReportFrame;
registerMediator(new PdfReportFrameMediator(reportPopup)); //this without resolving component on parent
PopUpManager.centerPopUp(reportPopup);
Every thing else goes same way.
Ranjit
Here I am again Puting accross point where I thought for second.
The solution for registering mediator for component in popup created at run time is below.
reportPopup = PopUpManager.createPopUp(this.payrollModule,PdfReportFrame,true) as PdfReportFrame;
registerMediator(new PdfReportFrameMediator(reportPopup)); //this without resolving component on parent
PopUpManager.centerPopUp(reportPopup);
Every thing else goes same way.
Ranjit
Subscribe to:
Comments (Atom)