Model window issue

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Model window issue

Archana
Hi All,

I need some help regarding the model window.

My web page contains some components. On click of a icon a model window 1 opens. Model window 1 extends a panel. Model window 1 has a "create" button, on click of which another model window i.e. the Model window 2 opens. On open of Model window 2, I want to hide the Model window 1 or make it inactive so that it will not be selected.

Can I do that any way. I have tried to close() and setVisible() for the Model window 1. It did not work.

Thanks in advance.
Thanks & Regards,
Archana
Reply | Threaded
Open this post in threaded view
|

Re: Model window issue

rmattler
I do this in my app.  I open a modal window and when you hit save I open another modal window to confirm your save and if you confirm I close both modal windows.

modalConfirm.close(target);
modalSelectDate.close(target);


        IndicatingAjaxLink<Void> btnConfirmSave = new IndicatingAjaxLink<Void>("btnConfirmSave") {

                                @Override
                                protected IAjaxCallDecorator getAjaxCallDecorator() {
                                        return new AjaxPostprocessingCallDecorator(super.getAjaxCallDecorator()) {
                                                private static final long serialVersionUID = 1L;

                                                @Override
                                                public CharSequence postDecorateScript(CharSequence script) {
                                                        return script + "this.disabled = true; this.style.display = \"none\";";
                                                }

                                                @Override
                                                public CharSequence postDecorateOnSuccessScript(CharSequence script) {
                                                        return script + " this.disabled = false;";
                                                }
                                        };
                                }
                               
                                @Override
                                public void onClick(AjaxRequestTarget target) {
                                        if (target != null) {
                                               
                                               
                                                for (Positions position : positions) {
                                                        position.setVolunteersByFkVolunteerScheduled(session.getVolunteers());
                                                        positionsDAO.save(position);
                                                }

                                        // wmc.setVisible(false);
                                                target.addComponent(wmc);
                                                modalConfirm.close(target);
                                                modalSelectDate.close(target);
                                               

                                        }
                                       
                                }
                               
                        };
                       
                        btnConfirmSave.setOutputMarkupId(true);
                        btnConfirmSave.setMarkupId("buttonConfirmOK");
                        add(btnConfirmSave);
Reply | Threaded
Open this post in threaded view
|

Re: Model window issue

Archana
In my application both the model windows are pretty much of same size. So when one model window opens on the other one, it looks very odd. for that reason I need to some how make the underneath model window inactive or hidden, so that it will not look odd. I can not close the Model window 1 as it is the parent one. If I close it the child i.e. Model window 2 will not open.

Please give me some suggestions on this.
Thanks & Regards,
Archana