Noah Martin
Noah Martin

Reputation: 1809

How to call af:popup from another page?

I have used af:popup a lot in my application and I call the popup only from the pages in which it is created. For example, if popup1 is created in Page1, I can call it only from this page!

I want to call a popup being created within Page1 from Page2. The real scenario is that I want to create the popup within the pageTemplate, and use it everywhere.

The problem with this is that it does not recognize the bindings that are used in the popup when called from another page. Does anyone know how to fix or avoid this? Please tell me what approach have you used in this case? Thanks

Upvotes: 1

Views: 626

Answers (2)

Joe
Joe

Reputation: 3347

Actually 1 Page Definition (Binding Container) per page is not a hard/fixed restriction. You can use the same PageDef for more than one page. Admittedly unusual but works. Go to the Databindings.cpx file. You will notice that the jspx page is associated with its pagedef file, not by tightly coupled/direct reference, but by an indirect UsageID. Edit the metadata to have page1 and page2 use the same page definition file, via the usageID. Then the binding container will be shared by both pages.

BUT, PageTemplates can have their own page bindings - have you tried this?

Upvotes: 3

gnunaes
gnunaes

Reputation: 186

If the problem you're having is the popup when used on Page2 isn't recognizing the bindings from Page1 it's because you don't have those bindings on Page2. Check your Page2 bindings, and ensure you've got the same ones (need to be named the same as well). You will need to add them if they aren't there! Each page has its own set of bindings.

I hope this helps.

Upvotes: 0

Related Questions