Hi this is part of my code. Something like that:

                        final DateTimeField from = new DateTimeField("start", 
new Model());
                        add(from);
                        final DateTimeField till = new DateTimeField("end", new 
Model());
                        add(till);
                        final DropDownChoice ddc3 = new 
DropDownChoice<String>("types", new
Model(), Types.toStringList());
                final ModalWindow modalWindow = new ModalWindow("modal");
                modalWindow.setCookieName("resultModal");
                modalWindow.setOutputMarkupId(true);
                add(modalWindow);
                        add(ddc3);

                        add(new AjaxButton("search") {
                        private static final long serialVersionUID = 1L;

                                protected void onSubmit(AjaxRequestTarget 
target, Form form) {
                                        super.onSubmit();
                                        final HashMap<String,Object> params = 
new HashMap<String,Object>();
                                        if(from.getConvertedInput() != null){
                                                logger.info("from");
                                                Date fromDate = 
from.getConvertedInput();
                                                params.put("from", fromDate);
                                        }
                                        if(till.getConvertedInput() != null){
                                                logger.info("till");
                                                Date tillDate = 
till.getConvertedInput();
                                                params.put("till", tillDate);
                                        }
                                        if(ddc1.getConvertedInput() != null){
                                                logger.info("ddc1");
                                                String channel =
(String)ddc1.getChoices().get(Integer.parseInt(ddc1.getValue()));
                                                params.put("channel", channel);
                                        }
                                        if(ddc2.getConvertedInput() != null ){
                                                logger.info("ddc2");
                                                String program =
(String)ddc2.getChoices().get(Integer.parseInt(ddc2.getValue()));//
                                                params.put("program", program);
                                        }
                                        if(ddc3.getConvertedInput() != null){
                                                logger.info("ddc3");
                                                String type = (String) 
ddc3.getValue();
                                                params.put("type", type);
                                        }
                                        if(params.values().size() > 0){
                                                IModel resultModel = new 
LoadableDetachableModel() {
                                                        private static final 
long serialVersionUID = 1L;

                                                        protected Object load() 
{
                                                return 
getProgramService().getSearchResults(params);
                                            }
                                        };                                      
        

                                        modalWindow.setContent(new 
SearchResults(modalWindow
.getContentId(), modalWindow, resultModel));
                                        target.addComponent(modalWindow, 
"modal");
                                        logger.info("hey hey");
                                        modalWindow.show(target);
                                        }
-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/modalWindow-setContent-tp2714385p2714631.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to