Hi all,

I have a page where I have put an AjaxFallBackButton() and also have a Panel
on it. I want to make the panel visible or invisible by clicking the button.
Kindly refer to the code below:

//Code for the TestPage
public TestPage() {
                Form form = new Form("form");
                add(form);
                button = new AjaxFallbackButton("button", form) {
                        private static final long serialVersionUID = 1L;

                        @Override
                        protected void onSubmit(AjaxRequestTarget target, Form 
form) {
                                target.addComponent(testPanel);
                                testPanel.setVisible(!testPanel.isVisible());
                        }
                };
                form.add(button);
                testPanel = new TestPanel("testPanel");
                form.add(testPanel);
                testPanel.setOutputMarkupId(true);
        }

//Code for the Panel
public TestPanel(String id) {
                super(id);
                add(new Label("testPanel", "Testing New Panel"));
        }

The problem is that when I click the button, the Panel becomes invisible.
However when I click it again the panel doesn't show up until or unless the
entire page is refreshed. I am newbie to Wicket and I know I am making a
basic mistake but I havn't been able to figure this out. Kindly let me know
where I am going wrong. Thank in advance!!!

vishy
-- 
View this message in context: 
http://www.nabble.com/Problem-making-Panel-visible-using-AJAX-tp18413807p18413807.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to