Skip navigation
Currently Being Moderated

Getting data from context into Popup (Cairngorm 3 + Parsley)

Mar 1, 2010 1:01 PM

Hello,

 

I am having difficulty accessing a shared object form a PopUp that is part of a module.

 

In my module I have the following defined in my module's context.

 

<domain:CustomerDetail/>

 

In one PM I have the following...

 

[Inject]
[Bindable]
public var selectedCustomer:CustomerDetail;

 

This PM also sets the value of selectedCustomer;

 

The view for this PM also has a PopUp defined...

 

    <popup:PopUpWrapper open="{model.showCustomerDetailsDialog}"
                        opened="model.initDetailsPopup(event)"
                        closed="model.handlePopUpClosed(event)"
                        parent="{this}"
                        center="true" modal="true">
        <presentation:DetailsDialog/>
        <popup:behaviors>
            <popup:AddPopUpToParsleyContext context="{context}"/>
        </popup:behaviors>
    </popup:PopUpWrapper>

 

And in the PM for the PopUp I have...

 

        [Inject]
        [Bindable]
        public var customer:CustomerDetail;

 

When I look at this customer object in PopUp PM it is always null.  Another object that is defined in the parent shell applicaiton's context however is not null.  Th eonly way i can seem to set the customer object in the PopUp PM is to explicitly set it during the opening event in the PM that launches the PopUp.

 

Has anyone seen this behaviour?  Does anyone have a sample of using Popups with Cairngorm + Parsley and modules?

 
Replies
  • Currently Being Moderated
    Mar 8, 2010 3:42 AM   in reply to Anthony.R

    Perhaps you forgott to Inject thie context?

     

    [Inect]

    [Bindable]

    public var context::Context; //don't no the full classname, just use your AutoComplete to import it.

     

    How do you know that  "public var selectedCustomer:CustomerDetail" isn't null? You also have to call the "ConfigureView" (parlsey 2.3) or "ConfigureIoc" Event on the component addedToStage event. If not called, the context won't be inected either.

     

     

    I've made it to work and i can provide you an example later this day.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 8, 2010 2:41 PM   in reply to Anthony.R

    Sry, haven't seen that you was talking about modules.

    Why don't you post the full source of the mxml file on the parsley forum . The developer of parsley is always answering the threads.

    Actually i can't see any reason, why not to pass the reference to the popup directly. Sure it's not so cool like an iject tag, but it would be also a dependecy injection. A setter injection if being precize.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 15, 2011 4:17 AM   in reply to AndrejLr

    why do you have a double colon?

     

    public var context::Context;

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2011 8:24 AM   in reply to nikos101

    True, that double colon was probably a typo. BTW, this is an old post. With newer Parsley versions you'd probably want to use Parsley's PopUp tag, which doesn't need any Context/view wiring usage. It uses the C3 popup lib beind the scences.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2011 9:37 AM   in reply to Alex Uhlmann

    really nice is this out yet, also are there plans to get signals as messages, I hate buggy event strings

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2011 9:38 AM   in reply to nikos101

    No plans, but please feel free to add a patch via the JIRA bugbase.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points