I have a page with AjaxLazyLoadPanel, which contain a long-loading list and submitting AjaxButton.
After the AjaxLazyLoadPanel is ready, when I submit, the another long-loading is executing, and after that I need to refresh whole page. This is where I get myself, the code looks as follows:
AjaxButton button1 = new AjaxButton("submit1") {
@Override
protected void onSubmit(AjaxRequestTarget target, Form form) {
someLongWorkingMethod();
setResponsePage(page); //refreshing page
}
};
add(button1);
And it works perfectly. But what I'm trying to do now - is to disable this button or hide this button (or the whole panel if its necessary) when the method is computing, and when the page refresh with setResponsePage I'd like to have this button back.
I've read many posts/mailing lists about it but nothing helped me, I tried all things that I found and placed it before someLongWorkingMethod():
ajaxLazyLoadPanel.setOutputMarkupId(true);
ajaxLazyLoadPanel.setOutputMarkupPlaceholderTag(true);
ajaxLazyLoadPanel.add(new AttributeAppender("style","display:none;"));
ajaxLazyLoadPanel.setVisible(false);
ajaxLazyLoadPanel.setEnabled(false);
target.add(ajaxLazyLoadPanel);
And the same not for ajaxLazyLoadPanel but for "this" (AjaxButton).
Am I doing something terribly wrong or what? Is this what I'm trying to do even possible? I would really appreciate some help.