Hi,
i had change the idea to do it ...my page will be left menu bar (few report
links) and content page. Once click on the report link, it will load the
report and Pop up a modal window at the same time. The modal window has
some message and a cancel button.
What i want is the report is running at the background until finish. But
when user click on cancel button then it will stop the process. The main
reason i need to have this feature is because the report page will be load a
huge data. The modal window just facilities the user whether want to stop
the backend process or not if user don't wish to wait the report page load
until finish.
the way i tried is
1) normal link for the left menu bar ( once link is clicked , setResponse to
the report page )
2) Once the report page is first loading, pop up a modal window at the same
time with cancel button
So, in this report page , i had create a modal window component
final ModalWindow cancelReportModal = new
ModalWindow("cancelReportModal");
add(cancelReportModal);
cancelReportModal.setPageMapName("cancelReportModal");
cancelReportModal.setCookieName("cancelReportModal");
cancelReportModal.setResizable(false);
cancelReportModal.setInitialWidth(30);
cancelReportModal.setInitialHeight(12);
cancelReportModal.setWidthUnit("em");
cancelReportModal.setHeightUnit("em");
cancelReportModal.setPageCreator(new ModalWindow.PageCreator()
{
public Page createPage()
{
return new CancelReportModalPage(reportPage.this);
}
});
cancelReportModal.setOutputMarkupId(true);
From the wicket example, it use ajaxLink to call up the modal widow once
the user click on the link ( mean onClick function is performed )
final AjaxLink ajaxLink ;
ajaxLink = new AjaxLink("cancelReportModalLink"){
@Override
public void onClick(AjaxRequestTarget target) {
cancelReportModal.show(target);
}
};
But in here , i don't any idea how to auto display the modal window on
screen. i had tried for the solution given from this forum
(http://www.nabble.com/modal-window-question---opening-a-modal-window-on-page-load-to12586008.html)
which talk about
getBodyContainer().addOnLoadModifier(
new ClickOnceOnLoadModel( modalWindowOpeningLink ), null );
put inside the page constructor. but i cant get it also...
i had tried also to auto load the onClick functinby this way. but failed to
do that too...
AjaxLink link ;
AjaxRequestTarget target2 = new AjaxRequestTarget();
add(link = new AjaxLink("cancelReportModalLink")
{
public void onClick(AjaxRequestTarget target)
{
System.out.println(" target = " + target);
triggerTarget = target;
System.out.println(" triggerTarget = " + triggerTarget);
cancelReportModal.show(target);
}
});
link.onClick(triggerTarget);
the target value all the while also retun NULL value
can somebody give some reference to me .. is that possible the to load the
modal window automatically without the click the button?
Thanks in advance
Post by kenixwongyes...i have the same question here.... can wicket do that. For my case,
When my page is onload, Ajax Modal window is auto loaded ( Not click
button to load modal window). This modal window will display the message
and 2 button ( stop and continue ). Once the user click the stop button,
mean backend process is stop. If continue button is click, it will send
response to load a report page at the current page.
i had searched the forum as below link , but i still cant get the
solution yet.
http://www.nabble.com/modal-window-question---opening-a-modal-window-on-page-load-to12586008.html#a12598786
Can anybody help or give more explanation on it ?
thanks in advance
Post by Matej KnoppIt can. But you have to call the javascript on your own. It's not a
trivial thing to do.
-Matej
Post by netforkI have a question.
When my page is onload, can Ajax Modal window be loaded?
It's auto loaded. Not click button to load modal window.
Please help me.Thanks a lot!
--
http://www.nabble.com/When-page-is-onload%2C-can-Ajax-Modal-window-be-loaded--tf3857232.html#a10927996
Sent from the Wicket - Dev mailing list archive at Nabble.com.
--
View this message in context: http://www.nabble.com/When-page-is-onload%2C-can-Ajax-Modal-window-be-loaded--tp10927996p15154810.html
Sent from the Wicket - Dev mailing list archive at Nabble.com.