Carla Leite
Carla Leite

Reputation: 23

Calling pop up from different pages .jsf

Does anyone know how I can get the same pop up via a button located on different pages (.JSF)?

That is, there is a button "add file" which then opens a pop up with a form where the user adds information about the file. As the pop up is always the same I was thinking of using declarative components. However, I do not understand how.

Upvotes: 0

Views: 1008

Answers (2)

Endrik
Endrik

Reputation: 2258

I might think about three different ways to achieve this:

1) As @Pregrad said, you can create a Bounded Task Flow and expose this BTF as region (or dynamic region) in every page you need it as a popUp window (recommended if you are using transactions)
2) You can create page templates, put the af:popUp in them and apply the template for each page (recommended if you already have templates, and you need the popUp for each page on your application)
3) You can put the af:popUp component on each page you need it, and then call it programmatically. This approach may be would give you more control on the popUp behaviour but would require you to handle it manually.
The approach you should use does really depend on your needs.

Upvotes: 1

Predrag Maric
Predrag Maric

Reputation: 24433

You can create a taskflow which will contain your page with upload form, and then reuse it on other pages as af:region. Check out this great post with an example how to do it.

Upvotes: 2

Related Questions