cancel
Showing results for 
Search instead for 
Did you mean: 

General popup handling

Former Member
0 Kudos

Hello experts,

I'm looking for recommendations concerning mutliple popup usages in a WD component.

For example when I have to display 3 different popups in just 1 application, what's the best way to realize that?

Should I create 1 window and 1 view for each popup?

Or just 1 window and 1 main view which is then firing the inbound plugs of the other 3 views after evaluating the conditions?

Just wonder what's the bet solution, any ideas?

Best regards, Steffen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

In my opinion creating 3 window with 3 views will be the cleaner option.

Code will be less cluttered and you will have less if else statements.

Firing Plugs and all is extra processing..

Regards

Manas Dua

Former Member
0 Kudos

Hi,

Based on my personal opinions I feel 3 window with 3 views as better.

I will list some problems which i faced when we didn follow this.

1. At later stage there was need for extra functionalities to be added which gave extra work.

2. But when a window is just going to have a message or a single action button window and view are not necessary.

So kindly take this into note and decide.

Thanks,

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I will add my 2 cents - I agree with the statements made that separate Windows for the Popup Views are the better approach. In addition to the comments already made in support this approach, I like the fact that this makes maintenance easier over time. A programmer coming to this application that has never seen it before will be less confused by the separate windows/view approach - particularly if you are careful how you name the Windows/Views so it is obvious that they are connected.

steffen_weber
Employee
Employee
0 Kudos

Hi everybody,

okay okay, I'm convinced and have to agree that from a maintenance perspective it really makes sense.

My fears was that one view and one window for every (little) popup will overload the component. That's why I decided to use just 1 view and 1 window for 3 popup messages, make the different text blocks visible from condition to condition.

I will change my programming style in further projects according your recommendations.

Thanks a lot!!!!

Best regards, Steffen

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

There are valid concerns around the limitation of too many views. There is a program load size limitation in 7.0 and 7.01 that effects the total number of views in a component. I wouldn't go crazy and create 10 different views/windows in the same Component. For one project I created a central WD Component with just the dialogs. It is then accessed via Component Usage by the rest of the components in the application. This is a way to create reusable dialogs or to better organize/maintain all the dialogs for a particluar large scale application.

That said if there is very little variation between the popups (just different dialog texts), I don't think its innappropriate to use one View/Window dynamically. I would get concerned only if the views were very dissimilar.

steffen_weber
Employee
Employee
0 Kudos

Hi Thomas,

very good points, thanks!

IMO the problem with using just 1 window to display many view in a popup is that you need a kind of "master view". In the INIT method of this master view you have to precess the conditional dispatching, means the firing of the plugs, to the other views, which is not very nice and also not very transparent. At least this is how I have solved it.

Another option might be to bind the text view elements of the popup view to context elements. Then, before calling the popup, you'll need to change these context elements accordingly and provide the different actions for the popup buttons.

There are many ways, but what I learned is that the common way is to have 1 window and 1 view for each popup.

Thanks again!

Steffen

Answers (1)

Answers (1)

Former Member
0 Kudos

It's a good habit to use 1 view and one window for POPUP in the complex WDA components. you can refer to WDR_TEST_POPUP

or WDR_TEST_POPUP_rt for the reference.